This guide covers Hardhat 3. There is an official migration guide from the Hardhat team.
Install
Via npm.Config
Inhardhat.config.ts, import the plugin at the top and add it to the list of plugins.
Then, specify a verify config with your Etherscan API key. This key works for most supported chains, otherwise you need to define a CustomChain below.
Deploy and Verify (using Hardhat Ignition)
Verify an Existing Contract
Custom Chains
For new chains that have an Etherscan explorer but isn’t supported with Hardhat defaults, you need to add both thenetworks and chainDescriptor in hardhat.config.ts.
--network. In this example for monadTestnet