이 페이지는 영어로 된 기계 번역을 사용하므로 오류나 불명확한 언어가 포함될 수 있습니다. 가장 정확한 정보는 영어 원문을 참조하시기 바랍니다. 잦은 업데이트로 인해 일부 콘텐츠는 원래 영어로 되어 있을 수 있습니다. Crowdin에서 이 페이지의 번역을 개선하는 데 동참하여 도움을 주세요. (Crowdin translation page, Contributing guide)
How to Verify Smart Contracts Using Hardhat
This guide allows you to automatically verify your smart contracts' source code on Kaiascope straight from your CLI using the Hardhat Verify Plugin.
To verify your contract on Kaia, you need to add the following configuration to your hardhat.config.js
:
Kaiascan
- Mainnet
- Kairos
module.exports = { etherscan: { apiKey: { kaia: "unnecessary", }, customChains: [ { network: "kaia", chainId: 8217, urls: { apiURL: "https://mainnet-api.kaiascan.io/hardhat-verify", browserURL: "https://kaiascan.io", } }, ] }}
module.exports = { etherscan: { apiKey: { kairos: "unnecessary", }, customChains: [ { network: "kairos", chainId: 1001, urls: { apiURL: "https://kairos-api.kaiascan.io/hardhat-verify", browserURL: "https://kairos.kaiascan.io", } }, ] }}
Kaiascope
- Mainnet
- Kairos
module.exports = { networks: { kaia: { chainId: 8217, url: "RPC_URL", }, }, etherscan: { apiKey: { kaia: "unnecessary", }, customChains: [ { network: "kaia", chainId: 8217, urls: { apiURL: "https://api-cypress.klaytnscope.com/api", browserURL: "https://kaiascope.com/", }, }, ] }}
module.exports = { networks: { kairos: { chainId: 1001, url: "RPC_URL", }, }, etherscan: { apiKey: { kairos: "unnecessary", }, customChains: [ { network: "kairos", chainId: 1001, urls: { apiURL: "https://api-baobab.klaytnscope.com/api", browserURL: "https://kairos.kaiascope.com", }, }, ] }}
To verify the contract, you will run the verify command and pass in the address of the deployed contract, network and parameters if any.
npx hardhat verify –network <network> <deployed_address> <parameters>// examplenpx hardhat verify --network kairos 0x3e360fC99c4383e3adaAE9742c0fC983fDAa0535
In your terminal you should see the source code for your contract was successfully submitted for verification.
If the verification was successful, you should see Successfully verified contract and there will be a link to the contract code on Kaiascan and Kaiascope respectively.
Kaiascan
Kaiascope