LogoLogo
HomeMetadata APIAPI PROTwitter
Etherscan V2
Etherscan V2
  • Introduction
  • Chef's Pick
  • Rate Limits
  • V1 to V2 API Migration Guide
  • ✨Getting Started
    • Creating an Account
    • Getting an API Key
    • Supported Chains
    • Supported Endpoints
  • 🎯API Endpoints
    • Nametags
    • Accounts
    • Contracts
    • Transactions
    • Blocks
    • Logs
    • Geth/Parity Proxy
    • Tokens
    • Gas Tracker
    • Stats
    • L2 Deposits/Withdrawals
    • Usage
  • 🏆API PRO
    • Etherscan API PRO
    • Metadata/Name Tag API
  • 🍳Cookbook
    • Track Uniswap V4 DEX Trades
  • Get An Address's Full Transaction History
  • ✅Contract Verification
    • Verify with Foundry
  • Common Verification Errors
  • 🤝Support
    • FAQ
    • Legacy V1 Docs
    • Checking Usage
    • Common Error Messages
    • Getting Help
  • Visit Etherscan.io
Powered by GitBook
On this page
  • Deploy and Verify
  • Verify an Existing Contract
  • Migrating from V1
  1. Contract Verification

Verify with Foundry

PreviousGet An Address's Full Transaction HistoryNextCommon Verification Errors

Last updated 11 hours ago

You must update to the nightly build of Foundry to use this at the moment, via foundryup --install nightly

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 key via --etherscan-api-key . This works for every .

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 done by and the Foundry team

✅
🔥
⚠️
🙌
Foundry
Etherscan
supported explorer
@iainnash