3

Is it possible to set the default Compiler version in Remix?

Each time I open Remix, the compiler defaults to version 0.5.0+commit.1d4f565a. However, there is currently up to version 0.5.10 available + all the "nightlys" (and the list is growing) so it takes a while to scroll to your preferred version to run the Compiler.

2 Answers 2

3

By default, Remix online compiler uses the version v0.5.1+commit.c8a2cb62.js, which is set in the configuration files.

Github repo: https://github.com/ethereum/remix-ide

File compilerContainer.js (line 26).

defaultVersion: 'soljson-v0.5.1+commit.c8a2cb62.js', // this default version is defined: in makeMockCompiler (for browser test) and in package.json (downloadsolc_root) for the builtin compiler

File package.json (line 155).

"downloadsolc_root": "wget --no-check-certificate https://solc-bin.ethereum.org/bin/soljson-v0.5.1+commit.c8a2cb62.js -O soljson.js",

File makeMockCompiler.js (line 6).

var defaultVersion = 'v0.5.1+commit.c8a2cb62'

When you visit Remix online, you can see pressing F12 (console) the following:

Loading https://solc-bin.ethereum.org/bin/soljson-v0.5.1+commit.c8a2cb62.js without worker

Change default version

Option 1: Remix online

You can customize the URL with your preferred compiler version, like that:

https://remix.ethereum.org/#version=soljson-v0.5.10+commit.5a6ea5b1.js

Option 2: Remix running locally

You can run Remix in localhost following the instructions here (cloning the repository).

$ git clone https://github.com/ethereum/remix-ide.git
$ cd remix-ide

Before you do npm install make sure you've changed the compiler version in the three files above:

File compilerContainer.js:

defaultVersion: 'soljson-v0.5.10+commit.5a6ea5b1.js', // this default version is defined: in makeMockCompiler (for browser test) and in package.json (downloadsolc_root) for the builtin compiler

File package.json:

"downloadsolc_root": "wget --no-check-certificate https://solc-bin.ethereum.org/bin/soljson-v0.5.10+commit.5a6ea5b1.js -O soljson.js",

File makeMockCompiler.js:

var defaultVersion = 'v0.5.10+commit.5a6ea5b1'

After that you can continue the instalation with npm install. To run, write npm start, visit 127.0.0.1:8080 and in the console (F12) you will see the following:

Loading https://solc-bin.ethereum.org/bin/soljson-v0.5.10+commit.5a6ea5b1.js without worker

Remix will load locally with your preferred compiler version.

1
  • Thanks Alberto. The online version is the one I'm using so Option 1 works fine for me, but thanks for the detailed reply.
    – MKen212
    Aug 1, 2019 at 8:49
0

From their Gitter channel:

[as of the time of writing] There is no default option. Compiler version is set in the URL. So it only depends on that.

An alternative to setting a default compiler would be to bookmark the URL of the compiler version you want to "set as default". Whenever you want to use remix, you can then just click on the bookmark to load the default compiler.

1
  • 1
    Thanks Shane - I should have checked on their Glitter channel first...Bookmarking the specific URL works fine
    – MKen212
    Aug 1, 2019 at 8:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.