Verify with Foundry
Foundry is a tool that helps take the heat off smart contract development steps 🔥, including compiling, deploying and finally submitting your contract for verification.
Deploy and Verify
forge create --broadcast --rpc-url https://rpc.sepolia.ethpandaops.io --private-key YourPrivateKey src/ContractFile.sol:ContractName --verify --verifier etherscan --etherscan-api-key YourApiKeyToken
Verify an Existing Contract
forge verify-contract --watch --chain sepolia 0x324eca20b358b18e48f2611f7452560ce3b3c1bb src/ContractFile.sol:ContractName --verifier etherscan --etherscan-api-key YourApiKeyToken
Migrating from V1
API keys from any other explorer (such as BscScan/Basescan/Arbiscan) have been deprecated ⚠️
The easiest way to migrate is to simply pass in your Etherscan key via --etherscan-api-key
For deployment scripts, in foundry.toml
you can shorten your settings to this, without needing a different key for each chain.
etherscan_api_key = "VZFDUWB3YGQ1YCDKTCU1D6DDSS6EWI62KV"
[etherscan]
mainnet = { key = "${ETHERSCAN_API_KEY}" }
This open source integration was shipped by @iainnash and the Foundry team 🙌
Last updated