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
dd3edce0
Commit
dd3edce0
authored
Feb 27, 2020
by
aniket-engg
Committed by
Aniket
Mar 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commons, modules & test ASTs updated
parent
04dccc92
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
831 additions
and
767 deletions
+831
-767
blockTimestamp.ts
...-analyzer/src/solidity-analyzer/modules/blockTimestamp.ts
+6
-6
deleteFromDynamicArray.ts
...r/src/solidity-analyzer/modules/deleteFromDynamicArray.ts
+4
-4
etherTransferInLoop.ts
...yzer/src/solidity-analyzer/modules/etherTransferInLoop.ts
+1
-1
guardConditions.ts
...analyzer/src/solidity-analyzer/modules/guardConditions.ts
+3
-3
noReturn.ts
remix-analyzer/src/solidity-analyzer/modules/noReturn.ts
+1
-1
selfdestruct.ts
remix-analyzer/src/solidity-analyzer/modules/selfdestruct.ts
+2
-3
similarVariableNames.ts
...zer/src/solidity-analyzer/modules/similarVariableNames.ts
+1
-1
staticAnalysisCommon.ts
...zer/src/solidity-analyzer/modules/staticAnalysisCommon.ts
+0
-0
stringBytesLength.ts
...alyzer/src/solidity-analyzer/modules/stringBytesLength.ts
+6
-6
thisLocal.ts
remix-analyzer/src/solidity-analyzer/modules/thisLocal.ts
+1
-1
types.ts
remix-analyzer/src/types.ts
+7
-5
assignment.json
remix-analyzer/test/analysis/astBlocks/assignment.json
+42
-52
blockHashAccess.json
remix-analyzer/test/analysis/astBlocks/blockHashAccess.json
+15
-11
doWhileLoopNode.json
remix-analyzer/test/analysis/astBlocks/doWhileLoopNode.json
+65
-172
forLoopNode.json
remix-analyzer/test/analysis/astBlocks/forLoopNode.json
+0
-0
functionDefinition.json
...-analyzer/test/analysis/astBlocks/functionDefinition.json
+74
-15
inheritance.json
remix-analyzer/test/analysis/astBlocks/inheritance.json
+17
-11
inlineAssembly.json
remix-analyzer/test/analysis/astBlocks/inlineAssembly.json
+94
-5
libCall.json
remix-analyzer/test/analysis/astBlocks/libCall.json
+27
-12
localCall.json
remix-analyzer/test/analysis/astBlocks/localCall.json
+30
-24
lowlevelCall.json
remix-analyzer/test/analysis/astBlocks/lowlevelCall.json
+136
-35
parameterFunction.json
...x-analyzer/test/analysis/astBlocks/parameterFunction.json
+75
-52
selfdestruct.json
remix-analyzer/test/analysis/astBlocks/selfdestruct.json
+51
-17
stateVariableContractNode.json
...er/test/analysis/astBlocks/stateVariableContractNode.json
+0
-0
superLocal.json
remix-analyzer/test/analysis/astBlocks/superLocal.json
+27
-12
thisLocalCall.json
remix-analyzer/test/analysis/astBlocks/thisLocalCall.json
+32
-10
whileLoopNode.json
remix-analyzer/test/analysis/astBlocks/whileLoopNode.json
+64
-167
staticAnalysisCommon-test.ts
remix-analyzer/test/analysis/staticAnalysisCommon-test.ts
+44
-140
library.sol
...er/test/analysis/test-contracts/solidity-v0.5/library.sol
+6
-1
No files found.
remix-analyzer/src/solidity-analyzer/modules/blockTimestamp.ts
View file @
dd3edce0
import
{
default
as
category
}
from
'./categories'
import
{
default
as
category
}
from
'./categories'
import
{
isNowAccess
,
isBlockTimestampAccess
}
from
'./staticAnalysisCommon'
import
{
isNowAccess
,
isBlockTimestampAccess
}
from
'./staticAnalysisCommon'
import
{
default
as
algorithm
}
from
'./algorithmCategories'
import
{
default
as
algorithm
}
from
'./algorithmCategories'
import
{
AnalyzerModule
,
ModuleAlgorithm
,
ModuleCategory
,
ReportObj
,
AstNodeLegacy
,
CompilationResult
}
from
'./../../types'
import
{
AnalyzerModule
,
ModuleAlgorithm
,
ModuleCategory
,
ReportObj
,
AstNodeLegacy
,
CompilationResult
,
IdentifierAstNode
,
MemberAccessAstNode
}
from
'./../../types'
export
default
class
blockTimestamp
implements
AnalyzerModule
{
export
default
class
blockTimestamp
implements
AnalyzerModule
{
warningNowNodes
:
AstNodeLegacy
[]
=
[]
warningNowNodes
:
IdentifierAstNode
[]
=
[]
warningblockTimestampNodes
:
AstNodeLegacy
[]
=
[]
warningblockTimestampNodes
:
MemberAccessAstNode
[]
=
[]
name
:
string
=
'Block timestamp: '
name
:
string
=
'Block timestamp: '
description
:
string
=
'Semantics maybe unclear'
description
:
string
=
'Semantics maybe unclear'
category
:
ModuleCategory
=
category
.
SECURITY
category
:
ModuleCategory
=
category
.
SECURITY
algorithm
:
ModuleAlgorithm
=
algorithm
.
EXACT
algorithm
:
ModuleAlgorithm
=
algorithm
.
EXACT
visit
(
node
:
AstNodeLegacy
):
void
{
visit
(
node
:
IdentifierAstNode
|
MemberAccessAstNode
):
void
{
if
(
isNowAccess
(
node
))
this
.
warningNowNodes
.
push
(
node
)
if
(
node
.
nodeType
===
"Identifier"
&&
isNowAccess
(
node
))
this
.
warningNowNodes
.
push
(
node
)
else
if
(
isBlockTimestampAccess
(
node
))
this
.
warningblockTimestampNodes
.
push
(
node
)
else
if
(
node
.
nodeType
===
"MemberAccess"
&&
isBlockTimestampAccess
(
node
))
this
.
warningblockTimestampNodes
.
push
(
node
)
}
}
report
(
compilationResults
:
CompilationResult
):
ReportObj
[]
{
report
(
compilationResults
:
CompilationResult
):
ReportObj
[]
{
...
...
remix-analyzer/src/solidity-analyzer/modules/deleteFromDynamicArray.ts
View file @
dd3edce0
import
{
default
as
category
}
from
'./categories'
import
{
default
as
category
}
from
'./categories'
import
{
default
as
algorithm
}
from
'./algorithmCategories'
import
{
default
as
algorithm
}
from
'./algorithmCategories'
import
{
isDeleteFromDynamicArray
,
isMappingIndexAccess
}
from
'./staticAnalysisCommon'
import
{
isDeleteFromDynamicArray
,
isMappingIndexAccess
}
from
'./staticAnalysisCommon'
import
{
AnalyzerModule
,
ModuleAlgorithm
,
ModuleCategory
,
ReportObj
,
AstNodeLegacy
,
CompilationResult
}
from
'./../../types'
import
{
AnalyzerModule
,
ModuleAlgorithm
,
ModuleCategory
,
ReportObj
,
CompilationResult
,
UnaryOperationAstNode
}
from
'./../../types'
export
default
class
deleteFromDynamicArray
implements
AnalyzerModule
{
export
default
class
deleteFromDynamicArray
implements
AnalyzerModule
{
relevantNodes
:
AstNodeLegacy
[]
=
[]
relevantNodes
:
UnaryOperationAstNode
[]
=
[]
name
:
string
=
'Delete from dynamic Array: '
name
:
string
=
'Delete from dynamic Array: '
description
:
string
=
'Using delete on an array leaves a gap'
description
:
string
=
'Using delete on an array leaves a gap'
category
:
ModuleCategory
=
category
.
MISC
category
:
ModuleCategory
=
category
.
MISC
algorithm
:
ModuleAlgorithm
=
algorithm
.
EXACT
algorithm
:
ModuleAlgorithm
=
algorithm
.
EXACT
visit
(
node
:
AstNodeLegacy
):
void
{
visit
(
node
:
UnaryOperationAstNode
):
void
{
if
(
isDeleteFromDynamicArray
(
node
)
&&
node
.
children
&&
!
isMappingIndexAccess
(
node
.
children
[
0
]
))
this
.
relevantNodes
.
push
(
node
)
if
(
isDeleteFromDynamicArray
(
node
)
&&
!
isMappingIndexAccess
(
node
.
subExpression
))
this
.
relevantNodes
.
push
(
node
)
}
}
report
(
compilationResults
:
CompilationResult
):
ReportObj
[]
{
report
(
compilationResults
:
CompilationResult
):
ReportObj
[]
{
...
...
remix-analyzer/src/solidity-analyzer/modules/etherTransferInLoop.ts
View file @
dd3edce0
import
{
default
as
category
}
from
'./categories'
import
{
default
as
category
}
from
'./categories'
import
{
default
as
algorithm
}
from
'./algorithmCategories'
import
{
default
as
algorithm
}
from
'./algorithmCategories'
import
{
getLoopBlockStartIndex
,
isTransfer
}
from
'./staticAnalysisCommon'
import
{
isTransfer
}
from
'./staticAnalysisCommon'
import
{
AnalyzerModule
,
ModuleAlgorithm
,
ModuleCategory
,
ReportObj
,
AstNodeLegacy
,
CompilationResult
,
ForStatementAstNode
,
WhileStatementAstNode
,
CommonAstNode
,
ExpressionStatementAstNode
}
from
'./../../types'
import
{
AnalyzerModule
,
ModuleAlgorithm
,
ModuleCategory
,
ReportObj
,
AstNodeLegacy
,
CompilationResult
,
ForStatementAstNode
,
WhileStatementAstNode
,
CommonAstNode
,
ExpressionStatementAstNode
}
from
'./../../types'
export
default
class
etherTransferInLoop
implements
AnalyzerModule
{
export
default
class
etherTransferInLoop
implements
AnalyzerModule
{
...
...
remix-analyzer/src/solidity-analyzer/modules/guardConditions.ts
View file @
dd3edce0
import
{
default
as
category
}
from
'./categories'
import
{
default
as
category
}
from
'./categories'
import
{
isRequireCall
,
isAssertCall
}
from
'./staticAnalysisCommon'
import
{
isRequireCall
,
isAssertCall
}
from
'./staticAnalysisCommon'
import
{
default
as
algorithm
}
from
'./algorithmCategories'
import
{
default
as
algorithm
}
from
'./algorithmCategories'
import
{
AnalyzerModule
,
ModuleAlgorithm
,
ModuleCategory
,
ReportObj
,
AstNodeLegacy
,
CompilationResult
}
from
'./../../types'
import
{
AnalyzerModule
,
ModuleAlgorithm
,
ModuleCategory
,
ReportObj
,
CompilationResult
,
FunctionCallAstNode
}
from
'./../../types'
export
default
class
guardConditions
implements
AnalyzerModule
{
export
default
class
guardConditions
implements
AnalyzerModule
{
guards
:
AstNodeLegacy
[]
=
[]
guards
:
FunctionCallAstNode
[]
=
[]
name
:
string
=
'Guard Conditions: '
name
:
string
=
'Guard Conditions: '
description
:
string
=
'Use require and appropriately'
description
:
string
=
'Use require and appropriately'
category
:
ModuleCategory
=
category
.
MISC
category
:
ModuleCategory
=
category
.
MISC
algorithm
:
ModuleAlgorithm
=
algorithm
.
EXACT
algorithm
:
ModuleAlgorithm
=
algorithm
.
EXACT
visit
(
node
:
AstNodeLegacy
):
void
{
visit
(
node
:
FunctionCallAstNode
):
void
{
if
(
isRequireCall
(
node
)
||
isAssertCall
(
node
))
this
.
guards
.
push
(
node
)
if
(
isRequireCall
(
node
)
||
isAssertCall
(
node
))
this
.
guards
.
push
(
node
)
}
}
...
...
remix-analyzer/src/solidity-analyzer/modules/noReturn.ts
View file @
dd3edce0
...
@@ -2,7 +2,7 @@ import { default as category } from './categories'
...
@@ -2,7 +2,7 @@ import { default as category } from './categories'
import
{
hasFunctionBody
,
getFullQuallyfiedFuncDefinitionIdent
,
getEffectedVariableName
}
from
'./staticAnalysisCommon'
import
{
hasFunctionBody
,
getFullQuallyfiedFuncDefinitionIdent
,
getEffectedVariableName
}
from
'./staticAnalysisCommon'
import
{
default
as
algorithm
}
from
'./algorithmCategories'
import
{
default
as
algorithm
}
from
'./algorithmCategories'
import
AbstractAst
from
'./abstractAstView'
import
AbstractAst
from
'./abstractAstView'
import
{
AnalyzerModule
,
ModuleAlgorithm
,
ModuleCategory
,
ReportObj
,
AstNodeLegacy
,
CompilationResult
,
CommonAstNode
,
FunctionDefinitionAstNode
}
from
'./../../types'
import
{
AnalyzerModule
,
ModuleAlgorithm
,
ModuleCategory
,
ReportObj
,
CompilationResult
,
CommonAstNode
,
FunctionDefinitionAstNode
}
from
'./../../types'
export
default
class
noReturn
implements
AnalyzerModule
{
export
default
class
noReturn
implements
AnalyzerModule
{
name
:
string
=
'no return: '
name
:
string
=
'no return: '
...
...
remix-analyzer/src/solidity-analyzer/modules/selfdestruct.ts
View file @
dd3edce0
...
@@ -2,7 +2,7 @@ import { default as category } from './categories'
...
@@ -2,7 +2,7 @@ import { default as category } from './categories'
import
{
isStatement
,
isSelfdestructCall
}
from
'./staticAnalysisCommon'
import
{
isStatement
,
isSelfdestructCall
}
from
'./staticAnalysisCommon'
import
{
default
as
algorithm
}
from
'./algorithmCategories'
import
{
default
as
algorithm
}
from
'./algorithmCategories'
import
AbstractAst
from
'./abstractAstView'
import
AbstractAst
from
'./abstractAstView'
import
{
AnalyzerModule
,
ModuleAlgorithm
,
ModuleCategory
,
ReportObj
,
AstNodeLegacy
,
CompilationResult
}
from
'./../../types'
import
{
AnalyzerModule
,
ModuleAlgorithm
,
ModuleCategory
,
ReportObj
,
CompilationResult
}
from
'./../../types'
export
default
class
selfdestruct
implements
AnalyzerModule
{
export
default
class
selfdestruct
implements
AnalyzerModule
{
name
:
string
=
'Selfdestruct: '
name
:
string
=
'Selfdestruct: '
...
@@ -13,8 +13,7 @@ export default class selfdestruct implements AnalyzerModule {
...
@@ -13,8 +13,7 @@ export default class selfdestruct implements AnalyzerModule {
abstractAst
=
new
AbstractAst
()
abstractAst
=
new
AbstractAst
()
visit
=
this
.
abstractAst
.
build_visit
(
visit
=
this
.
abstractAst
.
build_visit
(
(
node
:
AstNodeLegacy
)
=>
isStatement
(
node
)
||
(
node
:
any
)
=>
isStatement
(
node
)
||
isSelfdestructCall
(
node
.
expression
)
isSelfdestructCall
(
node
)
)
)
report
=
this
.
abstractAst
.
build_report
(
this
.
_report
.
bind
(
this
))
report
=
this
.
abstractAst
.
build_report
(
this
.
_report
.
bind
(
this
))
...
...
remix-analyzer/src/solidity-analyzer/modules/similarVariableNames.ts
View file @
dd3edce0
...
@@ -70,7 +70,7 @@ export default class similarVariableNames implements AnalyzerModule {
...
@@ -70,7 +70,7 @@ export default class similarVariableNames implements AnalyzerModule {
return
varName2
.
match
(
ref
)
!=
null
return
varName2
.
match
(
ref
)
!=
null
}
}
private
getFunctionVariables
(
contract
,
func
)
:
string
[]
{
private
getFunctionVariables
(
contract
,
func
)
{
return
contract
.
stateVariables
.
concat
(
func
.
localVariables
)
return
contract
.
stateVariables
.
concat
(
func
.
localVariables
)
}
}
}
}
remix-analyzer/src/solidity-analyzer/modules/staticAnalysisCommon.ts
View file @
dd3edce0
This diff is collapsed.
Click to expand it.
remix-analyzer/src/solidity-analyzer/modules/stringBytesLength.ts
View file @
dd3edce0
import
{
default
as
category
}
from
'./categories'
import
{
default
as
category
}
from
'./categories'
import
{
default
as
algorithm
}
from
'./algorithmCategories'
import
{
default
as
algorithm
}
from
'./algorithmCategories'
import
{
isStringToBytesConversion
,
isBytesLengthCheck
}
from
'./staticAnalysisCommon'
import
{
isStringToBytesConversion
,
isBytesLengthCheck
}
from
'./staticAnalysisCommon'
import
{
AnalyzerModule
,
ModuleAlgorithm
,
ModuleCategory
,
ReportObj
,
AstNodeLegacy
,
CompilationResult
}
from
'./../../types'
import
{
AnalyzerModule
,
ModuleAlgorithm
,
ModuleCategory
,
ReportObj
,
CompilationResult
,
MemberAccessAstNode
,
FunctionCallAstNode
}
from
'./../../types'
export
default
class
stringBytesLength
implements
AnalyzerModule
{
export
default
class
stringBytesLength
implements
AnalyzerModule
{
name
:
string
=
'String Length: '
name
:
string
=
'String Length: '
...
@@ -9,13 +9,13 @@ export default class stringBytesLength implements AnalyzerModule {
...
@@ -9,13 +9,13 @@ export default class stringBytesLength implements AnalyzerModule {
category
:
ModuleCategory
=
category
.
MISC
category
:
ModuleCategory
=
category
.
MISC
algorithm
:
ModuleAlgorithm
=
algorithm
.
EXACT
algorithm
:
ModuleAlgorithm
=
algorithm
.
EXACT
stringToBytesConversions
:
AstNodeLegacy
[]
=
[]
stringToBytesConversions
:
FunctionCallAstNode
[]
=
[]
bytesLengthChecks
:
AstNodeLegacy
[]
=
[]
bytesLengthChecks
:
MemberAccessAstNode
[]
=
[]
visit
(
node
:
AstNodeLegacy
):
void
{
visit
(
node
:
FunctionCallAstNode
|
MemberAccessAstNode
):
void
{
if
(
isStringToBytesConversion
(
node
))
this
.
stringToBytesConversions
.
push
(
node
)
if
(
node
.
nodeType
===
"FunctionCall"
&&
isStringToBytesConversion
(
node
))
this
.
stringToBytesConversions
.
push
(
node
)
else
if
(
isBytesLengthCheck
(
node
))
this
.
bytesLengthChecks
.
push
(
node
)
else
if
(
node
.
nodeType
===
"MemberAccess"
&&
isBytesLengthCheck
(
node
))
this
.
bytesLengthChecks
.
push
(
node
)
}
}
report
(
compilationResults
:
CompilationResult
):
ReportObj
[]
{
report
(
compilationResults
:
CompilationResult
):
ReportObj
[]
{
...
...
remix-analyzer/src/solidity-analyzer/modules/thisLocal.ts
View file @
dd3edce0
import
{
default
as
category
}
from
'./categories'
import
{
default
as
category
}
from
'./categories'
import
{
isThisLocalCall
}
from
'./staticAnalysisCommon'
import
{
isThisLocalCall
}
from
'./staticAnalysisCommon'
import
{
default
as
algorithm
}
from
'./algorithmCategories'
import
{
default
as
algorithm
}
from
'./algorithmCategories'
import
{
AnalyzerModule
,
ModuleAlgorithm
,
ModuleCategory
,
ReportObj
,
AstNodeLegacy
,
CompilationResult
,
MemberAccessAstNode
}
from
'./../../types'
import
{
AnalyzerModule
,
ModuleAlgorithm
,
ModuleCategory
,
ReportObj
,
CompilationResult
,
MemberAccessAstNode
}
from
'./../../types'
export
default
class
thisLocal
implements
AnalyzerModule
{
export
default
class
thisLocal
implements
AnalyzerModule
{
warningNodes
:
MemberAccessAstNode
[]
=
[]
warningNodes
:
MemberAccessAstNode
[]
=
[]
...
...
remix-analyzer/src/types.ts
View file @
dd3edce0
...
@@ -169,7 +169,7 @@ export interface FunctionDefinitionAstNode {
...
@@ -169,7 +169,7 @@ export interface FunctionDefinitionAstNode {
overrides
:
OverrideSpecifierAstNode
|
null
overrides
:
OverrideSpecifierAstNode
|
null
parameters
:
ParameterListAstNode
parameters
:
ParameterListAstNode
returnParameters
:
ParameterListAstNode
returnParameters
:
ParameterListAstNode
modifiers
:
Array
<
any
>
modifiers
:
Array
<
ModifierInvocationAstNode
>
body
:
object
|
null
body
:
object
|
null
implemented
:
boolean
implemented
:
boolean
scope
:
number
scope
:
number
...
@@ -182,7 +182,7 @@ export interface VariableDeclarationAstNode {
...
@@ -182,7 +182,7 @@ export interface VariableDeclarationAstNode {
nodeType
:
'VariableDeclaration'
nodeType
:
'VariableDeclaration'
src
:
string
src
:
string
name
:
string
name
:
string
typeName
:
object
typeName
:
ElementaryTypeNameAstNode
|
UserDefinedTypeNameAstNode
constant
:
boolean
constant
:
boolean
stateVariable
:
boolean
stateVariable
:
boolean
storageLocation
:
'storage'
|
'memory'
|
'calldata'
|
'default'
storageLocation
:
'storage'
|
'memory'
|
'calldata'
|
'default'
...
@@ -298,7 +298,7 @@ export interface BlockAstNode {
...
@@ -298,7 +298,7 @@ export interface BlockAstNode {
id
:
number
id
:
number
nodeType
:
'Block'
nodeType
:
'Block'
src
:
string
src
:
string
statements
:
Array
<
CommonAstNode
>
statements
:
Array
<
any
>
}
}
export
interface
PlaceholderStatementAstNode
{
export
interface
PlaceholderStatementAstNode
{
...
@@ -481,10 +481,12 @@ export interface NewExpressionAstNode extends ExpressionAttributes {
...
@@ -481,10 +481,12 @@ export interface NewExpressionAstNode extends ExpressionAttributes {
typeName
:
UserDefinedTypeNameAstNode
|
ElementaryTypeNameAstNode
typeName
:
UserDefinedTypeNameAstNode
|
ElementaryTypeNameAstNode
}
}
export
interface
MemberAccessAstNode
extends
CommonAstNode
,
ExpressionAttributes
{
export
interface
MemberAccessAstNode
extends
ExpressionAttributes
{
id
:
number
nodeType
:
'MemberAccess'
nodeType
:
'MemberAccess'
src
:
string
memberName
:
string
memberName
:
string
expression
:
object
expression
:
any
referencedDeclaration
:
number
|
null
referencedDeclaration
:
number
|
null
}
}
...
...
remix-analyzer/test/analysis/astBlocks/assignment.json
View file @
dd3edce0
{
{
"attributes"
:
{
"argumentTypes"
:
null
,
"operator"
:
"="
,
"id"
:
5
,
"type"
:
"uint256"
"isConstant"
:
false
,
},
"isLValue"
:
false
,
"children"
:
[
"isPure"
:
false
,
"lValueRequested"
:
false
,
"leftHandSide"
:
{
{
"attributes"
:
{
"argumentTypes"
:
null
,
"type"
:
"uint256"
"id"
:
3
,
},
"name"
:
"a"
,
"children"
:
[
"nodeType"
:
"Identifier"
,
"overloadedDeclarations"
:
[],
"referencedDeclaration"
:
22
,
"src"
:
"52:1:0"
,
"typeDescriptions"
:
{
{
"attributes"
:
{
"typeIdentifier"
:
"t_uint256"
,
"type"
:
"mapping(address => uint256)"
,
"typeString"
:
"uint256"
"value"
:
"c"
}
},
"id"
:
61
,
"name"
:
"Identifier"
,
"src"
:
"873:1:0"
},
},
"nodeType"
:
"Assignment"
,
"operator"
:
"="
,
"rightHandSide"
:
{
{
"attributes"
:
{
"argumentTypes"
:
null
,
"member_name"
:
"sender"
,
"hexValue"
:
"31"
,
"type"
:
"address"
"id"
:
4
,
},
"isConstant"
:
false
,
"children"
:
[
"isLValue"
:
false
,
"isPure"
:
true
,
"kind"
:
"number"
,
"lValueRequested"
:
false
,
"nodeType"
:
"Literal"
,
"src"
:
"56:5:0"
,
"subdenomination"
:
"wei"
,
"typeDescriptions"
:
{
{
"attributes"
:
{
"typeIdentifier"
:
"t_rational_1_by_1"
,
"type"
:
"msg"
,
"typeString"
:
"int_const 1"
"value"
:
"msg"
},
},
"id"
:
62
,
"value"
:
"1"
"name"
:
"Identifier"
,
"src"
:
"875:3:0"
}
],
"id"
:
63
,
"name"
:
"MemberAccess"
,
"src"
:
"875:10:0"
}
],
"id"
:
64
,
"name"
:
"IndexAccess"
,
"src"
:
"873:13:0"
},
},
"src"
:
"52:9:0"
,
"typeDescriptions"
:
{
{
"attributes"
:
{
"typeIdentifier"
:
"t_uint256"
,
"hexvalue"
:
"30"
,
"typeString"
:
"uint256"
"subdenomination"
:
null
,
"token"
:
null
,
"type"
:
"int_const 0"
,
"value"
:
"0"
},
"id"
:
65
,
"name"
:
"Literal"
,
"src"
:
"889:1:0"
}
],
"id"
:
66
,
"name"
:
"Assignment"
,
"src"
:
"873:17:0"
}
}
}
\ No newline at end of file
remix-analyzer/test/analysis/astBlocks/blockHashAccess.json
View file @
dd3edce0
{
{
"attributes"
:
{
"argumentTypes"
:[
"member_name"
:
"blockhash"
,
"type"
:
"function (uint256) returns (bytes32)"
},
"children"
:
[
{
{
"attributes"
:
{
"typeIdentifier"
:
"t_rational_3_by_1"
,
"type"
:
"block"
,
"typeString"
:
"int_const 3"
"value"
:
"block"
},
"name"
:
"Identifier"
}
}
],
],
"name"
:
"MemberAccess"
"id"
:
5
,
"name"
:
"blockhash"
,
"nodeType"
:
"Identifier"
,
"overloadedDeclarations"
:
[],
"referencedDeclaration"
:
-5
,
"src"
:
"69:9:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_function_blockhash_view$_t_uint256_$returns$_t_bytes32_$"
,
"typeString"
:
"function (uint256) view returns (bytes32)"
}
}
}
\ No newline at end of file
remix-analyzer/test/analysis/astBlocks/doWhileLoopNode.json
View file @
dd3edce0
{
{
"children"
:
"body"
:
[
{
"attributes"
:
{
{
"argumentTypes"
:
null
,
"id"
:
10
,
"commonType"
:
"nodeType"
:
"Block"
,
{
"src"
:
"113:2:0"
,
"typeIdentifier"
:
"t_uint256"
,
"statements"
:
[]
"typeString"
:
"uint256"
},
"isConstant"
:
false
,
"isLValue"
:
false
,
"isPure"
:
false
,
"lValueRequested"
:
false
,
"operator"
:
"<"
,
"type"
:
"bool"
},
},
"children"
:
"condition"
:
[
{
"attributes"
:
{
{
"argumentTypes"
:
null
,
"argumentTypes"
:
null
,
"overloadedDeclarations"
:
"expression"
:
[
null
],
"referencedDeclaration"
:
69
,
"type"
:
"uint256"
,
"value"
:
"i"
},
"id"
:
82
,
"name"
:
"Identifier"
,
"src"
:
"592:1:0"
},
{
"attributes"
:
{
{
"argumentTypes"
:
null
,
"argumentTypes"
:
null
,
"hexvalue"
:
"3130"
,
"components"
:
"isConstant"
:
false
,
"isLValue"
:
false
,
"isPure"
:
true
,
"lValueRequested"
:
false
,
"subdenomination"
:
null
,
"token"
:
"number"
,
"type"
:
"int_const 10"
,
"value"
:
"10"
},
"id"
:
83
,
"name"
:
"Literal"
,
"src"
:
"596:2:0"
}
],
"id"
:
84
,
"name"
:
"BinaryOperation"
,
"src"
:
"592:6:0"
},
{
"children"
:
[
{
"children"
:
[
[
{
{
"attributes"
:
{
"argumentTypes"
:
null
,
"argumentTypes"
:
null
,
"id"
:
13
,
"isConstant"
:
false
,
"isConstant"
:
false
,
"isLValue"
:
false
,
"isLValue"
:
false
,
"isPure"
:
false
,
"isPure"
:
false
,
"isStructConstructorCall"
:
false
,
"lValueRequested"
:
false
,
"lValueRequested"
:
false
,
"names"
:
"leftHandSide"
:
[
null
],
"type"
:
"uint256"
,
"type_conversion"
:
false
},
"children"
:
[
{
"attributes"
:
{
{
"argumentTypes"
:
"argumentTypes"
:
null
,
[
"id"
:
11
,
{
"name"
:
"c"
,
"typeIdentifier"
:
"t_uint256"
,
"nodeType"
:
"Identifier"
,
"typeString"
:
"uint256"
"overloadedDeclarations"
:
[],
"referencedDeclaration"
:
8
,
"src"
:
"123:1:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_struct$_S_$3_storage_ptr"
,
"typeString"
:
"struct C.S storage pointer"
}
}
],
"isConstant"
:
false
,
"isLValue"
:
false
,
"isPure"
:
false
,
"lValueRequested"
:
false
,
"member_name"
:
"push"
,
"referencedDeclaration"
:
null
,
"type"
:
"function (uint256) returns (uint256)"
},
},
"children"
:
"nodeType"
:
"Assignment"
,
[
"operator"
:
"="
,
{
"rightHandSide"
:
"attributes"
:
{
{
"argumentTypes"
:
null
,
"argumentTypes"
:
null
,
"overloadedDeclarations"
:
"id"
:
12
,
[
"name"
:
"s"
,
null
"nodeType"
:
"Identifier"
,
],
"overloadedDeclarations"
:
[],
"referencedDeclaration"
:
4
,
"referencedDeclaration"
:
5
,
"type"
:
"uint256[] storage ref"
,
"src"
:
"127:1:0"
,
"value"
:
"array"
"typeDescriptions"
:
},
{
"id"
:
72
,
"typeIdentifier"
:
"t_struct$_S_$3_storage"
,
"name"
:
"Identifier"
,
"typeString"
:
"struct C.S storage ref"
"src"
:
"544:5:0"
}
}
],
"id"
:
74
,
"name"
:
"MemberAccess"
,
"src"
:
"544:10:0"
},
},
"src"
:
"123:5:0"
,
"typeDescriptions"
:
{
{
"attributes"
:
"typeIdentifier"
:
"t_struct$_S_$3_storage_ptr"
,
{
"typeString"
:
"struct C.S storage pointer"
"argumentTypes"
:
null
,
"overloadedDeclarations"
:
[
null
],
"referencedDeclaration"
:
69
,
"type"
:
"uint256"
,
"value"
:
"i"
},
"id"
:
75
,
"name"
:
"Identifier"
,
"src"
:
"555:1:0"
}
}
],
"id"
:
76
,
"name"
:
"FunctionCall"
,
"src"
:
"544:13:0"
}
}
],
],
"id"
:
77
,
"id"
:
14
,
"name"
:
"ExpressionStatement"
,
"src"
:
"544:13:0"
},
{
"children"
:
[
{
"attributes"
:
{
"argumentTypes"
:
null
,
"isConstant"
:
false
,
"isConstant"
:
false
,
"isInlineArray"
:
false
,
"isLValue"
:
false
,
"isLValue"
:
false
,
"isPure"
:
false
,
"isPure"
:
false
,
"lValueRequested"
:
false
,
"lValueRequested"
:
false
,
"operator"
:
"++"
,
"nodeType"
:
"TupleExpression"
,
"prefix"
:
false
,
"src"
:
"122:7:0"
,
"type"
:
"uint256"
"typeDescriptions"
:
},
"children"
:
[
{
"attributes"
:
{
{
"argumentTypes"
:
null
,
"typeIdentifier"
:
"t_struct$_S_$3_storage_ptr"
,
"overloadedDeclarations"
:
"typeString"
:
"struct C.S storage pointer"
[
null
],
"referencedDeclaration"
:
69
,
"type"
:
"uint256"
,
"value"
:
"i"
},
"id"
:
78
,
"name"
:
"Identifier"
,
"src"
:
"571:1:0"
}
}
],
},
"id"
:
79
,
"id"
:
15
,
"name"
:
"UnaryOperation"
,
"isConstant"
:
false
,
"src"
:
"571:3:0"
"isLValue"
:
true
,
}
"isPure"
:
false
,
],
"lValueRequested"
:
false
,
"id"
:
80
,
"memberName"
:
"f"
,
"name"
:
"ExpressionStatement"
,
"nodeType"
:
"MemberAccess"
,
"src"
:
"571:3:0"
"referencedDeclaration"
:
2
,
}
"src"
:
"122:9:0"
,
],
"typeDescriptions"
:
"id"
:
81
,
{
"name"
:
"Block"
,
"typeIdentifier"
:
"t_bool"
,
"src"
:
"530:55:0"
"typeString"
:
"bool"
}
],
"id"
:
85
,
"name"
:
"DoWhileStatement"
,
"src"
:
"528:72:0"
}
}
},
"id"
:
16
,
"nodeType"
:
"DoWhileStatement"
,
"src"
:
"110:23:0"
}
\ No newline at end of file
remix-analyzer/test/analysis/astBlocks/forLoopNode.json
View file @
dd3edce0
This diff is collapsed.
Click to expand it.
remix-analyzer/test/analysis/astBlocks/functionDefinition.json
View file @
dd3edce0
{
{
"attributes"
:
{
"body"
:
"constant"
:
true
,
"name"
:
"winnerName"
,
"payable"
:
false
,
"visibility"
:
"public"
},
"children"
:
[
{
{
"children"
:
[
"id"
:
6
,
"nodeType"
:
"Block"
,
"src"
:
"42:23:0"
,
"statements"
:
[
{
"assignments"
:
[
4
],
],
"name"
:
"ParameterList"
"declarations"
:
},
[
{
{
"children"
:
[],
"constant"
:
false
,
"name"
:
"ParameterList"
"id"
:
4
,
"name"
:
"a"
,
"nodeType"
:
"VariableDeclaration"
,
"overrides"
:
null
,
"scope"
:
6
,
"src"
:
"52:6:0"
,
"stateVariable"
:
false
,
"storageLocation"
:
"default"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_uint256"
,
"typeString"
:
"uint256"
},
},
"typeName"
:
{
"id"
:
3
,
"name"
:
"uint"
,
"nodeType"
:
"ElementaryTypeName"
,
"src"
:
"52:4:0"
,
"typeDescriptions"
:
{
{
"children"
:
[],
"typeIdentifier"
:
"t_uint256"
,
"name"
:
"Block"
"typeString"
:
"uint256"
}
},
"value"
:
null
,
"visibility"
:
"internal"
}
}
],
],
"name"
:
"FunctionDefinition"
"id"
:
5
,
"initialValue"
:
null
,
"nodeType"
:
"VariableDeclarationStatement"
,
"src"
:
"52:6:0"
}
}
]
},
"documentation"
:
null
,
"functionSelector"
:
"26121ff0"
,
"id"
:
7
,
"implemented"
:
true
,
"kind"
:
"function"
,
"modifiers"
:
[],
"name"
:
"f"
,
"nodeType"
:
"FunctionDefinition"
,
"overrides"
:
null
,
"parameters"
:
{
"id"
:
1
,
"nodeType"
:
"ParameterList"
,
"parameters"
:
[],
"src"
:
"27:2:0"
},
"returnParameters"
:
{
"id"
:
2
,
"nodeType"
:
"ParameterList"
,
"parameters"
:
[],
"src"
:
"42:0:0"
},
"scope"
:
8
,
"src"
:
"17:48:0"
,
"stateMutability"
:
"pure"
,
"virtual"
:
false
,
"visibility"
:
"public"
}
\ No newline at end of file
remix-analyzer/test/analysis/astBlocks/inheritance.json
View file @
dd3edce0
{
{
"children"
:
[
"arguments"
:
null
,
"baseName"
:
{
{
"attributes"
:
{
"contractScope"
:
null
,
"name"
:
"r"
"id"
:
19
,
},
"name"
:
"A"
,
"id"
:
7
,
"nodeType"
:
"UserDefinedTypeName"
,
"name"
:
"UserDefinedTypeName"
,
"referencedDeclaration"
:
9
,
"src"
:
"84:1:0"
"src"
:
"176:1:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_contract$_A_$9"
,
"typeString"
:
"contract A"
}
}
]
,
}
,
"id"
:
8
,
"id"
:
20
,
"n
am
e"
:
"InheritanceSpecifier"
,
"n
odeTyp
e"
:
"InheritanceSpecifier"
,
"src"
:
"
84
:1:0"
"src"
:
"
176
:1:0"
}
}
\ No newline at end of file
remix-analyzer/test/analysis/astBlocks/inlineAssembly.json
View file @
dd3edce0
{
{
"children"
:
[
"AST"
:
],
{
"id"
:
21
,
"nodeType"
:
"YulBlock"
,
"name"
:
"InlineAssembly"
,
"src"
:
"148:83:0"
,
"src"
:
"809:41:0"
"statements"
:
[
{
"nodeType"
:
"YulVariableDeclaration"
,
"src"
:
"162:11:0"
,
"value"
:
{
"name"
:
"x"
,
"nodeType"
:
"YulIdentifier"
,
"src"
:
"172:1:0"
},
"variables"
:
[
{
"name"
:
"c1"
,
"nodeType"
:
"YulTypedName"
,
"src"
:
"166:2:0"
,
"type"
:
""
}
]
},
{
"nodeType"
:
"YulVariableDeclaration"
,
"src"
:
"186:11:0"
,
"value"
:
{
"name"
:
"b"
,
"nodeType"
:
"YulIdentifier"
,
"src"
:
"196:1:0"
},
"variables"
:
[
{
"name"
:
"c2"
,
"nodeType"
:
"YulTypedName"
,
"src"
:
"190:2:0"
,
"type"
:
""
}
]
},
{
"nodeType"
:
"YulVariableDeclaration"
,
"src"
:
"210:11:0"
,
"value"
:
{
"name"
:
"s"
,
"nodeType"
:
"YulIdentifier"
,
"src"
:
"220:1:0"
},
"variables"
:
[
{
"name"
:
"c3"
,
"nodeType"
:
"YulTypedName"
,
"src"
:
"214:2:0"
,
"type"
:
""
}
}
]
}
]
},
"evmVersion"
:
"istanbul"
,
"externalReferences"
:
[
{
"declaration"
:
8
,
"isOffset"
:
false
,
"isSlot"
:
false
,
"src"
:
"196:1:0"
,
"valueSize"
:
1
},
{
"declaration"
:
11
,
"isOffset"
:
false
,
"isSlot"
:
false
,
"src"
:
"220:1:0"
,
"valueSize"
:
1
},
{
"declaration"
:
5
,
"isOffset"
:
false
,
"isSlot"
:
false
,
"src"
:
"172:1:0"
,
"valueSize"
:
1
}
],
"id"
:
14
,
"nodeType"
:
"InlineAssembly"
,
"src"
:
"139:92:0"
}
\ No newline at end of file
remix-analyzer/test/analysis/astBlocks/libCall.json
View file @
dd3edce0
{
{
"attributes"
:
{
"argumentTypes"
:
null
,
"member_name"
:
"insert"
,
"expression"
:
"type"
:
"function (struct Set.Data storage pointer,uint256) returns (bool)"
{
},
"argumentTypes"
:
null
,
"children"
:
[
"id"
:
33
,
"name"
:
"L"
,
"nodeType"
:
"Identifier"
,
"overloadedDeclarations"
:
[],
"referencedDeclaration"
:
21
,
"src"
:
"244:1:0"
,
"typeDescriptions"
:
{
{
"
attributes"
:
{
"
typeIdentifier"
:
"t_type$_t_contract$_L_$21_$"
,
"type"
:
"type(library Set)"
,
"typeString"
:
"type(library L)"
"value"
:
"Set"
}
},
},
"name"
:
"Identifier"
"id"
:
34
,
"isConstant"
:
false
,
"isLValue"
:
false
,
"isPure"
:
false
,
"lValueRequested"
:
false
,
"memberName"
:
"f"
,
"nodeType"
:
"MemberAccess"
,
"referencedDeclaration"
:
6
,
"src"
:
"244:3:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_function_delegatecall_nonpayable$_t_uint256_$returns$__$"
,
"typeString"
:
"function (uint256)"
}
}
],
"name"
:
"MemberAccess"
}
}
\ No newline at end of file
remix-analyzer/test/analysis/astBlocks/localCall.json
View file @
dd3edce0
{
{
"attributes"
:
{
"argumentTypes"
:
null
,
"type"
:
"tuple()"
,
"arguments"
:
[],
"type_conversion"
:
false
"expression"
:
},
"children"
:
[
{
{
"attributes"
:
{
"argumentTypes"
:
[],
"type"
:
"function (struct Ballot.Voter storage pointer)"
,
"id"
:
13
,
"value"
:
"bli"
"name"
:
"sha3"
,
}
,
"nodeType"
:
"Identifier"
,
"id"
:
37
,
"overloadedDeclarations"
:
[]
,
"name"
:
"Identifier"
,
"referencedDeclaration"
:
8
,
"src"
:
"540:3:0"
"src"
:
"129:4:0"
,
},
"typeDescriptions"
:
{
{
"attributes"
:
{
"typeIdentifier"
:
"t_function_internal_pure$__$returns$_t_bool_$"
,
"type"
:
"struct Ballot.Voter storage pointer"
,
"typeString"
:
"function () pure returns (bool)"
"value"
:
"x"
},
"id"
:
38
,
"name"
:
"Identifier"
,
"src"
:
"544:1:0"
}
}
],
},
"id"
:
39
,
"id"
:
14
,
"name"
:
"FunctionCall"
,
"isConstant"
:
false
,
"src"
:
"540:6:0"
"isLValue"
:
false
,
"isPure"
:
false
,
"kind"
:
"functionCall"
,
"lValueRequested"
:
false
,
"names"
:
[],
"nodeType"
:
"FunctionCall"
,
"src"
:
"129:6:0"
,
"tryCall"
:
false
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_bool"
,
"typeString"
:
"bool"
}
}
}
\ No newline at end of file
remix-analyzer/test/analysis/astBlocks/lowlevelCall.json
View file @
dd3edce0
{
{
"sendAst"
:
{
"name"
:
"MemberAccess"
,
"sendAst"
:
{
"children"
:
[
"argumentTypes"
:
[
{
{
"attributes"
:
{
"typeIdentifier"
:
"t_rational_1_by_1"
,
"value"
:
"d"
,
"typeString"
:
"int_const 1"
"type"
:
"address"
}
],
"expression"
:
{
"argumentTypes"
:
null
,
"id"
:
27
,
"name"
:
"addr"
,
"nodeType"
:
"Identifier"
,
"overloadedDeclarations"
:
[],
"referencedDeclaration"
:
4
,
"src"
:
"227:4:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_address_payable"
,
"typeString"
:
"address payable"
}
},
"id"
:
28
,
"isConstant"
:
false
,
"isLValue"
:
false
,
"isPure"
:
false
,
"lValueRequested"
:
false
,
"memberName"
:
"send"
,
"nodeType"
:
"MemberAccess"
,
"referencedDeclaration"
:
null
,
"src"
:
"227:9:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_function_send_nonpayable$_t_uint256_$returns$_t_bool_$"
,
"typeString"
:
"function (uint256) returns (bool)"
}
},
"callAst"
:
{
"argumentTypes"
:
null
,
"expression"
:
{
"argumentTypes"
:
null
,
"id"
:
9
,
"name"
:
"a"
,
"nodeType"
:
"Identifier"
,
"overloadedDeclarations"
:
[],
"referencedDeclaration"
:
6
,
"src"
:
"91:1:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_address"
,
"typeString"
:
"address"
}
},
"id"
:
12
,
"isConstant"
:
false
,
"isLValue"
:
false
,
"isPure"
:
false
,
"lValueRequested"
:
false
,
"memberName"
:
"call"
,
"nodeType"
:
"MemberAccess"
,
"referencedDeclaration"
:
null
,
"src"
:
"91:6:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_function_barecall_payable$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$"
,
"typeString"
:
"function (bytes memory) payable returns (bool,bytes memory)"
}
}
}],
"attributes"
:
{
"value"
:
"send"
,
"type"
:
"function (uint256) returns (bool)"
}
},
},
"callAst"
:
{
"name"
:
"MemberAccess"
,
"children"
:
[{
"attributes"
:
{
"value"
:
"f"
,
"type"
:
"address"
}}],
"attributes"
:
{
"member_name"
:
"call"
,
"type"
:
"function () payable returns (bool)"
}
},
"callcodeAst"
:
{
"callcodeAst"
:
{
"name"
:
"MemberAccess"
,
"argumentTypes"
:
[],
"children"
:
[{
"expression"
:
"attributes"
:
{
{
"value"
:
"f"
,
"argumentTypes"
:
null
,
"type"
:
"address"
"id"
:
3
,
}}],
"name"
:
"test"
,
"attributes"
:
{
"nodeType"
:
"Identifier"
,
"member_name"
:
"callcode"
,
"overloadedDeclarations"
:
[],
"type"
:
"function () payable returns (bool)"
}
},
"referencedDeclaration"
:
10
,
"src"
:
"62:4:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_type$_t_contract$_test_$10_$"
,
"typeString"
:
"type(contract test)"
}
},
"id"
:
5
,
"isConstant"
:
false
,
"isLValue"
:
false
,
"isPure"
:
false
,
"lValueRequested"
:
false
,
"memberName"
:
"callcode"
,
"nodeType"
:
"MemberAccess"
,
"referencedDeclaration"
:
9
,
"src"
:
"62:13:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_function_internal_pure$__$returns$__$"
,
"typeString"
:
"function () pure"
}
},
"delegatecallAst"
:
{
"delegatecallAst"
:
{
"name"
:
"MemberAccess"
,
"argumentTypes"
:
"children"
:
[{
[
"attributes"
:
{
{
"value"
:
"g"
,
"typeIdentifier"
:
"t_stringliteral_c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"
,
"type"
:
"address"
"typeString"
:
"literal_string
\"\"
"
}}],
}
"attributes"
:
{
],
"member_name"
:
"delegatecall"
,
"expression"
:
"type"
:
"function () returns (bool)"
}
}
{
"argumentTypes"
:
null
,
"id"
:
20
,
"name"
:
"addr"
,
"nodeType"
:
"Identifier"
,
"overloadedDeclarations"
:
[],
"referencedDeclaration"
:
4
,
"src"
:
"181:4:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_address_payable"
,
"typeString"
:
"address payable"
}
},
"id"
:
21
,
"isConstant"
:
false
,
"isLValue"
:
false
,
"isPure"
:
false
,
"lValueRequested"
:
false
,
"memberName"
:
"delegatecall"
,
"nodeType"
:
"MemberAccess"
,
"referencedDeclaration"
:
null
,
"src"
:
"181:17:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_function_baredelegatecall_nonpayable$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$"
,
"typeString"
:
"function (bytes memory) returns (bool,bytes memory)"
}
}
}
}
\ No newline at end of file
remix-analyzer/test/analysis/astBlocks/parameterFunction.json
View file @
dd3edce0
{
{
"attributes"
:
{
"argumentTypes"
:
null
,
"argumentTypes"
:
null
,
"arguments"
:
[
{
"argumentTypes"
:
null
,
"hexValue"
:
"32"
,
"id"
:
37
,
"isConstant"
:
false
,
"isConstant"
:
false
,
"isLValue"
:
false
,
"isLValue"
:
false
,
"isPure"
:
fals
e
,
"isPure"
:
tru
e
,
"
isStructConstructorCall"
:
false
,
"
kind"
:
"number"
,
"lValueRequested"
:
false
,
"lValueRequested"
:
false
,
"names"
:
[
"nodeType"
:
"Literal"
,
null
"src"
:
"234:1:0"
,
],
"subdenomination"
:
null
,
"type"
:
"uint256"
,
"typeDescriptions"
:
"type_conversion"
:
false
{
"typeIdentifier"
:
"t_rational_2_by_1"
,
"typeString"
:
"int_const 2"
},
"value"
:
"2"
},
},
"children"
:
[
{
{
"attributes"
:
{
"argumentTypes"
:
null
,
"argumentTypes"
:
[
"hexValue"
:
"31"
,
"id"
:
38
,
"isConstant"
:
false
,
"isLValue"
:
false
,
"isPure"
:
true
,
"kind"
:
"number"
,
"lValueRequested"
:
false
,
"nodeType"
:
"Literal"
,
"src"
:
"240:1:0"
,
"subdenomination"
:
null
,
"typeDescriptions"
:
{
{
"typeIdentifier"
:
"t_uint256
"
,
"typeIdentifier"
:
"t_rational_1_by_1
"
,
"typeString"
:
"uint256
"
"typeString"
:
"int_const 1
"
},
},
{
"value"
:
"1"
"typeIdentifier"
:
"t_uint256"
,
"typeString"
:
"uint256"
}
}
],
],
"overloadedDeclarations"
:
[
"expression"
:
null
],
"referencedDeclaration"
:
25
,
"type"
:
"function (uint256,uint256) pure returns (uint256)"
,
"value"
:
"f"
},
"id"
:
34
,
"name"
:
"Identifier"
,
"src"
:
"267:1:0"
},
{
{
"attributes"
:
{
"argumentTypes"
:
"argumentTypes"
:
null
,
[
"overloadedDeclarations"
:
[
{
null
"typeIdentifier"
:
"t_rational_2_by_1"
,
],
"typeString"
:
"int_const 2"
"referencedDeclaration"
:
27
,
"type"
:
"uint256"
,
"value"
:
"x"
},
"id"
:
35
,
"name"
:
"Identifier"
,
"src"
:
"269:1:0"
},
},
{
{
"attributes"
:
{
"typeIdentifier"
:
"t_rational_1_by_1"
,
"argumentTypes"
:
null
,
"typeString"
:
"int_const 1"
"overloadedDeclarations"
:
[
}
null
],
],
"referencedDeclaration"
:
29
,
"type"
:
"uint256"
,
"value"
:
"y"
},
"id"
:
36
,
"id"
:
36
,
"name"
:
"Identifier"
,
"name"
:
"f"
,
"src"
:
"272:1:0"
"nodeType"
:
"Identifier"
,
"overloadedDeclarations"
:
[
6
,
14
,
24
],
"referencedDeclaration"
:
14
,
"src"
:
"228:1:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_function_internal_nonpayable$_t_uint256_$_t_uint256_$returns$__$"
,
"typeString"
:
"function (uint256,uint256)"
}
}
},
"id"
:
39
,
"isConstant"
:
false
,
"isLValue"
:
false
,
"isPure"
:
false
,
"kind"
:
"functionCall"
,
"lValueRequested"
:
false
,
"names"
:
[
"y"
,
"x"
],
],
"id"
:
37
,
"nodeType"
:
"FunctionCall"
,
"name"
:
"FunctionCall"
,
"src"
:
"228:15:0"
,
"src"
:
"267:7:0"
"tryCall"
:
false
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_tuple$__$"
,
"typeString"
:
"tuple()"
}
}
}
\ No newline at end of file
remix-analyzer/test/analysis/astBlocks/selfdestruct.json
View file @
dd3edce0
{
{
"attributes"
:
{
"argumentTypes"
:
null
,
"type"
:
"tuple()"
,
"arguments"
:
"type_conversion"
:
false
[
},
"children"
:
[
{
{
"attributes"
:
{
"argumentTypes"
:
null
,
"type"
:
"function (address)"
,
"id"
:
6
,
"value"
:
"selfdestruct"
"name"
:
"a"
,
},
"nodeType"
:
"Identifier"
,
"name"
:
"Identifier"
"overloadedDeclarations"
:
[],
},
"referencedDeclaration"
:
2
,
"src"
:
"77:1:0"
,
"typeDescriptions"
:
{
{
"attributes"
:
{
"typeIdentifier"
:
"t_address_payable"
,
"type"
:
"address"
,
"typeString"
:
"address payable"
"value"
:
"a"
}
},
"name"
:
"Identifier"
}
}
],
],
"name"
:
"FunctionCall"
"expression"
:
{
"argumentTypes"
:
[
{
"typeIdentifier"
:
"t_address_payable"
,
"typeString"
:
"address payable"
}
],
"id"
:
5
,
"name"
:
"selfdestruct"
,
"nodeType"
:
"Identifier"
,
"overloadedDeclarations"
:
[],
"referencedDeclaration"
:
-21
,
"src"
:
"64:12:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_function_selfdestruct_nonpayable$_t_address_payable_$returns$__$"
,
"typeString"
:
"function (address payable)"
}
},
"id"
:
7
,
"isConstant"
:
false
,
"isLValue"
:
false
,
"isPure"
:
false
,
"kind"
:
"functionCall"
,
"lValueRequested"
:
false
,
"names"
:
[],
"nodeType"
:
"FunctionCall"
,
"src"
:
"64:15:0"
,
"tryCall"
:
false
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_tuple$__$"
,
"typeString"
:
"tuple()"
}
}
}
\ No newline at end of file
remix-analyzer/test/analysis/astBlocks/stateVariableContractNode.json
View file @
dd3edce0
This diff is collapsed.
Click to expand it.
remix-analyzer/test/analysis/astBlocks/superLocal.json
View file @
dd3edce0
{
{
"attributes"
:
{
"argumentTypes"
:
[],
"member_name"
:
"duper"
,
"expression"
:
"type"
:
"function ()"
{
},
"argumentTypes"
:
null
,
"children"
:
[
"id"
:
10
,
"name"
:
"super"
,
"nodeType"
:
"Identifier"
,
"overloadedDeclarations"
:
[],
"referencedDeclaration"
:
-25
,
"src"
:
"162:5:0"
,
"typeDescriptions"
:
{
{
"
attributes"
:
{
"
typeIdentifier"
:
"t_super$_B_$17"
,
"type"
:
"contract super a"
,
"typeString"
:
"contract super B"
"value"
:
"super"
}
},
},
"name"
:
"Identifier"
"id"
:
12
,
"isConstant"
:
false
,
"isLValue"
:
false
,
"isPure"
:
false
,
"lValueRequested"
:
false
,
"memberName"
:
"x"
,
"nodeType"
:
"MemberAccess"
,
"referencedDeclaration"
:
4
,
"src"
:
"162:7:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_function_internal_pure$__$returns$__$"
,
"typeString"
:
"function () pure"
}
}
],
"name"
:
"MemberAccess"
}
}
\ No newline at end of file
remix-analyzer/test/analysis/astBlocks/thisLocalCall.json
View file @
dd3edce0
{
{
"name"
:
"MemberAccess"
,
"argumentTypes"
:
null
,
"children"
:
[
{
"expression"
:
"attributes"
:
{
{
"value"
:
"this"
,
"argumentTypes"
:
null
,
"type"
:
"contract test"
},
"id"
:
13
,
"name"
:
"Identifier"
}
],
"name"
:
"this"
,
"attributes"
:
{
"nodeType"
:
"Identifier"
,
"value"
:
"b"
,
"overloadedDeclarations"
:
[],
"type"
:
"function (bytes32,address) returns (bool)"
}
}
"referencedDeclaration"
:
-28
,
\ No newline at end of file
"src"
:
"138:4:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_contract$_C_$21"
,
"typeString"
:
"contract C"
}
},
"id"
:
14
,
"isConstant"
:
false
,
"isLValue"
:
false
,
"isPure"
:
false
,
"lValueRequested"
:
false
,
"memberName"
:
"h"
,
"nodeType"
:
"MemberAccess"
,
"referencedDeclaration"
:
4
,
"src"
:
"138:6:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_function_external_payable$__$returns$__$"
,
"typeString"
:
"function () payable external"
}
}
\ No newline at end of file
remix-analyzer/test/analysis/astBlocks/whileLoopNode.json
View file @
dd3edce0
{
{
"children"
:
"body"
:
{
"id"
:
13
,
"nodeType"
:
"Block"
,
"src"
:
"89:27:0"
,
"statements"
:
[
[
{
{
"attributes
"
:
"expression
"
:
{
{
"argumentTypes"
:
null
,
"argumentTypes"
:
null
,
"commonType"
:
"id"
:
9
,
{
"typeIdentifier"
:
"t_uint256"
,
"typeString"
:
"uint256"
},
"isConstant"
:
false
,
"isConstant"
:
false
,
"isLValue"
:
false
,
"isLValue"
:
false
,
"isPure"
:
false
,
"isPure"
:
false
,
"lValueRequested"
:
false
,
"lValueRequested"
:
false
,
"operator"
:
"<"
,
"leftHandSide"
:
"type"
:
"bool"
},
"children"
:
[
{
"attributes"
:
{
{
"argumentTypes"
:
null
,
"argumentTypes"
:
null
,
"overloadedDeclarations"
:
"id"
:
7
,
[
"name"
:
"x"
,
null
"nodeType"
:
"Identifier"
,
],
"overloadedDeclarations"
:
[],
"referencedDeclaration"
:
45
,
"referencedDeclaration"
:
4
,
"type"
:
"uint256"
,
"src"
:
"91:1:0"
,
"value"
:
"i"
"typeDescriptions"
:
},
"id"
:
48
,
"name"
:
"Identifier"
,
"src"
:
"372:1:0"
},
{
{
"attributes"
:
"typeIdentifier"
:
"t_uint256"
,
"typeString"
:
"uint256"
}
},
"nodeType"
:
"Assignment"
,
"operator"
:
"="
,
"rightHandSide"
:
{
{
"argumentTypes"
:
null
,
"argumentTypes"
:
null
,
"hexvalue"
:
"3130"
,
"hexValue"
:
"31"
,
"id"
:
8
,
"isConstant"
:
false
,
"isConstant"
:
false
,
"isLValue"
:
false
,
"isLValue"
:
false
,
"isPure"
:
true
,
"isPure"
:
true
,
"kind"
:
"number"
,
"lValueRequested"
:
false
,
"lValueRequested"
:
false
,
"nodeType"
:
"Literal"
,
"src"
:
"95:1:0"
,
"subdenomination"
:
null
,
"subdenomination"
:
null
,
"token"
:
"number"
,
"typeDescriptions"
:
"type"
:
"int_const 10"
,
"value"
:
"10"
},
"id"
:
49
,
"name"
:
"Literal"
,
"src"
:
"376:2:0"
}
],
"id"
:
50
,
"name"
:
"BinaryOperation"
,
"src"
:
"372:6:0"
},
{
"children"
:
[
{
"children"
:
[
{
{
"attributes"
:
"typeIdentifier"
:
"t_rational_1_by_1"
,
{
"typeString"
:
"int_const 1"
"argumentTypes"
:
null
,
"isConstant"
:
false
,
"isLValue"
:
false
,
"isPure"
:
false
,
"isStructConstructorCall"
:
false
,
"lValueRequested"
:
false
,
"names"
:
[
null
],
"type"
:
"uint256"
,
"type_conversion"
:
false
},
},
"children"
:
"value"
:
"1"
[
},
{
"src"
:
"91:5:0"
,
"attributes"
:
"typeDescriptions"
:
{
"argumentTypes"
:
[
{
{
"typeIdentifier"
:
"t_uint256"
,
"typeIdentifier"
:
"t_uint256"
,
"typeString"
:
"uint256"
"typeString"
:
"uint256"
}
}
],
"isConstant"
:
false
,
"isLValue"
:
false
,
"isPure"
:
false
,
"lValueRequested"
:
false
,
"member_name"
:
"push"
,
"referencedDeclaration"
:
null
,
"type"
:
"function (uint256) returns (uint256)"
},
},
"children"
:
"id"
:
10
,
[
"nodeType"
:
"ExpressionStatement"
,
{
"src"
:
"91:5:0"
"attributes"
:
{
"argumentTypes"
:
null
,
"overloadedDeclarations"
:
[
null
],
"referencedDeclaration"
:
4
,
"type"
:
"uint256[] storage ref"
,
"value"
:
"array"
},
"id"
:
51
,
"name"
:
"Identifier"
,
"src"
:
"394:5:0"
}
],
"id"
:
53
,
"name"
:
"MemberAccess"
,
"src"
:
"394:10:0"
},
},
{
{
"attributes"
:
"id"
:
11
,
{
"nodeType"
:
"Break"
,
"argumentTypes"
:
null
,
"src"
:
"98:5:0"
"overloadedDeclarations"
:
[
null
],
"referencedDeclaration"
:
45
,
"type"
:
"uint256"
,
"value"
:
"i"
},
},
"id"
:
54
,
{
"name"
:
"Identifier"
,
"id"
:
12
,
"src"
:
"405:1:0"
"nodeType"
:
"Continue"
,
}
"src"
:
"105:8:0"
],
"id"
:
55
,
"name"
:
"FunctionCall"
,
"src"
:
"394:13:0"
}
}
],
]
"id"
:
56
,
"name"
:
"ExpressionStatement"
,
"src"
:
"394:13:0"
},
},
{
"condition"
:
"children"
:
[
{
"attributes"
:
{
{
"argumentTypes"
:
null
,
"argumentTypes"
:
null
,
"hexValue"
:
"74727565"
,
"id"
:
6
,
"isConstant"
:
false
,
"isConstant"
:
false
,
"isLValue"
:
false
,
"isLValue"
:
false
,
"isPure"
:
false
,
"isPure"
:
true
,
"kind"
:
"bool"
,
"lValueRequested"
:
false
,
"lValueRequested"
:
false
,
"operator"
:
"++"
,
"nodeType"
:
"Literal"
,
"prefix"
:
false
,
"src"
:
"83:4:0"
,
"type"
:
"uint256"
"subdenomination"
:
null
,
},
"typeDescriptions"
:
"children"
:
[
{
"attributes"
:
{
{
"argumentTypes"
:
null
,
"typeIdentifier"
:
"t_bool"
,
"overloadedDeclarations"
:
"typeString"
:
"bool"
[
null
],
"referencedDeclaration"
:
45
,
"type"
:
"uint256"
,
"value"
:
"i"
},
},
"id"
:
57
,
"value"
:
"true"
"name"
:
"Identifier"
,
},
"src"
:
"421:1:0"
"id"
:
14
,
}
"nodeType"
:
"WhileStatement"
,
],
"src"
:
"76:40:0"
"id"
:
58
,
}
"name"
:
"UnaryOperation"
,
\ No newline at end of file
"src"
:
"421:3:0"
}
],
"id"
:
59
,
"name"
:
"ExpressionStatement"
,
"src"
:
"421:3:0"
}
],
"id"
:
60
,
"name"
:
"Block"
,
"src"
:
"380:55:0"
}
],
"id"
:
61
,
"name"
:
"WhileStatement"
,
"src"
:
"365:70:0"
}
\ No newline at end of file
remix-analyzer/test/analysis/staticAnalysisCommon-test.ts
View file @
dd3edce0
This diff is collapsed.
Click to expand it.
remix-analyzer/test/analysis/test-contracts/solidity-v0.5/library.sol
View file @
dd3edce0
pragma solidity >=0.4.9 <0.
6
.0;
pragma solidity >=0.4.9 <0.
7
.0;
library Set {
library Set {
// We define a new struct datatype that will be used to
// We define a new struct datatype that will be used to
...
@@ -50,5 +50,9 @@ contract C {
...
@@ -50,5 +50,9 @@ contract C {
if (!Set.insert(knownValues, value))
if (!Set.insert(knownValues, value))
revert();
revert();
}
}
function tests2() public {
this.register(10);
}
// In this contract, we can also directly access knownValues.flags, if we want.
// In this contract, we can also directly access knownValues.flags, if we want.
}
}
\ No newline at end of file
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