From 68af3cb3f049ca35d4110747ceb5cb1ae5ccc11e Mon Sep 17 00:00:00 2001 From: Moon Date: Sun, 20 Aug 2023 10:57:57 -0400 Subject: [PATCH] dev deploy and etherscan verify --- hardhat.config.ts | 24 +++++++++++++++++++++++- scripts/deploy-dev.sh | 16 ++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100755 scripts/deploy-dev.sh diff --git a/hardhat.config.ts b/hardhat.config.ts index 68f1c3d..99d62b6 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -36,8 +36,30 @@ const config: HardhatUserConfig = { }, gasPrice: 1000000000, }, + "eth-goerli": { + url: `https://goerli.infura.io/v3/${process.env.INFURA_KEY}`, + accounts: { + mnemonic: process.env.MNEMONIC as string + }, + gasPrice: 1000000000, + }, + }, + defaultNetwork: "base-local", + etherscan: { + apiKey: { + "base-goerli": "PLACEHOLDER_STRING" + }, + customChains: [ + { + network: "base-goerli", + chainId: 84531, + urls: { + apiURL: "https://api-goerli.basescan.org/api", + browserURL: "https://goerli.basescan.org" + } + } + ] }, - defaultNetwork: "hardhat", }; export default config; diff --git a/scripts/deploy-dev.sh b/scripts/deploy-dev.sh new file mode 100755 index 0000000..2a6ff23 --- /dev/null +++ b/scripts/deploy-dev.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +NODE_ENV=dev +export NODE_ENV + +npx hardhat compile + +npx hardhat --network eth-goerli run scripts/deploy-l1.ts + +if [ "$?" -eq 0 ] +then + npx hardhat --network base-goerli run scripts/deploy-l2.ts +else + echo "deploy to L1 failed so aborting L2" >&2 + exit 1 +fi