Skip to content

Commit 808913b

Browse files
Use different method to wait between deploying and Etherscan verification
In one of the previous commits we introduced a 5 confirmations wait between executing deploy of contracts and verifying them on Etherscan, using `hre.ethers.provider.waitForTransaction`. Now we're switching to using `waitConfirmations` option of hardhat deploy function for that. This will be in line with how we wait after the deploy in other projects (e.g. `random-beacon`). During the testing, we tried to limit the wait period to 1 confirmation, but this proved to be not enough. We're sticking then with the advised 5 confirmations waiting period.
1 parent e565fbf commit 808913b

7 files changed

+7
-31
lines changed

deploy/01_deploy_t.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
88
const T = await deployments.deploy("T", {
99
from: deployer,
1010
log: true,
11+
waitConfirmations: 5,
1112
})
1213

1314
if (hre.network.tags.etherscan) {
14-
await hre.ethers.provider.waitForTransaction(T.transactionHash, 5, 300000)
1515
await helpers.etherscan.verify(T)
1616
}
1717

deploy/03_deploy_vending_machine_keep.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,10 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
2727
T_ALLOCATION_KEEP,
2828
],
2929
log: true,
30+
waitConfirmations: 5,
3031
})
3132

3233
if (hre.network.tags.etherscan) {
33-
await hre.ethers.provider.waitForTransaction(
34-
vendingMachine.transactionHash,
35-
5,
36-
300000
37-
)
3834
await helpers.etherscan.verify(vendingMachine)
3935
}
4036

deploy/04_deploy_vending_machine_nu.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,10 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
2323
T_ALLOCATION_NU,
2424
],
2525
log: true,
26+
waitConfirmations: 5,
2627
})
2728

2829
if (hre.network.tags.etherscan) {
29-
await hre.ethers.provider.waitForTransaction(
30-
vendingMachine.transactionHash,
31-
5,
32-
300000
33-
)
3430
await helpers.etherscan.verify(vendingMachine)
3531
}
3632

deploy/06_deploy_keep_stake.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,10 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
1111
from: deployer,
1212
args: [KeepTokenStaking.address],
1313
log: true,
14+
waitConfirmations: 5,
1415
})
1516

1617
if (hre.network.tags.etherscan) {
17-
await hre.ethers.provider.waitForTransaction(
18-
KeepStake.transactionHash,
19-
5,
20-
300000
21-
)
2218
await helpers.etherscan.verify(KeepStake)
2319
}
2420

deploy/07_deploy_token_staking.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,14 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
6464
from: deployer,
6565
args: tokenStakingConstructorArgs,
6666
log: true,
67+
waitConfirmations: 5,
6768
})
6869
tokenStakingAddress = TokenStaking.address
6970

7071
await execute("TokenStaking", { from: deployer }, "initialize")
7172
log("Initialized TokenStaking.")
7273

7374
if (hre.network.tags.etherscan) {
74-
await hre.ethers.provider.waitForTransaction(
75-
TokenStaking.transactionHash,
76-
5,
77-
300000
78-
)
7975
await helpers.etherscan.verify(TokenStaking)
8076
}
8177
}

deploy/30_deploy_tokenholder_timelock.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,10 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
1919
from: deployer,
2020
args: [minDelay, proposers, executors],
2121
log: true,
22+
waitConfirmations: 5,
2223
})
2324

2425
if (hre.network.tags.etherscan) {
25-
await hre.ethers.provider.waitForTransaction(
26-
timelock.transactionHash,
27-
5,
28-
300000
29-
)
3026
await helpers.etherscan.verify(timelock)
3127
}
3228

deploy/31_deploy_tokenholder_governor.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,10 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
2121
vetoer,
2222
],
2323
log: true,
24+
waitConfirmations: 5,
2425
})
2526

2627
if (hre.network.tags.etherscan) {
27-
await hre.ethers.provider.waitForTransaction(
28-
timelock.transactionHash,
29-
5,
30-
300000
31-
)
3228
await helpers.etherscan.verify(
3329
timelock,
3430
"contracts/governance/TokenholderGovernor.sol:TokenholderGovernor"

0 commit comments

Comments
 (0)