-
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
feat(verify-bytecode
): support using Blockscout instead of Etherscan
#8482
Comments
@yash-atreya Is this something that's possible right now or is this a feature request? |
@zerosnacks @yash-atreya bumping this 🙏🏻 |
Hi @blmalone I don't think it is currently supported but should be easy to add, happy to accept a PR for this foundry/crates/verify/src/lib.rs Lines 42 to 52 in 2544793
foundry/crates/verify/src/lib.rs Lines 147 to 149 in 2544793
foundry/crates/verify/src/lib.rs Lines 218 to 245 in 2544793
Should be added in (or split out into a utility file to prevent code duplication) foundry/crates/verify/src/bytecode.rs Line 105 in 2544793
Is this something you would like to work on? |
verify-bytecode
): support using Blockscout instead of Etherscan
Hey @yash-atreya just confirming you are working on this? If so that would be a big help for us! 🙏 |
Also just to confirm the issue here: I see https://book.getfoundry.sh/reference/config/etherscan says that we should be able to use: [etherscan]
unknown_chain = { key = "ABCDEFG", url = "<etherscan api url for this chain>" } to handle a case like this. @blmalone did this not work, and the scope of this issue is to make sure |
When I change my [etherscan]
unknown_chain = { key = "", url = "https://explorer.mode.network/" } and then I run the command: forge verify-bytecode 0xC0d3c0d3c0D3c0d3C0D3c0D3C0d3C0D3C0D30010 L2StandardBridge --rpc-url https://mainnet.mode.network/ --json I get the following error: Response result is unexpectedly empty: status=1, message=OK AFAIK, you can use This isn't working for me, does the |
@mds1 Yash will be out until the 27th so I re-assigned this to me given the priority, I previously assigned it to him as he is most familiar with this code. I'm aiming to get a PR up before tomorrow EOD. |
Hey @blmalone. I recall having some verification issues with blockscout when I was using a
So that would look like this in your case: [etherscan]
mode = { key = "GM", url = "https://explorer.mode.network/api?" } |
Was able to narrow down the error of etherscan.contract_creation_data(args.address).await? This is presumably because It might be possible to add a specific workaround for this edge case for you, open to suggestions. Related code: https://github.com/foundry-rs/block-explorers/blob/d44051a4e5fd4a522739b3c2be6df6aeebca849b/crates/block-explorers/src/contract.rs#L454-L489 + https://github.com/foundry-rs/block-explorers/blob/d44051a4e5fd4a522739b3c2be6df6aeebca849b/crates/block-explorers/src/errors.rs#L29-L30 The message returned by Blockscout is |
#8510 is a draft PR that implements |
@zerosnacks Thanks for looking into this.
Good point, this is a predeploy contract and it's runtime code is set at genesis so there won't be a creation transaction. On a related note, the fix for the following issue actually checks for a creation transaction in order to determine the constructor args: #8545. Supporting predeploy contracts would be super helpful for us and our ongoing work with delivering the Superchain at Op Labs. Does having an additional flag that tells the |
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (e903484 2024-07-19T00:18:41.070490000Z)
What command(s) is the bug in?
forge verify-bytecode
Operating System
macOS (Apple Silicon)
Describe the bug
This is very important for Op Labs to get working.
I want to do bytecode verification on networks that don't have Etherscan setup. e.g.
https://metalscan.io/
https://explorer.mode.network/
They seem to have BlockScout explorers and as far as I understand blockscout has made their api etherscan compatible i.e. https://docs.blockscout.com/for-users/api/rpc-endpoints
e.g.
Is this something I can configure with foundry?
The text was updated successfully, but these errors were encountered: