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 script --verifier sourcify is ignored when ETHERSCAN_API_KEY env var is defined #10000

Open
2 tasks done
RaoulSchaffranek opened this issue Mar 3, 2025 · 0 comments · May be fixed by #10002
Open
2 tasks done
Assignees
Labels
A-verification Area: verification C-forge Command: forge Cmd-forge-script Command: forge script T-bug Type: bug
Milestone

Comments

@RaoulSchaffranek
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 Version: 1.0.0-stable

What version of Foundryup are you on?

foundryup: 0.3.1

What command(s) is the bug in?

forge script

Operating System

Linux

Describe the bug

We're trying to verify a contract on Sourcify, but the forge script attempts to verify on Etherscan instead. This only happens when the ETHERSCAN_API_KEY environment variable is defined. It's unexpected that the variable would take precedence over the --verifier sourcify flag. When I delete the environment variable, Foundry correctly verifies against Sourcify.

I set up a simple example repository to reproduce the issue at https://github.com/runtimeverification/buildbear-verifiy

This fails:

export ETHERSCAN_API_KEY="some-api-key"
forge script script/Counter.s.sol \
    --rpc-url buildbear \
    --verify \
    --verifier sourcify \
    --verifier-url "https://rpc.buildbear.io/verify/sourcify/server/raoul" \
    -vvvv \
    --broadcast \
    --slow

It looks like the error was introduced in this PR:
https://github.com/foundry-rs/foundry/pull/9630/files#diff-83809d8e219fe52b39eed2ae2f638def658f8a8d2121e298bf48cb8c39af6fdfR173

@RaoulSchaffranek RaoulSchaffranek added T-bug Type: bug T-needs-triage Type: this issue needs to be labelled labels Mar 3, 2025
@github-project-automation github-project-automation bot moved this to Todo in Foundry Mar 3, 2025
@zerosnacks zerosnacks added the T-to-discuss Type: requires discussion label Mar 3, 2025
@zerosnacks zerosnacks self-assigned this Mar 3, 2025
@zerosnacks zerosnacks added C-forge Command: forge Cmd-forge-script Command: forge script A-verification Area: verification and removed T-to-discuss Type: requires discussion T-needs-triage Type: this issue needs to be labelled labels Mar 3, 2025
@zerosnacks zerosnacks added this to the v1.1.0 milestone Mar 3, 2025
@zerosnacks zerosnacks moved this from Todo to In Progress in Foundry Mar 3, 2025
@zerosnacks zerosnacks moved this from In Progress to Ready For Review in Foundry Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-verification Area: verification C-forge Command: forge Cmd-forge-script Command: forge script T-bug Type: bug
Projects
Status: Ready For Review
2 participants