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

forge verify-bytecode panics #7667

Closed
2 tasks done
QGarchery opened this issue Apr 15, 2024 · 5 comments
Closed
2 tasks done

forge verify-bytecode panics #7667

QGarchery opened this issue Apr 15, 2024 · 5 comments
Labels
T-bug Type: bug

Comments

@QGarchery
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 (1ca9b85 2024-04-15T02:34:32.892525726Z)

What command(s) is the bug in?

forge verify-bytecode

Operating System

Linux

Describe the bug

When trying to run forge verify-bytecode on Morpho Blue it panics with:
Screenshot from 2024-04-15 10-46-13

Reproduce on morpho-blue at last commit on main 470a6871b3eaa56e94efdc2ee15b873c5f03e086, and run the following command:
forge verify-bytecode --rpc-url $ETHEREUM_RPC --constructor-args 0xcBa28b38103307Ec8dA98377ffF9816C164f9AFa 0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb src/Morpho.sol:Morpho --verification-type partial (with your own ETHEREUM_RPC)

@QGarchery QGarchery added the T-bug Type: bug label Apr 15, 2024
@zerosnacks
Copy link
Member

cc @yash-atreya

@yash-atreya
Copy link
Member

@QGarchery Try setting the etherscan config in foundry.toml like so https://book.getfoundry.sh/reference/config/etherscan?highlight=ETHERSCAN#etherscan

@QGarchery
Copy link
Author

Try setting the etherscan config in foundry.toml

Oh I thought I would not need it since I'm providing the constructor args, and I care about the runtime bytecode only. Is it possible to bypass etherscan in this case ?

It works great when I give the etherscan API key though, thanks ! Maybe the error message can be improved in this case

@yash-atreya
Copy link
Member

Try setting the etherscan config in foundry.toml

Oh I thought I would not need it since I'm providing the constructor args, and I care about the runtime bytecode only. Is it possible to bypass etherscan in this case ?

It works great when I give the etherscan API key though, thanks ! Maybe the error message can be improved in this case

Indeed, error message can be improved here.

There's no way to bypass Etherscan. It is required as we want to cross-check the onchain and local bytecode against each other.

@mds1
Copy link
Collaborator

mds1 commented Apr 16, 2024

To be fair we can make this not rely on block explorers if:

  1. All required inputs are provided by the user, and
  2. We're ok with only verifying runtime code

We can also verify creation code but finding creation code is harder and RPC intensive (binary search over blocks to find deployment block, iterate through each tx, trace tx find where it was deployed(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug
Projects
None yet
Development

No branches or pull requests

5 participants