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

Contract verification fails using forge script with recent version of forge. #7702

Closed
2 tasks done
simplyoptimistic opened this issue Apr 18, 2024 · 0 comments · Fixed by #7713
Closed
2 tasks done
Labels
T-bug Type: bug

Comments

@simplyoptimistic
Copy link

simplyoptimistic commented Apr 18, 2024

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 (63072be 2024-04-18T00:17:28.746005000Z)

What command(s) is the bug in?

forge script

Operating System

macOS (Apple Silicon)

Describe the bug

The following command, run on the default foundry template (forge init) results in the contract being deployed and then subsequently, the verification failing with the following error:

forge script script/Counter.s.sol:CounterScript --broadcast --slow --rpc-url base --verify -vvvv
Submitting verification for [lib/forge-std/src/Base.sol:CommonBase] <address>.
Encountered an error verifying this contract:
Response: `NOTOK`
Details: `Invalid constructor arguments provided. Please verify that they are in ABI-encoded format`

It also fails on optimism (so I think it affects all chains, although it is possible it might only affect op-stack chains).

You will need to add the following to your foundry.toml

[rpc_endpoints]
base = "${BASE_RPC_URL}"
optimism = "${OPTIMISM_RPC_URL}"

[etherscan]
base = { key = "${BASE_ETHERSCAN_API_KEY}", url = "${BASE_ETHERSCAN_VERIFIER_URL}" }
optimism = { key = "${OPTIMISM_ETHERSCAN_API_KEY}", url = "${OPTIMISM_ETHERSCAN_VERIFIER_URL}" }

I then downgraded to this version of foundry from two weeks ago and the deployment + verification works fine. Note that the eip1559 fix wasn't implemented by this time, so make sure you account for that or you will tip 3gwei.

https://github.com/foundry-rs/foundry/releases/tag/nightly-f625d0fa7c51e65b4bf1e8f7931cd1c6e2e285e9

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

Successfully merging a pull request may close this issue.

1 participant