Support multiple simultaneous solc versions
See original GitHub issuetags: compiler, solidity-versioning
- I’ve asked for help in the Truffle Gitter before filing this issue.
Issue
In contracts folder, I have old contracts in 0.4 version of solidity and new contracts in 0.5 version. I would like to compile them in the same project but in truffle-config.js, I can only specify one version of solc.
Steps to Reproduce
In contracts folder, create a contract A in 0.4 and another one, contract B, in 0.5
Expected Behavior
I would like truffle compile to work
Actual Results
If I compile with solc 0.4.24, contract B in 0.5 fails to compile If I compile with solc 0.5.0, contract A in 0.4 fails to compile
Environment
- Operating System: ubuntu 18.10
- Ethereum client: ganache
- Truffle version (
truffle version): 5.0.16 - node version (
node --version): 11.9.0 - npm version (
npm --version): 6.5.0
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:18 (10 by maintainers)
Top Results From Across the Web
Build with multiple solc versions? - Ethereum Stack Exchange
Now I can't compile because it shows me there are different SOLC versions. This situation forced me to split project into tokens (and...
Read more >Multiple Solidity versions | Ethereum development ... - Hardhat
Multiple Solidity versions. Hardhat supports projects that use different, incompatible versions of solc. For example, if you have a project ...
Read more >Where are Crowdsale contracts in OpenZeppelin Contracts 3.0?
Hello. Is the situation with the crowdsale related contracts the same (Where is ERC20Mintable.sol in OpenZeppelin Contracts 3.0?)?
Read more >How do I uniformly select the solidity version I want to use in ...
I think it's picking up the solc version installed in node_modules ( 0.7.3 ) - this must have been installed as part of...
Read more >Solidity Documentation - Read the Docs
docker run ethereum/solc:stable --help. You can also specify release build versions in the tag, for example, for the 0.5.4 release.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Moving this to our backlog. I want it!
Hi @CruzMolina, thank you very much for you help !
I had to change two more things in old contracts in 0.4 for them to work
If you see a better workaround, I’d be happy to hear about it
Else, after adding ‘emit’ and changing the function naming, it’s compiling 😃