Skip to main content

Blockscout API Contract Verification

Blockscout API Key

  • A specific key is not required, but a value is. e.g. "abc".



Installation Steps

  1. Install dependencies:

    npm install @nomicfoundation/hardhat-verify \
    @nomiclabs/hardhat-waffle \
    hardhat \
  2. Create a secret.js file at the top level with your wallets private key:

    // secret.js
    module.exports = {
    key: "your_private_key_here"
  3. Create or modify hardhat.config.js in the parent directory and paste the following:


    let secret = require("./secret");

    module.exports = {
    solidity: "0.8.19",
    networks: {
    eon: {
    url: '',
    accounts: [secret.key],
    etherscan: {
    apiKey: {
    eon: "abc"
    customChains: [
    network: "eon",
    chainId: 7332,
    urls: {
    apiURL: "",
    browserURL: ""
  4. Modify the apiKey, networks and customChains to reference Gobi if required.

  5. Modify scripts/deploy.js to the following

    const hre = require("hardhat");

    async function main() {
    const currentTimestampInSeconds = Math.round( / 1000);
    const unlockTime = currentTimestampInSeconds + 60;

    const lockedAmount = hre.ethers.utils.parseEther("0.001");

    const Lock = await hre.ethers.getContractFactory("Lock");
    const lock = await Lock.deploy(unlockTime, { value: lockedAmount });

    await lock.deployed();

    console.log(`Lock with ${hre.ethers.utils.formatEther(lockedAmount)} ZEN and unlock timestamp ${unlockTime} deployed to ${lock.address}`);

    main().catch((error) => {
    process.exitCode = 1;
  6. Deploy a basic contract (change --network if needed):

    npx hardhat run scripts/deploy.js --network eon
  7. Verify the contract by providing the network, deployed address and input parameters (in this case the timestamp):

    npx hardhat verify --network eon 0x94ab663092Ab5B4e4Dbdc0b21Ab4dD7d8390B7DC 1625097600


  • You may receive this message during verification.

    hardhat-verify found one or more errors during the verification process:

    The API responded with an unexpected message.
    Please report this issue to the Hardhat team.
    Contract verification may have succeeded and should be checked manually.
    Message: Unknown UID
  • Visit the block explorer and view verified contracts to confirm it was successful.


  • To verify contracts deployed using thirdweb, the thirdweb SDK is required along with the chainlist and a thirdweb generated API KEY.


  1. Install dependencies:

    npm install @thirdweb-dev/chains \
    @thirdweb-dev/sdk \
  2. Create a thirdweb API key if you don't have one: Create API Key.

  3. Create a .env file in the parent directory:

  4. Replace the SECRET_KEY value with the key generated at step 2.

  5. Change the EXPLORER_API_URL if required

  6. Leave EXPLORER_API_KEY as abc.

  7. Create a thirdwebVerifier.mjs file in the parent directory with the following:

    import { ThirdwebSDK } from "@thirdweb-dev/sdk";
    import dotenv from "dotenv";
    import { HorizenEon, HorizenGobiTestnet } from "@thirdweb-dev/chains"


    const sdk = new ThirdwebSDK(HorizenEon, { secretKey: process.env.SECRET_KEY })

    await sdk.verifier.verifyThirdwebContract(
    // "DropERC1155",
    // "DropERC20",
    // "SignatureDrop",
    // "Marketplace",
    // "MarketplaceV3",
    // "Multiwrap",
    // "Pack",
    // "Split",
    // "TokenERC721",
    // "TokenERC1155",
    // "TokenERC20",
    // "VoteERC20",
    // "AirdropERC721",
    // "AirdropERC1155",
    // "AirdropERC20",
    // "NFTStake",
    // "EditionStake",
    // "TokenStake",
  8. Uncomment the required contract name, and amend new ThirdwebSDK(HorizenEon chain value if using Gobi to new ThirdwebSDK(HorizenGobiTestnet

  9. Run the verification script:

    node thirdwebVerifier.mjs


  • Each thirdweb contract type only needs to be verified once, e.g. if another user has already verified "DropERC721" then your attempt will fail and tell you it's already verified.