From 92cc7eb249c0bf0653b273f6c5e012e777e4eb34 Mon Sep 17 00:00:00 2001 From: veeso Date: Mon, 22 Jan 2024 17:11:02 +0100 Subject: [PATCH] fix: verify script --- .env.github | 1 + README.md | 15 +++++++++++++++ hardhat.config.ts | 4 ++++ 3 files changed, 20 insertions(+) diff --git a/.env.github b/.env.github index 3ef11b2..18d6d7f 100644 --- a/.env.github +++ b/.env.github @@ -4,3 +4,4 @@ PROD_PRIVATE_KEY="00000000000000000000000000000000000000000000000000000000000000 DEV_PRIVATE_KEY="0000000000000000000000000000000000000000000000000000000000000000" LOCAL_PRIVATE_KEY="ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" OWNER_ADDRESS="0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" +ETHERSCAN_API_KEY="" diff --git a/README.md b/README.md index 378cba7..e770064 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,21 @@ Now browse to . ## How to setup code from template +## Verify source code + +put Etherscan apikey in `.env` file. + +Then run: + +```sh +yarn hardhat verify --network $NETWORK "$CONTRACT_ADDRESS" "$NAME" "$SYMBOL" "$OWNER_ADDRESS" "$INITIAL_SUPPLY" $DECIMALS +``` + +Network can be either: + +- goerli +- ethereum + ## License ERC20 template is licensed under the MIT license. diff --git a/hardhat.config.ts b/hardhat.config.ts index a3dadca..e2951a6 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -9,6 +9,7 @@ const { DEV_PRIVATE_KEY, PROD_PRIVATE_KEY, LOCAL_PRIVATE_KEY, + ETHERSCAN_API_KEY, } = process.env; const config: HardhatUserConfig = { @@ -27,6 +28,9 @@ const config: HardhatUserConfig = { accounts: [`0x${LOCAL_PRIVATE_KEY}`], }, }, + etherscan: { + apiKey: ETHERSCAN_API_KEY, + }, gasReporter: { currency: "USD", gasPriceApi: