-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use @nomiclabs/hardhat-etherscan for Etherscan verification #125
base: main
Are you sure you want to change the base?
Changes from all commits
8ddd3e4
1006698
b6b55e2
619d4b6
e3ba353
8b16cac
ca8a08b
8ec6cc0
6eb97fb
c12c494
592191e
e565fbf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ import { HardhatRuntimeEnvironment } from "hardhat/types" | |
import { DeployFunction } from "hardhat-deploy/types" | ||
|
||
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { | ||
const { getNamedAccounts, deployments } = hre | ||
const { getNamedAccounts, deployments, helpers } = hre | ||
const { deployer, thresholdCouncil } = await getNamedAccounts() | ||
|
||
// TODO: fail if thresholdCouncil is undefined on mainnet | ||
|
@@ -23,6 +23,18 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { | |
log: true, | ||
}) | ||
|
||
if (hre.network.tags.etherscan) { | ||
await hre.ethers.provider.waitForTransaction( | ||
timelock.transactionHash, | ||
5, | ||
300000 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I understand the occasional need for this, but there's nothing inherent to |
||
) | ||
await helpers.etherscan.verify( | ||
timelock, | ||
"contracts/governance/TokenholderGovernor.sol:TokenholderGovernor" | ||
) | ||
} | ||
|
||
if (hre.network.tags.tenderly) { | ||
await hre.tenderly.verify({ | ||
name: "TokenholderGovernor", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we try using
waitForConfirmations
as we did in https://github.com/keep-network/keep-core/blob/4049dc0153c33c3c4cbb2e9a1808581bf76144fb/solidity/random-beacon/deploy/01_deploy_reimbursement_pool.ts#L15?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to use
waitForConfirmations: 1
andwaitForConfirmations: 5
, but nome of the options was good:waitForConfirmations: 5
was causing hanging of the deploy function when executed on thehardhat
network (see waitConfirmations > 1 on hardhat network stalls deployment wighawag/hardhat-deploy#304)waitForConfirmations: 1
was not enough, the deploy ofTokenholderGovernor
was failing.The force-pushes seen below were a result of me going back to the original solution (i.e. using
hre.ethers.provider.waitForTransaction
).