From b36373ab8117b2cfea22c6787ed10cbb0b706b78 Mon Sep 17 00:00:00 2001 From: Lawrence Forman Date: Mon, 30 Mar 2020 13:51:24 -0400 Subject: [PATCH] `@0x/sol-compiler`: Insert compiler version in input artifacts. --- packages/sol-compiler/src/compiler.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/sol-compiler/src/compiler.ts b/packages/sol-compiler/src/compiler.ts index 335cafe55d..940b260879 100644 --- a/packages/sol-compiler/src/compiler.ts +++ b/packages/sol-compiler/src/compiler.ts @@ -374,7 +374,7 @@ export class Compiler { currentArtifactIfExists: ContractArtifact | void, sourceTreeHashHex: string, contractName: string, - fullSolcVersion: string, + solcVersion: string, sourcesByPath: ContractContentsByPath, compilerInput: StandardInput, compilerOutput: StandardOutput, @@ -401,7 +401,7 @@ export class Compiler { sourceCodes: _.mapValues(usedSources, ({ content }) => content), compiler: { name: 'solc', - version: fullSolcVersion, + version: solcVersion, settings: compilerInput.settings, }, }; @@ -430,7 +430,14 @@ export class Compiler { if (this._shouldSaveStandardInput) { await fsWrapper.writeFileAsync( `${this._artifactsDir}/${contractName}.input.json`, - utils.stringifyWithFormatting(compilerInput), + utils.stringifyWithFormatting({ + ...compilerInput, + // Insert solcVersion into input. + settings: { + ...compilerInput.settings, + version: solcVersion, + }, + }), ); logUtils.warn(`${contractName} input artifact saved!`); }