-
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
forge verify-contract
is no longer working due too metadata bytecodeHash is not set to none
#1236
Comments
cc @mattsse why did we disable it in the first place? I forgot |
because that causes non deterministic code, see also https://github.com/Uniswap/v3-core/blob/ed88be38ab2032d82bf10ac6f8d03aa631889d48/hardhat.config.ts#L57-L62 but this is not really a verify issue since that's not included in the verify request we're sending to etherscan, right? sounds more like we should consider making ipfs the default? and you can adjust this in the foundry.toml |
I think it is a verify issue because the metadata hash is added to the end of the bytecode, unsure though |
but the bytecode is not part of the verify payload https://docs.etherscan.io/api-endpoints/contracts#source-code-submission-gist |
@onbjerg @mattsse Yes the metadata hash is appended to the bytecode, hence the contract verification is failed when We can only override the metadata setting when using the I have submitted PR on ethers and foundry to solve this problem gakonst/ethers-rs#1126 #1242 |
closing as this in no longer the default and we have json verify |
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (d513291 2022-04-07T18:27:22.910788+00:00)
What command(s) is the bug in?
forge verify-contract
Operating System
macOS (M1)
Describe the bug
With recent introduction to use
bytcodeHash
asNone
by default #1180, it breaks theforge verify-contract
.Etherscan uses
"bytecodeHash": "ipfs"
by default to verify the smart contract but foundry doesn't set the metadata bytecode hash to none when submitting contract verificationThe text was updated successfully, but these errors were encountered: