Skip to content

docs: Arcscan (Blockscout) smart contract source verification undocumented — hardhat-verify customChains configuration missing #84

Open

Description

@osr21

Summary

When deploying Solidity contracts to Arc Testnet (and presumably Mainnet), Arcscan displays:

"Contract not verified automatically. Please verify manually."

There is no official documentation in this repo, in the Arc docs, or anywhere on arc.io that explains:

  1. Which hardhat-verify plugin to use
  2. What the Blockscout API URL is for Arc Testnet / Mainnet
  3. That a dummy API key is required (Blockscout ignores API keys but hardhat-verify rejects an empty string)
  4. That sourcify: { enabled: false } must be set to prevent conflicting verification attempts

Discovered while building ArcPay on Arc Testnet

After deploying three Solidity contracts (InvoiceRegistry, PaymentEscrow, InvoiceNFT) to Arc Testnet and seeing the "not verified" banner on Arcscan, I had to reverse-engineer the following working configuration by trial and error:

// hardhat.config.ts
import "@nomicfoundation/hardhat-verify";

const config: HardhatUserConfig = {
  // ... solidity, networks ...
  etherscan: {
    apiKey: {
      arc: "empty",          // Blockscout ignores the key but rejects an empty string
      arcMainnet: "empty",
    },
    customChains: [
      {
        network: "arc",
        chainId: 5042002,     // Arc Testnet
        urls: {
          apiURL: "https://testnet.arcscan.app/api",
          browserURL: "https://testnet.arcscan.app",
        },
      },
      {
        network: "arcMainnet",
        chainId: 4564,        // Arc Mainnet
        urls: {
          apiURL: "https://arcscan.app/api",
          browserURL: "https://arcscan.app",
        },
      },
    ],
  },
  sourcify: {
    enabled: false,   // Prevents duplicate/conflicting verification via Sourcify
  },
};

Then verify with:

npx hardhat verify --network arc <CONTRACT_ADDRESS> <CONSTRUCTOR_ARG1> <CONSTRUCTOR_ARG2>

Impact

Every developer deploying a dApp on Arc Network hits this friction point. The arc-node repo already contains hardhat.config.ts but has no etherscan or sourcify block. The "verify manually" banner on Arcscan gives no hint of where to start.


Suggested fix

  1. Add the etherscan.customChains block above to the repo's hardhat.config.ts as a reference
  2. Add a docs/contract-verification.md section walking through the hardhat-verify flow for Arc Testnet and Mainnet
  3. Optionally: update Arcscan's "verify manually" page to link to this documentation

Environment: Arc Testnet (chainId 5042002), @nomicfoundation/hardhat-verify v3, Hardhat 2.28, Solidity 0.8.20

Activity

  1. osr21 commented on May 25, 2026

    @osr21
    Author

    ✅ Working configuration confirmed

    Here's the exact setup verified against Arc Testnet + Mainnet:

    hardhat.config.ts snippet:

    import "@nomicfoundation/hardhat-verify";
    
    etherscan: {
      apiKey: {
        arc: "empty",          // Blockscout ignores the key — any non-empty string works
        arcMainnet: "empty",
      },
      customChains: [
        {
          network: "arc",
          chainId: 5042002,
          urls: {
            apiURL: "https://testnet.arcscan.app/api",
            browserURL: "https://testnet.arcscan.app",
          },
        },
        {
          network: "arcMainnet",
          chainId: 5042,
          urls: {
            apiURL: "https://arcscan.app/api",
            browserURL: "https://arcscan.app",
          },
        },
      ],
    },
    sourcify: { enabled: false },  // Must be set — prevents conflicting Sourcify attempts

    Verify:

    npx hardhat verify --network arc 0xYourContractAddress constructorArg1 constructorArg2

    Foundry equivalent (foundry.toml):

    [etherscan]
    arc = { key = "empty", url = "https://testnet.arcscan.app/api" }
    arcMainnet = { key = "empty", url = "https://arcscan.app/api" }
    forge verify-contract <ADDRESS> src/MyContract.sol:MyContract \
      --chain-id 5042002 --etherscan-api-key empty \
      --verifier-url https://testnet.arcscan.app/api

    Important gotcha: the compiler version, optimizer settings, and EVM version target must match the deployed bytecode exactly. A common failure mode is that hardhat.config.ts in this repo uses evmVersion: 'prague' — if you're verifying contracts compiled with that setting, make sure the same evmVersion is set in your verification config.

    Full reference docs added to PR #79: docs/contract-verification.md

  2. kutluhaneth46 commented on Sep 28, 2026

    @kutluhaneth46
    Contributor

    @ZhiyuCircle requesting assignment — linked PR is already open, CI-green, and mergeable. Per CONTRIBUTING the only remaining gate is assignment; happy to rebase or adjust scope once assigned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationecosystemComponent: ecosystem

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions