|
|
|
@ -1,3 +1,5 @@ |
|
|
|
|
/* eslint dot-notation: "off" */ |
|
|
|
|
|
|
|
|
|
import * as WS from 'ws' // eslint-disable-line
|
|
|
|
|
import { PluginClient } from '@remixproject/plugin' |
|
|
|
|
import { existsSync, readFileSync } from 'fs' |
|
|
|
@ -24,8 +26,8 @@ export class SlitherClient extends PluginClient { |
|
|
|
|
|
|
|
|
|
transform (detectors) { |
|
|
|
|
const standardReport = [] |
|
|
|
|
for (let e of detectors) { |
|
|
|
|
let obj = {} |
|
|
|
|
for (const e of detectors) { |
|
|
|
|
const obj = {} |
|
|
|
|
obj['description'] = e['description'] |
|
|
|
|
obj['title'] = e.check |
|
|
|
|
obj['confidence'] = e.confidence |
|
|
|
@ -66,17 +68,7 @@ export class SlitherClient extends PluginClient { |
|
|
|
|
const solcArgs = optimizeOption || evmOption ? `--solc-args '${optimizeOption}${evmOption}'` : '' |
|
|
|
|
const cmd = `slither ${filePath} ${solcArgs} --json ${outputFile}` |
|
|
|
|
const child = spawn(cmd, options) |
|
|
|
|
let result = '' |
|
|
|
|
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()}` |
|
|
|
|
}) |
|
|
|
|
const response = {} |
|
|
|
|
child.on('close', () => { |
|
|
|
|
const outputFileAbsPath = `${this.currentSharedFolder}/${outputFile}` |
|
|
|
|
if (existsSync(outputFileAbsPath)) { |
|
|
|
|