|
|
@ -32,6 +32,7 @@ export class Compiler { |
|
|
|
runs: 200, |
|
|
|
runs: 200, |
|
|
|
evmVersion: null, |
|
|
|
evmVersion: null, |
|
|
|
language: 'Solidity', |
|
|
|
language: 'Solidity', |
|
|
|
|
|
|
|
remappings: [], |
|
|
|
compilationStartTime: null, |
|
|
|
compilationStartTime: null, |
|
|
|
target: null, |
|
|
|
target: null, |
|
|
|
useFileConfiguration: false, |
|
|
|
useFileConfiguration: false, |
|
|
@ -213,12 +214,12 @@ export class Compiler { |
|
|
|
let input = "" |
|
|
|
let input = "" |
|
|
|
try { |
|
|
|
try { |
|
|
|
if (source && source.sources) { |
|
|
|
if (source && source.sources) { |
|
|
|
const { optimize, runs, evmVersion, language, useFileConfiguration, configFileContent } = this.state |
|
|
|
const { optimize, runs, evmVersion, language, remappings, useFileConfiguration, configFileContent } = this.state |
|
|
|
|
|
|
|
console.log('remappings---->', remappings) |
|
|
|
if (useFileConfiguration) { |
|
|
|
if (useFileConfiguration) { |
|
|
|
input = compilerInputForConfigFile(source.sources, JSON.parse(configFileContent)) |
|
|
|
input = compilerInputForConfigFile(source.sources, JSON.parse(configFileContent)) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
input = compilerInput(source.sources, { optimize, runs, evmVersion, language }) |
|
|
|
input = compilerInput(source.sources, { optimize, runs, evmVersion, language, remappings }) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
result = JSON.parse(remoteCompiler.compile(input, { import: missingInputsCallback })) |
|
|
|
result = JSON.parse(remoteCompiler.compile(input, { import: missingInputsCallback })) |
|
|
@ -331,7 +332,7 @@ export class Compiler { |
|
|
|
|
|
|
|
|
|
|
|
this.state.compileJSON = (source: SourceWithTarget, timeStamp: number) => { |
|
|
|
this.state.compileJSON = (source: SourceWithTarget, timeStamp: number) => { |
|
|
|
if (source && source.sources) { |
|
|
|
if (source && source.sources) { |
|
|
|
const { optimize, runs, evmVersion, language, useFileConfiguration, configFileContent } = this.state |
|
|
|
const { optimize, runs, evmVersion, language, remappings, useFileConfiguration, configFileContent } = this.state |
|
|
|
jobs.push({ sources: source }) |
|
|
|
jobs.push({ sources: source }) |
|
|
|
let input = "" |
|
|
|
let input = "" |
|
|
|
|
|
|
|
|
|
|
@ -339,7 +340,7 @@ export class Compiler { |
|
|
|
if (useFileConfiguration) { |
|
|
|
if (useFileConfiguration) { |
|
|
|
input = compilerInputForConfigFile(source.sources, JSON.parse(configFileContent)) |
|
|
|
input = compilerInputForConfigFile(source.sources, JSON.parse(configFileContent)) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
input = compilerInput(source.sources, { optimize, runs, evmVersion, language }) |
|
|
|
input = compilerInput(source.sources, { optimize, runs, evmVersion, language, remappings }) |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (exception) { |
|
|
|
} catch (exception) { |
|
|
|
this.onCompilationFinished({ error: { formattedMessage: exception.message } }, [], source, "", this.state.currentVersion) |
|
|
|
this.onCompilationFinished({ error: { formattedMessage: exception.message } }, [], source, "", this.state.currentVersion) |
|
|
|