Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
Verify contracts on arbitrum goerli (#1265)
Browse files Browse the repository at this point in the history
* Verify contracts on arbitrum goerli
  • Loading branch information
sveitser authored Jan 17, 2023
1 parent 968a853 commit cfe7141
Show file tree
Hide file tree
Showing 6 changed files with 1,407 additions and 950 deletions.
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Prevent errors due to missing peer dependencies.
auto-install-peers=true
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,12 @@ After running `hardhat deploy`, run the [etherscan-verify](./bin/etherscan-verif
etherscan-verify goerli

This requires the `ETHERSCAN_API_KEY` env var to be set. Keys can be found at
https://etherscan.io/myapikey.

- goerli: https://etherscan.io/myapikey.
- arbitrum goerli: https://arbiscan.io/myapikey

For arbitrum goerli replace `goerli` with `arbitrum_goerli` in the above
commands and set the api key via `ARBISCAN_API_KEY` instead.

## Official assets

Expand Down
17 changes: 4 additions & 13 deletions bin/etherscan-verify
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,7 @@
#
# Verify contracts on etherscan.
#
# This requires the `ETHERSCAN_API_KEY` env var to be set. Keys can be found at
# https://etherscan.io/myapikey.
#
# Usage:
#
# hardhat deploy --network NETWORK
# etherscan-verify NETWORK
#
# For example
#
# hardhat deploy --network goerli
# etherscan-verify goerli
#
# See "Etherscan verification" section in README.md for usage instructions.
set -euo pipefail

NETWORK=$1
Expand Down Expand Up @@ -73,6 +61,9 @@ function ensure_verified() {
fi
}

echo "Removing old artifacts."
rm -rf contracts/artifacts

echo Verifying RescueLib
ensure_verified hardhat verify --network $NETWORK $RESCUE_LIB_ADDRESS

Expand Down
19 changes: 16 additions & 3 deletions contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ subtask(TASK_COMPILE_SOLIDITY_GET_SOLC_BUILD, async (args: any, _hre, runSuper)

const config: HardhatUserConfig = {
defaultNetwork: "localhost",
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
},
namedAccounts: {
deployer: 0,
tokenOwner: 1,
Expand Down Expand Up @@ -91,6 +88,22 @@ const config: HardhatUserConfig = {
tags: ["local"],
},
},
etherscan: {
apiKey: {
arbitrumGoerli: process.env.ARBISCAN_API_KEY || "",
goerli: process.env.ETHERSCAN_API_KEY || "",
},
customChains: [
{
network: "arbitrumGoerli",
chainId: 421613,
urls: {
apiURL: "https://api-goerli.arbiscan.io/api",
browserURL: "https://goerli.arbiscan.io/",
},
},
],
},
solidity: {
version: process.env.SOLC_VERSION ? process.env.SOLC_VERSION : "0.8.0",
settings: {
Expand Down
2 changes: 1 addition & 1 deletion contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@ethersproject/bytes": "^5.5.0",
"@ethersproject/providers": "^5.5.0",
"@nomiclabs/hardhat-ethers": "^2.0.2",
"@nomiclabs/hardhat-etherscan": "^3.0.3",
"@nomiclabs/hardhat-etherscan": "^3.1.0",
"@nomiclabs/hardhat-waffle": "^2.0.1",
"@typechain/ethers-v5": "8.0.2",
"@typechain/hardhat": "^3.0.0",
Expand Down
Loading

0 comments on commit cfe7141

Please sign in to comment.