Closed adraffy closed 2 weeks ago
@adraffy the verifier URL can be configured in foundry.toml as shown in https://book.getfoundry.sh/reference/config/etherscan#etherscan:
[rpc_endpoints]
sepolia = "https://rpc.ankr.com/eth_sepolia"
[etherscan]
sepolia = { key = "KEY_HERE", url = "https://api.etherscan.io/v2/api"}
then
forge create --rpc-url sepolia --private-key $PRIVATE_KEY src/Counter.sol:Counter --verify
Submitting verification for [src/Counter.sol:Counter] 0x128Abc30357bE673C20D08756B0C1ab304623Fe4.
Encountered an error verifying this contract:
Response: `NOTOK`
Details: `Missing or unsupported chainid parameter (required for v2 api), please see https://api.etherscan.io/v2/chainlist for the list of supported chainids
For the already verified message we should probably apply same defaults to deploy as for verify args, that is https://github.com/foundry-rs/foundry/blob/a428ba6ad8856611339a6319290aade3347d25d9/crates/script/src/verify.rs#L149 instead https://github.com/foundry-rs/foundry/blob/a428ba6ad8856611339a6319290aade3347d25d9/crates/forge/bin/cmd/create.rs#L353
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (5c69a9d 2024-10-28T00:23:24.836557329Z)
What command(s) is the bug in?
forge create
Operating System
Linux
Describe the bug
forge create CONTRACT --verify --private-key $PRIVATE_KEY --rpc-url https://rpc.ankr.com/eth_sepolia --etherscan-api-key $ETHERSCAN_KEY
always prints "is already verified. Skipping verification."With
RUST_LOG=trace
With etherscan v2 endpoint
--verifier-url "https://api.etherscan.io/v2/api"
Since there's no way to configure the verifier, this only supports
etherscan
verification? https://github.com/foundry-rs/foundry/blob/a428ba6ad8856611339a6319290aade3347d25d9/crates/forge/bin/cmd/create.rs#L335-L365skip_is_verified_check
cannot be set byforge create
: https://github.com/foundry-rs/foundry/blob/a428ba6ad8856611339a6319290aade3347d25d9/crates/verify/src/etherscan/mod.rs#L65-L75https://github.com/foundry-rs/foundry/blob/a428ba6ad8856611339a6319290aade3347d25d9/crates/verify/src/etherscan/mod.rs#L233-L248
The
foundry-rs/block-explorers:contract_abi()
call: https://github.com/foundry-rs/block-explorers/blob/a4582e4b300e70ec7b6224c352278625a28eec8d/crates/block-explorers/src/contract.rs#L364-L395