|
|
|
@ -114,10 +114,9 @@ export class SlitherClient extends PluginClient { |
|
|
|
|
// Allow paths and set solc remapping for import URLs
|
|
|
|
|
const fileContent = readFileSync(`${this.currentSharedFolder}/${filePath}`, 'utf8') |
|
|
|
|
const importsArr = fileContent.match(/import ['"][^.|..](.+?)['"];/g) |
|
|
|
|
let allowPaths = ''; let remaps = '' |
|
|
|
|
let remaps = '' |
|
|
|
|
if (importsArr?.length) { |
|
|
|
|
const { remapString, allowPathString } = this.mapNpmDepsDir(importsArr) |
|
|
|
|
allowPaths = allowPathString |
|
|
|
|
const { remapString } = this.mapNpmDepsDir(importsArr) |
|
|
|
|
remaps = remapString.trim() |
|
|
|
|
} |
|
|
|
|
const optimizeOption: string = optimize ? '--optimize' : '' |
|
|
|
@ -128,10 +127,10 @@ export class SlitherClient extends PluginClient { |
|
|
|
|
} |
|
|
|
|
if (evmOption) { |
|
|
|
|
if (!solcArgs.endsWith(' ')) solcArgs += ' ' |
|
|
|
|
solcArgs += evmOption; |
|
|
|
|
solcArgs += evmOption |
|
|
|
|
} |
|
|
|
|
if (solcArgs) { |
|
|
|
|
solcArgs = `--solc-args "${solcArgs.trimStart()}"`; |
|
|
|
|
solcArgs = `--solc-args "${solcArgs.trimStart()}"` |
|
|
|
|
} |
|
|
|
|
const solcRemaps = remaps ? `--solc-remaps "${remaps}"` : '' |
|
|
|
|
|
|
|
|
|