Contract verification

Verify with the tools you already use: the testnet speaks Etherscan's verification API.

Each testnet has a verifier URL — the same key as its RPC endpoint, on a different path: https://forkstate.forkscout.com/api/verify/<your-key>. Tools need it as a separate URL; the RPC endpoint alone is not enough, just as on mainnet the node and Etherscan are two services.

Foundry

terminal
forge verify-contract 0xDeployedAddress src/MyToken.sol:MyToken \
  --chain <your testnet's chain id> \
  --verifier custom \
  --verifier-url https://forkstate.forkscout.com/api/verify/<your-key> \
  --etherscan-api-key any \
  --watch

The API key can be anything; the key in the URL is what authorises it.

Hardhat

hardhat.config.ts
etherscan: {
  apiKey: { forkstate: "any" },
  customChains: [{
    network: "forkstate",
    chainId: <your testnet's chain id>,
    urls: {
      apiURL: "https://forkstate.forkscout.com/api/verify/<your-key>",
      browserURL: "https://forkstate.forkscout.com",
    },
  }],
},

What you get

  • Source and ABI on the contract's page in the console, with read and write forms.
  • Decoded function calls, events and custom errors in every transaction that touches it.
  • Single-file and standard-JSON input are both accepted; the compiler version is downloaded as needed.