2

I have solc v0.5.2 on my system, but I have several contracts, that require solc < v0.5, so that I get errors:

Error: Source file requires different compiler version

What is the best way to run and choose between multiple versions of solc?

Just download solc v0.4.25, rename it into e.g. solc04 and move it into /usr/bin/? Or is there something like virtual environments for solidity?

1

You may be interested in the new truffle feature, the ability to specify your solidity compiler, https://github.com/trufflesuite/truffle/releases/tag/v5.0.0#user-content-what-s-new-in-truffle-v5-truffle-compile-solidity-specify-your-compiler-version.

As for manually switching between the 2, I think docker would be your best bet.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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