Multichain Verification
For repeated or multichain contract verification, it's best to use the Verify Contract endpoint to automate source code submission 🐇.
You may specify a
chainId
along with an Etherscan API key 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 Etherscan API key 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.
Using JSON is the gold standard ✨ for verification, as you can include compiler settings and multiple files ( if you use imports such as from OpenZeppelin ).
Under the request body, paste your source code under "sourceCode" and the code format under the "codeformat" parameter.
Optionally if your contract uses constructor arguments, you may specify them too under the "constructorArguments" parameter in ABI encoded format.
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".
Select the compiler version used from this list as your "compilerversion".
5. Submitting Verification
Click Send and you'll receive a guid
which you can then check on your verification status.
Alternatively if everything went well, you'll see the happy green checkmark on your contract code ✅
Last updated