-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
bug(forge verify-bytecode
): bytecode verification fails with solidity v0.8.26 optimization
#9302
Comments
Hi @QGarchery, this is possibly related to a change in the optimizer steps in For reference:
|
Per @zerosnacks comment and 0.8.26 release notes,
so that would be equivalent with following foundry.toml setting [profile.default.optimizer_details.yulDetails]
optimizerSteps = "dhfoDgvulfnTUtnIf[xa[r]EscLMcCTUtTOntnfDIulLculVcul[j]Tpeulxa[rul]xa[r]cLgvifCTUca[r]LSsTFOtfDnca[r]Iulc]jmul[jul]VcTOculjmul:fDnTOcmu" |
Using
adding
|
@QGarchery if I understand you correctly, we can mark this as I don't think we should make |
To be clear: I found that compiling and verifying with the same default values (the ones of the linked repository) does not make This means that some deployed contract onchain can't be verified using |
cc @yash-atreya |
forge verify-bytecode
): bytecode verification fails with solidity v0.8.26 optimization
@QGarchery is the 0.8.25 contract you want to verify compiled with same
then test with 0.8.26 fails with
Even if not the same sequence as for 0.8.25
I don't think there's something we could do as foundry does not control this and you should probably open a solc ticket if still a problem? |
Closing, you are right: this quirk of the compiler does not seem to be the issue for verifying the contract. Still having an issue, but I can't share much at the moment, and I can't yet pinpoint what is the problem exactly. Will open another issue when I know more. Thanks for your help and your patience ! |
Came across this from the Solidity chat. Curious, is the custom optimization sequence the reason the verification was not working? I wasn't able to fully understand if the problem is resolved. I'm also happy to help with the verification issues and want to learn more what's the issue here. |
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (58bf161 2024-11-07T00:20:40.732513260Z)
What command(s) is the bug in?
forge verify-bytecode
Operating System
Linux
Describe the bug
Sometimes some constants are appended at the end of the creation bytecode. Those constants are not values of immutable variables. Here is a run in a dedicated repository with a minimal example.
Notice how the SOME_SLOT bytes are appended in v0.8.26 but not in v0.8.25.
From personal testing that I can't share at the moment, this seems to be causing
forge verify-bytecode
to not be able to verify a deployed contract. Are the extra bytes at the end of the creation code something thatforge verify-bytecode
can handle ?If full reproducibility is needed I can try to provide another example
The text was updated successfully, but these errors were encountered: