Verify Contract
Etherscan API Key
https://etherscan.io/
到etherscan register 取得API Key
Use hardhat set API Key
npx hardhat vars set “varible name”
Example
varible name: ETHERSCAN
1 | npx hardhat vars set ETHERSCAN |
Hardhat.config.js use etherscan api key
In module.exports add
1 | etherscan: { |
Use verify commad
npx hardhat verify –network “network name” address
Example
network:arbitrumSepolia
address:0xE8F6DAb9045c9Ce68D37eA95e416D54E7E5678Ef
1 | npx hardhat verify --network arbitrumSepolia 0xE8F6DAb9045c9Ce68D37eA95e416D54E7E5678Ef |
If success
1 | Successfully submitted source code for contract |