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
  • 🤝Support
    • FAQ
    • Legacy V1 Docs
    • Checking Usage
    • Common Error Messages
    • Getting Help
  • Visit Etherscan.io
Powered by GitBook
On this page
  • 1. Using the Verify Contract Endpoint
  • 2. Specify Your chainId
  • 3. Add Contract Source Code
  • 4. Add Contract Metadata
  • 5. Submitting Verification
  1. Contract Verification

Multichain Verification

Last updated 7 months ago

For repeated or multichain contract verification, it's best to use the to automate source code submission .

You may specify a chainId along with an to submit verification for any Etherscan-like explorer

1. Using the Verify Contract Endpoint

In Postman, set your request method to HTTP POST and your URL to https://api.etherscan.io/v2/api .

Specify the verification endpoint under the query parameters, with the module set to contract and action to verifysourcecode.

All API based verification must be authenticated, include your under the "apikey" field.

2. Specify Your chainId

Specify it under the "chainId" where you've deployed your contract, such as 1 for Ethereum and 8453 for Base.

3. Add Contract Source Code

We support 2 formats, solidity-single-file or solidity-standard-json-input.

Under the request body, paste your source code under "sourceCode" and the code format under the "codeformat" parameter.

4. Add Contract Metadata

Include the contract address as "contractaddress", beginning with "0x".

Specify your contract file path and contract name separated by a colon as "contractname", such as "contracts/Verified.sol:Verified".

5. Submitting Verification

Using JSON is the gold standard for verification, as you can ( if you use imports such as from ).

Optionally if your contract uses , you may specify them too under the "constructorArguments" parameter in format.

Select the compiler version used from as your "compilerversion".

Click Send and you'll receive a guid which you can then .

Alternatively if everything went well, you'll see the happy green checkmark on your

✅
✨
include compiler settings and multiple files
OpenZeppelin
constructor arguments
ABI encoded
this list
✅
contract code
🐇
Etherscan API key
Etherscan API key
check on your verification status
Verify Contract endpoint