Skip to content
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): incorrectly returning 'No bytecode found at address' #8710

Closed
2 tasks done
blmalone opened this issue Aug 22, 2024 · 3 comments
Closed
2 tasks done
Labels
C-forge Command: forge Cmd-forge-verify Command: forge verify-contract/check T-bug Type: bug
Milestone

Comments

@blmalone
Copy link

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (fa0e0c2 2024-08-22T00:18:15.471698000Z)

What command(s) is the bug in?

forge verify-bytecode

Operating System

macOS (Apple Silicon)

Describe the bug

The recent PR: #8510 introduced new functionality around being able to ignore creation code and using different block explorers.

I'm trying to use a different L2 block explorer to verify a predeploy contract and I'm not able to get the command working. All three of the following commands fail (see screenshot below for failure message).

forge verify-bytecode 0xC0d3c0d3c0D3c0D3C0d3C0D3C0D3c0d3c0d30007 L2CrossDomainMessenger --verifier-url https://explorer.zora.energy/api --ignore creation

forge verify-bytecode 0xC0d3c0d3c0D3c0D3C0d3C0D3C0D3c0d3c0d30007 L2CrossDomainMessenger --verifier-url https://explorer.mode.network/api --ignore creation

forge verify-bytecode 0xC0d3c0d3c0D3c0D3C0d3C0D3C0D3c0d3c0d30007 L2CrossDomainMessenger --verifier-url https://explorer.metall2.com/api --ignore creation

These commands contain Blockscout explorers for Metal, Mode & Zora op stack rollups.

@yash-atreya @zerosnacks have you got an example of the test you used for testing a blockscout API like this?

I was able to get this command to work, however it's using Ethereum mainnet so I'm guessing this was on the happy path:

forge verify-bytecode 0xE01efbeb1089D1d1dB9c6c8b135C934C0734c846 OptimismMintableERC20Factory --verifier-url https://eth.blockscout.com/api --ignore creation

Steps to reproduce

foundryup
git clone https://github.com/ethereum-optimism/optimism.git
cd optimism/packages/contracts-bedrock
git checkout op-contracts/v1.3.0
forge build --skip test scripts
forge verify-bytecode 0xC0d3c0d3c0D3c0D3C0d3C0D3C0D3c0d3c0d30007 L2CrossDomainMessenger --verifier-url https://explorer.metall2.com/api --ignore creation

Error Screenshot

Screenshot 2024-08-21 at 21 31 21

Maybe I'm misunderstanding and passing in the incorrect Blockscout URL for these L2s.

cc: @mds1

@blmalone blmalone added T-bug Type: bug T-needs-triage Type: this issue needs to be labelled labels Aug 22, 2024
@yash-atreya
Copy link
Member

@blmalone I cannot reproduce this. What is the RPC_URL you are using?
Also, you don't need to specify --ignore creation. We detect predeploys automatically

@zerosnacks zerosnacks added C-forge Command: forge Cmd-forge-verify Command: forge verify-contract/check and removed T-needs-triage Type: this issue needs to be labelled labels Aug 22, 2024
@zerosnacks zerosnacks added this to the v1.0.0 milestone Aug 22, 2024
@zerosnacks zerosnacks changed the title bug(forge verify-bytecode): incorrectly returning 'No bytecode found at address' bug(forge verify-bytecode): incorrectly returning 'No bytecode found at address' Aug 22, 2024
@blmalone
Copy link
Author

Okay, going to close this PR. I got it to work for:

Commit: op-contracts/v1.3.0

forge verify-bytecode 0xc0d3c0d3c0d3c0d3c0d3c0d3c0d3c0d3c0d30007 L2CrossDomainMessenger --rpc-url $METAL_RPC_URL --verifier-url $METAL_VERIFIER_URL --ignore creation --json

@blmalone
Copy link
Author

@yash-atreya I've closed in favor of this more specific error: #8722

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-forge Command: forge Cmd-forge-verify Command: forge verify-contract/check T-bug Type: bug
Projects
None yet
Development

No branches or pull requests

3 participants