aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packages/sol-compiler/src/compiler.ts9
1 files changed, 3 insertions, 6 deletions
diff --git a/packages/sol-compiler/src/compiler.ts b/packages/sol-compiler/src/compiler.ts
index 286f15073..1c08cb324 100644
--- a/packages/sol-compiler/src/compiler.ts
+++ b/packages/sol-compiler/src/compiler.ts
@@ -184,12 +184,9 @@ export class Compiler {
if (!shouldCompile) {
continue;
}
- let solcVersion = this._solcVersionIfExists;
- if (_.isUndefined(solcVersion)) {
- const solcVersionRange = parseSolidityVersionRange(contractSource.source);
- const availableCompilerVersions = _.keys(binPaths);
- solcVersion = semver.maxSatisfying(availableCompilerVersions, solcVersionRange);
- }
+ const solcVersion = _.isUndefined(this._solcVersionIfExists)
+ ? semver.maxSatisfying(_.keys(binPaths), parseSolidityVersionRange(contractSource.source))
+ : this._solcVersionIfExists;
if (_.isUndefined(versionToInputs[solcVersion])) {
versionToInputs[solcVersion] = {
standardInput: {