chore: add etherscan verification after deployments

This commit is contained in:
cedoor
2022-08-22 18:15:10 +02:00
parent 4a2fddc5a0
commit 03b9aa4198
2 changed files with 15 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
import "@nomiclabs/hardhat-ethers"
import "@nomiclabs/hardhat-etherscan"
import "@nomiclabs/hardhat-waffle"
import "@typechain/hardhat"
import { config as dotenvConfig } from "dotenv"
@@ -64,6 +65,9 @@ const hardhatConfig: HardhatUserConfig = {
typechain: {
outDir: config.paths.build.typechain,
target: "ethers-v5"
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY
}
}

View File

@@ -12,6 +12,9 @@ async function main() {
name: `Verifier${treeDepth}`,
address
})
// Verify verifier.
await run("verify:verify", { address })
}
// Deploy Semaphore.
@@ -19,6 +22,14 @@ async function main() {
verifiers: deployedContracts.map((c) => ({ merkleTreeDepth: c.name.substring(8), contractAddress: c.address }))
})
// Verify Semaphore.
await run("verify:verify", {
address,
constructorArguments: [
deployedContracts.map((c) => ({ merkleTreeDepth: c.name.substring(8), contractAddress: c.address }))
]
})
deployedContracts.push({
name: `Semaphore`,
address