Open coffeexcoin opened 5 months ago
Have the same issue, my error is Missing etherscan key for chain 123456789
using
forge script script/Deploy_Create.s.sol:Deploy --rpc-url $RPC_URL \
-vv \
--broadcast \
--chain 123456789 \
--slow \
--verify \
--verifier-url ${VERIFIERY_URL} \
--etherscan-api-key ${KEY}
forge 0.2.0 (72bc4f4 2024-04-08T00:17:17.438514000Z)
cc @zerosnacks
getting the same error.
setting env var or passing -e
--etherscan-api-key
doesn't work either
forge 0.2.0 (d495216 2024-05-03T00:18:57.034339671Z)
The same issue applies when using a Tenderly Testnet with custom chain ID.
same error.
I can also confirm that this is an issue with latest forge
forge 0.2.0 (ba9fa20 2024-06-24T00:23:20.410766000Z)
Same issue
I encountered this bug also.
I got hit by that too, but from a different angle. I'm getting ETHERSCAN_API_KEY must be set
despite not using --chain
in any form. It seems that having ETH_RPC_URL
set makes Foundry fetch the chain ID, probably from the RPC server, and that's enough to trigger this bug. Not passing any RPC URL to Foundry solves the issue for me.
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (e5318c3 2024-03-21T00:17:26.798143000Z)
What command(s) is the bug in?
forge verify-contract
Operating System
macOS (Apple Silicon)
Describe the bug
Using
forge verify-contract
orforge create --verify
with an alternate chain ID always fails with "ETHERSCAN_API_KEY must be set"The
ETHERSCAN_API_KEY
environment variable is already set in my environment. There are no customizations to foundry.toml.