-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deployCode
/getCode
no longer works with different profiles
#7607
Comments
cc @klkvr this also seems related to other recent |
yeah, this is caused by the added validation of ref #7334 (comment) |
@amusingaxl though curious why are you using different profiles for different versions? did you have any issues with foundry multi-version compilation? |
Maybe I missed when this feature was added. I've been using profiles for that for a long time and didn't mind to check back. Although in this specific case, I do need different profiles because 0.6.x contracts must have optimizations disabled, while 0.8.x ones can have them enabled. |
Regarding that "multi-version compilation", where exactly is this documented? I can't seem to find it. |
It is enabled by default if you don't have a solc version specified in the config https://book.getfoundry.sh/reference/config/solidity-compiler#auto_detect_solc |
That doesn't work quite well with most workflows I know. |
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (14daacf 2024-04-09T00:16:23.595685880Z)
What command(s) is the bug in?
forge test
Operating System
Linux
Describe the bug
This issue is related to #7569
I have a project that requires multiple solidity versions configured as the following:
Some of the tests are required to deploy contracts from
0_6_x
, so I leverage thedeployCode
cheatcode to do it. The only gotcha was that I needed to run 2 commands when testing:This used to work until recently, but now I'm facing an error like this one:
The specific line of code that causes that issue is:
DssVestMintable
is defined inlib-0_6_x/dss-vest/DssVest.sol
. To force the compiler to find it, there's asrc-0_6_x/Imports.sol
file that imports it.I checked and the file
out/DssVest.sol/DssVestMintable.json
still exists in the directory, and it's not wiped out when I runforge build
with no profile orforge test
.I'm not sure why this change in behavior was done in the first place, but I would kindly ask if we could have this capability back, otherwise it would be very painful to deal with cross-version compilation with Foundry.
The text was updated successfully, but these errors were encountered: