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
2fce136c
Commit
2fce136c
authored
Mar 16, 2020
by
aniket-engg
Committed by
Aniket
Mar 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
two more contract integration tests updated
parent
f78d1267
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
+10
-2
checksEffectsInteraction.ts
...src/solidity-analyzer/modules/checksEffectsInteraction.ts
+1
-1
staticAnalysisCommon.ts
...zer/src/solidity-analyzer/modules/staticAnalysisCommon.ts
+9
-1
staticAnalysisIntegration-test-0.5.0.ts
...zer/test/analysis/staticAnalysisIntegration-test-0.5.0.ts
+0
-0
No files found.
remix-analyzer/src/solidity-analyzer/modules/checksEffectsInteraction.ts
View file @
2fce136c
...
@@ -78,7 +78,7 @@ export default class checksEffectsInteraction implements AnalyzerModule {
...
@@ -78,7 +78,7 @@ export default class checksEffectsInteraction implements AnalyzerModule {
private
isLocalCallWithStateChange
(
node
:
FunctionCallAstNode
,
context
:
Context
):
boolean
{
private
isLocalCallWithStateChange
(
node
:
FunctionCallAstNode
,
context
:
Context
):
boolean
{
if
(
isLocalCallGraphRelevantNode
(
node
))
{
if
(
isLocalCallGraphRelevantNode
(
node
))
{
const
func
=
resolveCallGraphSymbol
(
context
.
callGraph
,
getFullQualifiedFunctionCallIdent
(
context
.
currentContract
.
node
,
node
))
const
func
=
resolveCallGraphSymbol
(
context
.
callGraph
,
getFullQualifiedFunctionCallIdent
(
context
.
currentContract
.
node
,
node
))
return
!
func
||
(
func
&&
func
.
node
[
'changesState'
])
return
!
func
||
(
func
&&
func
[
'changesState'
])
}
}
return
false
return
false
}
}
...
...
remix-analyzer/src/solidity-analyzer/modules/staticAnalysisCommon.ts
View file @
2fce136c
...
@@ -169,6 +169,7 @@ function getFunctionCallType (func: FunctionCallAstNode): string {
...
@@ -169,6 +169,7 @@ function getFunctionCallType (func: FunctionCallAstNode): string {
* @return {string} variable name written to
* @return {string} variable name written to
*/
*/
function
getEffectedVariableName
(
effectNode
:
AssignmentAstNode
|
UnaryOperationAstNode
):
string
{
function
getEffectedVariableName
(
effectNode
:
AssignmentAstNode
|
UnaryOperationAstNode
):
string
{
// console.log('getEffectedVariableName---effectNode---', effectNode)
if
(
!
isEffect
(
effectNode
))
throw
new
Error
(
'staticAnalysisCommon.js: not an effect Node'
)
if
(
!
isEffect
(
effectNode
))
throw
new
Error
(
'staticAnalysisCommon.js: not an effect Node'
)
if
(
effectNode
.
nodeType
===
'Assignment'
||
effectNode
.
nodeType
===
'UnaryOperation'
)
{
if
(
effectNode
.
nodeType
===
'Assignment'
||
effectNode
.
nodeType
===
'UnaryOperation'
)
{
const
IdentNode
=
findFirstSubNodeLTR
(
effectNode
,
exactMatch
(
nodeTypes
.
IDENTIFIER
))
const
IdentNode
=
findFirstSubNodeLTR
(
effectNode
,
exactMatch
(
nodeTypes
.
IDENTIFIER
))
...
@@ -623,7 +624,10 @@ function isStorageVariableDeclaration (node: VariableDeclarationAstNode): boolea
...
@@ -623,7 +624,10 @@ function isStorageVariableDeclaration (node: VariableDeclarationAstNode): boolea
* @return {bool}
* @return {bool}
*/
*/
function
isInteraction
(
node
:
FunctionCallAstNode
):
boolean
{
function
isInteraction
(
node
:
FunctionCallAstNode
):
boolean
{
return
isLLCall
(
node
.
expression
)
||
isLLSend
(
node
.
expression
)
||
isExternalDirectCall
(
node
)
||
isTransfer
(
node
.
expression
)
// console.log('Inside isInteraction----------', node)
return
isLLCall
(
node
.
expression
)
||
isLLSend
(
node
.
expression
)
||
isExternalDirectCall
(
node
)
||
isTransfer
(
node
.
expression
)
||
// to cover case of address.call.value.gas , See: inheritance.sol
(
node
.
expression
&&
node
.
expression
.
expression
&&
isLLCall
(
node
.
expression
.
expression
))
}
}
/**
/**
...
@@ -906,6 +910,9 @@ function isLLSend (node: MemberAccessAstNode): boolean {
...
@@ -906,6 +910,9 @@ function isLLSend (node: MemberAccessAstNode): boolean {
* @return {bool}
* @return {bool}
*/
*/
function
isLLCall
(
node
:
MemberAccessAstNode
):
boolean
{
function
isLLCall
(
node
:
MemberAccessAstNode
):
boolean
{
// if(node && node.nodeType === 'MemberAccess' && node.memberName !== 'call' &&
// node.expression && node.expression.nodeType && nodeType(node.expression, exactMatch(nodeTypes.MEMBERACCESS)))
// node = node.expression;
return
isMemberAccess
(
node
,
return
isMemberAccess
(
node
,
exactMatch
(
util
.
escapeRegExp
(
lowLevelCallTypes
.
CALL
.
type
)),
exactMatch
(
util
.
escapeRegExp
(
lowLevelCallTypes
.
CALL
.
type
)),
undefined
,
exactMatch
(
basicTypes
.
ADDRESS
),
exactMatch
(
lowLevelCallTypes
.
CALL
.
ident
))
||
undefined
,
exactMatch
(
basicTypes
.
ADDRESS
),
exactMatch
(
lowLevelCallTypes
.
CALL
.
ident
))
||
...
@@ -1008,6 +1015,7 @@ function isBytesLengthCheck (node: MemberAccessAstNode): boolean {
...
@@ -1008,6 +1015,7 @@ function isBytesLengthCheck (node: MemberAccessAstNode): boolean {
function
isMemberAccess
(
node
:
MemberAccessAstNode
,
retType
:
string
,
accessor
:
string
|
undefined
,
accessorType
:
string
,
memberName
:
string
|
undefined
):
boolean
{
function
isMemberAccess
(
node
:
MemberAccessAstNode
,
retType
:
string
,
accessor
:
string
|
undefined
,
accessorType
:
string
,
memberName
:
string
|
undefined
):
boolean
{
if
(
node
&&
nodeType
(
node
,
exactMatch
(
'MemberAccess'
)))
{
if
(
node
&&
nodeType
(
node
,
exactMatch
(
'MemberAccess'
)))
{
// console.log('node inside memberaccess------', node)
const
nodeTypeDef
:
boolean
=
typeDescription
(
node
,
retType
)
const
nodeTypeDef
:
boolean
=
typeDescription
(
node
,
retType
)
// console.log('MemberAccess typeDef ->',nodeTypeDef)
// console.log('MemberAccess typeDef ->',nodeTypeDef)
const
nodeMemName
:
boolean
=
memName
(
node
,
memberName
)
const
nodeMemName
:
boolean
=
memName
(
node
,
memberName
)
...
...
remix-analyzer/test/analysis/staticAnalysisIntegration-test-0.5.0.ts
View file @
2fce136c
This diff is collapsed.
Click to expand it.
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