[Hardhat] etherscan에 Contract Verify하기

HyeongA·2023년 7월 30일
1

Blockchain_dev

목록 보기
19/20
post-thumbnail

배포된 컨트랙트를 etherscan에 verify하는 방법입니다.
Hardhat 배포하는 법

💻 verify and publish

1. etherscan 회원가입 및 api발급(무료가능)


2. hardhat.config.js 수정

  • etherscan부분 추가
//전체 코드
require("@nomicfoundation/hardhat-toolbox");
const PVK ="개인키";
module.exports = {
  solidity: "0.8.17",
  etherscan: {
    apiKey: "etherscan에서 발급 받은 키",
  },
  networks: {
    goerli: {
      url: `https://goerli.infura.io/v3/infura에서 발급한 apikey`,
      accounts: [PVK],
    },
  },
};

3. verify

  • npx hardhat verify --network goerli 배포컨트랙트주소
  • etherscan에서 확인
profile
Solidity | React | Python

0개의 댓글