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
c9c9f6da
Commit
c9c9f6da
authored
Jun 17, 2021
by
aniket-engg
Committed by
Aniket
Jul 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
linting fix
parent
1c6facc3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
14 deletions
+6
-14
slitherClient.ts
libs/remixd/src/services/slitherClient.ts
+6
-14
No files found.
libs/remixd/src/services/slitherClient.ts
View file @
c9c9f6da
/* eslint dot-notation: "off" */
import
*
as
WS
from
'ws'
// eslint-disable-line
import
*
as
WS
from
'ws'
// eslint-disable-line
import
{
PluginClient
}
from
'@remixproject/plugin'
import
{
PluginClient
}
from
'@remixproject/plugin'
import
{
existsSync
,
readFileSync
}
from
'fs'
import
{
existsSync
,
readFileSync
}
from
'fs'
...
@@ -24,8 +26,8 @@ export class SlitherClient extends PluginClient {
...
@@ -24,8 +26,8 @@ export class SlitherClient extends PluginClient {
transform
(
detectors
)
{
transform
(
detectors
)
{
const
standardReport
=
[]
const
standardReport
=
[]
for
(
le
t
e
of
detectors
)
{
for
(
cons
t
e
of
detectors
)
{
le
t
obj
=
{}
cons
t
obj
=
{}
obj
[
'description'
]
=
e
[
'description'
]
obj
[
'description'
]
=
e
[
'description'
]
obj
[
'title'
]
=
e
.
check
obj
[
'title'
]
=
e
.
check
obj
[
'confidence'
]
=
e
.
confidence
obj
[
'confidence'
]
=
e
.
confidence
...
@@ -66,20 +68,10 @@ export class SlitherClient extends PluginClient {
...
@@ -66,20 +68,10 @@ export class SlitherClient extends PluginClient {
const
solcArgs
=
optimizeOption
||
evmOption
?
`--solc-args '
${
optimizeOption
}${
evmOption
}
'`
:
''
const
solcArgs
=
optimizeOption
||
evmOption
?
`--solc-args '
${
optimizeOption
}${
evmOption
}
'`
:
''
const
cmd
=
`slither
${
filePath
}
${
solcArgs
}
--json
${
outputFile
}
`
const
cmd
=
`slither
${
filePath
}
${
solcArgs
}
--json
${
outputFile
}
`
const
child
=
spawn
(
cmd
,
options
)
const
child
=
spawn
(
cmd
,
options
)
let
result
=
''
const
response
=
{}
let
error
=
''
let
response
=
{}
child
.
stdout
.
on
(
'data'
,
(
data
)
=>
{
const
msg
=
`[Slither Analysis]:
${
data
.
toString
()}
`
console
.
log
(
'
\
x1b[32m%s
\
x1b[0m'
,
msg
)
result
+=
msg
+
'
\
n'
})
child
.
stderr
.
on
(
'data'
,
(
err
)
=>
{
error
+=
`[Slither Analysis]:
${
err
.
toString
()}
`
})
child
.
on
(
'close'
,
()
=>
{
child
.
on
(
'close'
,
()
=>
{
const
outputFileAbsPath
=
`
${
this
.
currentSharedFolder
}
/
${
outputFile
}
`
const
outputFileAbsPath
=
`
${
this
.
currentSharedFolder
}
/
${
outputFile
}
`
if
(
existsSync
(
outputFileAbsPath
))
{
if
(
existsSync
(
outputFileAbsPath
))
{
let
report
=
readFileSync
(
outputFileAbsPath
,
'utf8'
)
let
report
=
readFileSync
(
outputFileAbsPath
,
'utf8'
)
report
=
JSON
.
parse
(
report
)
report
=
JSON
.
parse
(
report
)
if
(
report
[
'success'
])
{
if
(
report
[
'success'
])
{
...
...
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