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
9bde45fd
Commit
9bde45fd
authored
Nov 03, 2016
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add modules list and sample module
parent
31fa63e2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
0 deletions
+37
-0
list.js
src/app/staticanalysis/modules/list.js
+3
-0
txOrigin.js
src/app/staticanalysis/modules/txOrigin.js
+34
-0
No files found.
src/app/staticanalysis/modules/list.js
0 → 100644
View file @
9bde45fd
module
.
exports
=
[
require
(
'./txOrigin'
)
]
src/app/staticanalysis/modules/txOrigin.js
0 → 100644
View file @
9bde45fd
var
name
=
'tx origin'
var
desc
=
'warn if tx.origin is used'
function
txOrigin
()
{
this
.
txOriginNode
=
[]
}
txOrigin
.
prototype
.
visit
=
function
(
node
)
{
if
(
node
.
name
===
'MemberAccess'
&&
node
.
attributes
.
member_name
===
'origin'
&&
node
.
attributes
.
type
===
'address'
&&
node
.
children
&&
node
.
children
.
length
&&
node
.
children
[
0
].
attributes
.
type
===
'tx'
&&
node
.
children
[
0
].
attributes
.
value
===
'tx'
)
{
this
.
txOriginNode
.
push
(
node
)
}
}
txOrigin
.
prototype
.
report
=
function
(
node
)
{
var
report
=
this
.
txOriginNode
.
length
+
' use of tx.origin
\
n'
this
.
txOriginNode
.
map
(
function
(
item
,
i
)
{
report
+=
item
.
src
+
'
\
n'
})
return
{
name
:
name
,
report
:
report
}
}
module
.
exports
=
{
name
:
name
,
description
:
desc
,
Module
:
txOrigin
}
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