diff --git a/package.json b/package.json index 5f0a27549b..01713d532c 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "remix-analyzer": "0.3.6", "remix-debug": "0.3.7", "remix-lib": "0.4.6", - "remix-solidity": "0.3.6", + "remix-solidity": "0.3.7", "remix-tabs": "1.0.46", "remix-tests": "0.1.8", "remixd": "0.1.8-alpha.6", diff --git a/src/app/tabs/compileTab/compileTab.js b/src/app/tabs/compileTab/compileTab.js index 1c29029647..0b46cc6f60 100644 --- a/src/app/tabs/compileTab/compileTab.js +++ b/src/app/tabs/compileTab/compileTab.js @@ -25,6 +25,13 @@ class CompileTab { this.optimize = this.optimize === 'true' this.queryParams.update({ optimize: this.optimize }) this.compiler.setOptimize(this.optimize) + + this.evmVersion = this.queryParams.get().evmVersion + if (this.evmVersion === 'undefined' || this.evmVersion === 'null' || !this.evmVersion) { + this.evmVersion = null + } + this.queryParams.update({ evmVersion: this.evmVersion }) + this.compiler.setEvmVersion(this.evmVersion) } setOptimize (newOptimizeValue) { @@ -33,6 +40,12 @@ class CompileTab { this.compiler.setOptimize(this.optimize) } + setEvmVersion (newEvmVersion) { + this.evmVersion = newEvmVersion + this.queryParams.update({ evmVersion: this.evmVersion }) + this.compiler.setEvmVersion(this.evmVersion) + } + /** * Compile a specific file of the file manager * @param {string} target the path to the file to compile diff --git a/src/app/tabs/compileTab/compilerContainer.js b/src/app/tabs/compileTab/compilerContainer.js index d3bbaef903..2ef3b1fdc6 100644 --- a/src/app/tabs/compileTab/compilerContainer.js +++ b/src/app/tabs/compileTab/compilerContainer.js @@ -134,17 +134,55 @@ class CompilerContainer { ` this._view.version = yo`` + this._view.evmVersionSelector = yo` + ` + if (this.compileTabLogic.evmVersion) { + let s = this._view.evmVersionSelector + let i + for (i = 0; i < s.options.length; i++) { + if (s.options[i].value === this.compileTabLogic.evmVersion) { + break + } + } + if (i === s.options.length) { // invalid evmVersion from queryParams + s.selectedIndex = 0 // compiler default + this.onchangeEvmVersion() + } else { + s.selectedIndex = i + } + } + this._view.compilationButton = this.compilationButton() this._view.compileContainer = yo`
-
@@ -189,6 +227,16 @@ class CompilerContainer { this.compileTabLogic.runCompiler() } + onchangeEvmVersion (_) { + let s = this._view.evmVersionSelector + let v = s.value + if (v === 'default') { + v = null + } + this.compileTabLogic.setEvmVersion(v) + this.compile() + } + onchangeLoadVersion (event) { this.data.selectedVersion = this._view.versionSelector.value this._updateVersionSelector()