hardhat icon indicating copy to clipboard operation
hardhat copied to clipboard

Add Routescan verification provider

Open Migl992 opened this issue 3 months ago • 4 comments

Describe the feature

Summary

Introduce a new verification provider Routescan alongside Etherscan and Blockscout. Routescan exposes Etherscan-compatible APIs, so the integration mirrors the existing Etherscan flow (no API key required). This lets users verify contracts on networks where Routescan is available using the standard Hardhat v3 verify UX.

Motivation

  • Many L2s/testnets/chains use routescan ase default or backup explorer.
  • Users want a first-party verification flow that “just works” without custom scripts.
  • Aligns with v3’s multi-provider design (enable/disable providers + per-chain descriptors).

Proposed change (high-level)

  • New provider: routescan

    • File: v-next/hardhat-verify/src/internal/routescan.ts
    • Implements VerificationProvider (isVerified / verify / pollVerificationStatus).
    • Etherscan-compatible request/response handling; no API key.
  • Wire up config & types:

    • v-next/hardhat-verify/src/type-extensions.ts: add routescan to VerificationProvidersUserConfig and VerificationProvidersConfig (enabled: boolean).
    • v-next/hardhat-verify/src/internal/hook-handlers/config.ts: validate/resolve verify.routescan.enabled (default true).
  • Register tasks:

    • v-next/hardhat-verify/src/internal/tasks/verify/routescan/index.ts
    • v-next/hardhat-verify/src/internal/tasks/verify/routescan/task-action.ts
    • Keep umbrella verify behavior: runs across enabled providers, or target explicitly via:
      npx hardhat verify routescan --network <network> <address> --contract <FQN>
      
  • Provider name export:

    • ROUTESCAN_PROVIDER_NAME: keyof VerificationProvidersConfig = "routescan" (exported from routescan.ts).
  • Chain descriptors:

    • Update (examples added) in v-next/hardhat/src/internal/builtin-plugins/network-manager/chain-descriptors.ts with:
      blockExplorers: {
        // ...
        routescan: {
          name: "Routescan",
          url: "<browser-viewer-url>",
          apiUrl: "https://api.routescan.io/v2/network/<env>/evm/<chainId>/etherscan/api",
        },
      }
      
  • Index registration:

    • v-next/hardhat-verify/src/index.ts: include the Routescan task alongside Etherscan/Blockscout.

Notes

  • No changes to Hardhat core types required; plugin extends types via type-extensions.ts.

Search terms

No response

Migl992 avatar Aug 29 '25 12:08 Migl992

Hey @Migl992, thanks for opening the feature request. Let me ask in the team and then I will update this issue with notes on adding verifiers to HH3.

kanej avatar Sep 02 '25 08:09 kanej

Appreciate it @kanej working on a PR already. Let me know

Migl992 avatar Sep 02 '25 08:09 Migl992

Hey @kanej any news on this?

Migl992 avatar Oct 27 '25 09:10 Migl992

Hey @Migl992, sorry for taking so long to get back to this - we have been heads down getting ready for devconnect.

Our goal is to generalise the hardhat-verify plugin to allow third party plugins to add additional providers. But we don't have a timeline for this.

For the moment, you have the option to create a routescan verification plugin based on the current hardhat-verify code.

kanej avatar Dec 01 '25 12:12 kanej