To answer your question, Yes hardhat verify works for etherscan like a charm. All you need to do is set up your network and your etherscan API key under hardhat.config.ts folder for example:
const config: HardhatUserConfig = { solidity: { version: "your_solidity_version", }, networks: { ethereum: { url: process.env.ETHEREUM_RPC_URL, gasPrice: "auto", account: process.env.YOUR_PRIVATE_KEY }, amoy: { url: process.env.AMOY_RPC_URL, gasPrice: "auto", account: process.env.YOUR_PRIVATE_KEY } }, etherscan: { apiKey: process.env.EXPLORER_API_KEY } }
once your setup is done all you need to do is run the command
> npx hardhat verify --network <network-name-in-hardhat-config> DEPLOYED_CONTRACT_ADDRESS "Constructor arguments"
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article