-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Support multiple simultaneous solc versions #2021
Comments
Hey @amkCha, you might be able to tinker with your older pragma statements like so:
(assuming you want to compile with 0.5.0 and above) |
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 :) |
Hi @amkCha, thanks for bringing this up! We're aware of this limitation and will take steps to resolve this in the future. |
Any progress here? |
@se3000 This problem is actually not trivial to solve so I don't know how soon it will have a solution. One solution which is a bit hacky is to build out your own "external compilation" step. You can specify your own separate compilation step manually and include it in the truffle config. You could group the contracts that require a different compiler together and compile them separately. Here are the docs for Truffle's external compilation feature https://www.trufflesuite.com/docs/truffle/reference/configuration#external-compilers |
I've got the same problem. See issue #2354 for how I'm dealing with it. |
We need to maintain contracts between 0.5 and 0.6 versions and facing the same problem. I tried using the
|
Hey @elenadimitrova! I don't think you can specify a specify a path to the file to be compiled (I think that's what This is kind of a tricky (and obnoxious, I know) thing right now but I think you could have 2 different contracts folders and 2 different Each config would have to specify a I know, I know, this is not ideal but just wanted to provide a workaround that perhaps someone will find helpful. Eventually we'll get this problem sorted out :) |
Does
Can we get away with just 3 |
As far as I know you can only specify I think right now you would have to either have a whole bunch of configs for each grouping or group them by compiler version (and optimizer settings). In other words, for each compilation you can only use one set of compiler settings. |
I'd rather keep them grouped logically than by compiler version as the latter will change over time. I've managed to get it to compile the way I want with nine! truffle configs. |
Moving this to our backlog. I want it! |
Thanks! I am also having problems testing with the nine-truffle-configs setup as the compile command that precedes test only executes against a single config. So do I wait for the |
@elenadimitrova in the meantime, you might be able to pass Wait... maybe that's the right place for "--compile-none", since that's already hooked up... we could make it something like |
Hm, does this still need to be open, now that |
Hi. I have a question about different versions of the compiler for the library and contract.
compilers: {
solc: {
version: "pragma"
}
}
pragma solidity ^0.8.0;
import "./lib/lib1.sol";
...
pragma solidity ^0.6.0;
...
https://trufflesuite.com/blog/take-a-dive-into-truffle-5/#pragma-compilation In theory, can I compile the library and contract with different versions of the compiler? |
No, right now if the one imports the other then they must be compiled with the same version. |
tags: compiler, solidity-versioning
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
truffle version
): 5.0.16node --version
): 11.9.0npm --version
): 6.5.0The text was updated successfully, but these errors were encountered: