You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have you ensured that all of these are up to date?
Foundry
Foundryup
What version of Foundry are you on?
0.3.1-dev 2025-01-21T16:48:49
What version of Foundryup are you on?
N/A - Docker
What command(s) is the bug in?
forge clone
Operating System
Windows
Describe the bug
Using foundry on docker.
Trying to get forge clone to retrieve contract source code.
forge clone works OK on ETH mainnet (chain_id=1): forge clone --no-git --no-commit --etherscan-api-key {api_key} --chain 1 0x3554A54BC0F1f3aDABa5E3a4CcB35E84418bF553
but fails on BSC (chain_id=56): forge clone --no-git --no-commit --etherscan-api-key {api_key} --chain 56 0x55aBdae5B1b94a203362c49be12550e77D73171e
with Error: Invalid API Key
curl works OK in both cases, so I know the contracts, the chain_id and the api_key are all good:
ETH mainnet: curl -d "address=0x3554A54BC0F1f3aDABa5E3a4CcB35E84418bF553" "https://api.etherscan.io/v2/api?chainid=1&module=contract&action=getsourcecode&apikey={apikey}"
Actually, curl doesn't even work on api v1, using bscscan example code, so it looks like a bscscan problem.
I'll probably look at using v2 when #9196 is complete,
and work round it for the time being.
Thanks for your help!
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
0.3.1-dev 2025-01-21T16:48:49
What version of Foundryup are you on?
N/A - Docker
What command(s) is the bug in?
forge clone
Operating System
Windows
Describe the bug
Using foundry on docker.
Trying to get forge clone to retrieve contract source code.
forge clone works OK on ETH mainnet (chain_id=1):
forge clone --no-git --no-commit --etherscan-api-key {api_key} --chain 1 0x3554A54BC0F1f3aDABa5E3a4CcB35E84418bF553
but fails on BSC (chain_id=56):
forge clone --no-git --no-commit --etherscan-api-key {api_key} --chain 56 0x55aBdae5B1b94a203362c49be12550e77D73171e
with
Error: Invalid API Key
curl works OK in both cases, so I know the contracts, the chain_id and the api_key are all good:
ETH mainnet:
curl -d "address=0x3554A54BC0F1f3aDABa5E3a4CcB35E84418bF553" "https://api.etherscan.io/v2/api?chainid=1&module=contract&action=getsourcecode&apikey={apikey}"
BSC:
curl -d "address=0x55aBdae5B1b94a203362c49be12550e77D73171e" "https://api.etherscan.io/v2/api?chainid=56&module=contract&action=getsourcecode&apikey={apikey}"
The text was updated successfully, but these errors were encountered: