Where To Verify

Blast has a several block explorers to choose from. Which explorer you choose to spend the most time with is a matter of personal preference, but one common question from new builders is where do I verify my contracts?. Out of the available options, blastscan.io and blastexplorer.io are where most people verify their contracts, so that’s what we’d recommend.

The following guide will help you steer clear common issues while verifying your contracts with Foundry and Hardhat.

Do I Need An API Key?

Whether or not you need valid API key depends on (a) which network you’re using and (b) which API you’re targeting. Blastexplorer’s API will let you verify on testnet and mainnet without requiring a valid API key, but blastscan does require one when verifying on mainnet. You can get a blastscan API key by creating a free account here, and navigating to the “API-KEYs” section of your profile.

ExplorerTestnetMainnet
blastscan.ionoyes
blastexplorer.ionono

forge requires a value for the --etherscan-api-key option even in cases where a valid API key is not required. Just use a placeholder here.

Verification Endpoints

Once you’ve decided where to verify, ensure that you are making your verification request to the correct API endpoint. In Hardhat, this “verification endpoint” is the apiUrl specified in config; in Foundry, this is the --verifier-url you’ll need to provide in your forge command:

blastscan      
Testnethttps://api-sepolia.blastscan.io/api
Mainnethttps://api.blastscan.io/api
blastexplorer
Testnethttps://api.routescan.io/v2/network/testnet/evm/168587773/etherscan
Mainnethttps://api.routescan.io/v2/network/mainnet/evm/81457/etherscan

Verification Examples

Foundry

Use these examples, filling in appropriate values as discussed above, to verify your contracts during deployment using forge script or to verify an existing deployment with forge verify-contract.

forge script <deploy-script> 
    --verify --verifier-url <verification-endpoint> \
    --etherscan-api-key <api-key> --rpc-url <rpc-url> \
    --verify --broadcast -vvvv

Hardhat

Whether using hardhat-ignition-ethers or hardhat-verify, successful verification in Hardhat is primarily a matter of setting up your hardhat.config.ts or hardhat.config.js file correctly.

You’ll need to configure the networks and etherscan properties as demonstrated below. In order to specify the correct verification endpoint from the table above, you will also need to configure the etherscan.customChains property.