Skip to main content

Verify via Hardhat

The Hardhat plugin @nomicfoundation/hardhat-verify has official Sourcify support.

Sourcify verification is enabled by default in recent plugin versions.

You only need explicit config if you want to set custom endpoints (for example when using your own Sourcify instance):

hardhat.config.js
sourcify: {
enabled: true, // Optional, true by default
// Optional: specify a different Sourcify server
apiUrl: "https://sourcify.dev/server",
// Optional: specify a different Sourcify repository
browserUrl: "https://repo.sourcify.dev",
}

After deploying your contracts you can verify on Sourcify with:

Verify a contract
npx hardhat verify --network mainnet DEPLOYED_CONTRACT_ADDRESS

The Hardhat plugin currently uses Sourcify's legacy verification endpoints internally. The /v2 and /v3 API endpoints documented elsewhere apply to direct API integrations, not to this Hardhat command.