Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
e889cf7b
Commit
e889cf7b
authored
May 15, 2020
by
aniket-engg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dynamic filename
parent
c27ed724
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
gasCosts.ts
remix-analyzer/src/solidity-analyzer/modules/gasCosts.ts
+4
-3
No files found.
remix-analyzer/src/solidity-analyzer/modules/gasCosts.ts
View file @
e889cf7b
...
@@ -24,7 +24,7 @@ export default class gasCosts implements AnalyzerModule {
...
@@ -24,7 +24,7 @@ export default class gasCosts implements AnalyzerModule {
report
(
compilationResults
:
CompilationResult
):
ReportObj
[]
{
report
(
compilationResults
:
CompilationResult
):
ReportObj
[]
{
const
report
:
ReportObj
[]
=
[]
const
report
:
ReportObj
[]
=
[]
const
filename
=
Object
.
keys
(
compilationResults
.
contracts
)[
0
]
const
methodsWithSignature
=
this
.
warningNodes
.
map
(
node
=>
{
const
methodsWithSignature
=
this
.
warningNodes
.
map
(
node
=>
{
let
signature
;
let
signature
;
if
(
node
.
nodeType
===
'FunctionDefinition'
)
if
(
node
.
nodeType
===
'FunctionDefinition'
)
...
@@ -39,8 +39,8 @@ export default class gasCosts implements AnalyzerModule {
...
@@ -39,8 +39,8 @@ export default class gasCosts implements AnalyzerModule {
}
}
})
})
for
(
const
method
of
methodsWithSignature
)
{
for
(
const
method
of
methodsWithSignature
)
{
for
(
const
contractName
in
compilationResults
.
contracts
[
'test.sol'
])
{
for
(
const
contractName
in
compilationResults
.
contracts
[
filename
])
{
const
contract
=
compilationResults
.
contracts
[
'test.sol'
][
contractName
]
const
contract
=
compilationResults
.
contracts
[
filename
][
contractName
]
const
methodGas
:
any
=
this
.
checkMethodGas
(
contract
,
method
.
signature
)
const
methodGas
:
any
=
this
.
checkMethodGas
(
contract
,
method
.
signature
)
if
(
methodGas
&&
methodGas
.
isInfinite
)
{
if
(
methodGas
&&
methodGas
.
isInfinite
)
{
if
(
methodGas
.
isFallback
)
{
if
(
methodGas
.
isFallback
)
{
...
@@ -79,6 +79,7 @@ export default class gasCosts implements AnalyzerModule {
...
@@ -79,6 +79,7 @@ export default class gasCosts implements AnalyzerModule {
if
(
gas
===
null
||
parseInt
(
gas
)
>=
3000000
||
gas
===
'infinite'
)
{
if
(
gas
===
null
||
parseInt
(
gas
)
>=
3000000
||
gas
===
'infinite'
)
{
return
{
return
{
isInfinite
:
true
,
isInfinite
:
true
,
isFallback
:
false
,
msg
:
gasString
msg
:
gasString
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment