From 054c6f4bae5033390880087c870080c9c5388560 Mon Sep 17 00:00:00 2001 From: John Feras Date: Tue, 21 May 2024 09:53:24 -0400 Subject: [PATCH] Wait for the grant/renounce role transactions to complete --- script/DeployZkGovOpsGovernor.ts | 8 ++++---- script/DeployZkProtocolGovernor.ts | 8 ++++---- script/DeployZkTokenGovernor.ts | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/script/DeployZkGovOpsGovernor.ts b/script/DeployZkGovOpsGovernor.ts index 57ff19b..a8a08b2 100644 --- a/script/DeployZkGovOpsGovernor.ts +++ b/script/DeployZkGovOpsGovernor.ts @@ -56,11 +56,11 @@ async function main() { const theToken = await govOpsGovernor.token(); console.log(`The Token is set to: ${theToken}`); - await timelock.grantRole(await timelock.PROPOSER_ROLE(), contractAddress); - await timelock.grantRole(await timelock.CANCELLER_ROLE(), contractAddress); - await timelock.grantRole(await timelock.EXECUTOR_ROLE(), contractAddress); + (await timelock.grantRole(await timelock.PROPOSER_ROLE(), contractAddress)).wait(); + (await timelock.grantRole(await timelock.CANCELLER_ROLE(), contractAddress)).wait(); + (await timelock.grantRole(await timelock.EXECUTOR_ROLE(), contractAddress)).wait(); console.log(`Timelock PROPOSER, CANCELLER, and EXECUTOR roles granted to ${contractName} contract`); - await timelock.renounceRole(await timelock.TIMELOCK_ADMIN_ROLE(), adminAddress); + (await timelock.renounceRole(await timelock.TIMELOCK_ADMIN_ROLE(), adminAddress)).wait(); console.log(`ADMIN Role renounced for ${contractName} TimelockController contract (now self-administered)`); } diff --git a/script/DeployZkProtocolGovernor.ts b/script/DeployZkProtocolGovernor.ts index 8a9dc88..3ab41ff 100644 --- a/script/DeployZkProtocolGovernor.ts +++ b/script/DeployZkProtocolGovernor.ts @@ -46,11 +46,11 @@ async function main() { const theToken = await protocolGovernor.token(); console.log(`The ${contractName} Token is set to: ${theToken}`); - await timelock.grantRole(await timelock.PROPOSER_ROLE(), contractAddress); - await timelock.grantRole(await timelock.CANCELLER_ROLE(), contractAddress); - await timelock.grantRole(await timelock.EXECUTOR_ROLE(), contractAddress); + (await timelock.grantRole(await timelock.PROPOSER_ROLE(), contractAddress)).wait(); + (await timelock.grantRole(await timelock.CANCELLER_ROLE(), contractAddress)).wait(); + (await timelock.grantRole(await timelock.EXECUTOR_ROLE(), contractAddress)).wait(); console.log(`Timelock PROPOSER, CANCELLER, and EXECUTOR roles granted to ${contractName} contract`); - await timelock.renounceRole(await timelock.TIMELOCK_ADMIN_ROLE(), adminAddress); + (await timelock.renounceRole(await timelock.TIMELOCK_ADMIN_ROLE(), adminAddress)).wait(); console.log(`ADMIN Role renounced for ${contractName} TimelockController contract (now self-administered)`); } diff --git a/script/DeployZkTokenGovernor.ts b/script/DeployZkTokenGovernor.ts index b3c1ee9..935d23d 100644 --- a/script/DeployZkTokenGovernor.ts +++ b/script/DeployZkTokenGovernor.ts @@ -61,11 +61,11 @@ async function main() { const theToken = await tokenGovernor.token(); console.log(`The Token is set to: ${theToken}`); - await timelock.grantRole(await timelock.PROPOSER_ROLE(), contractAddress); - await timelock.grantRole(await timelock.CANCELLER_ROLE(), contractAddress); - await timelock.grantRole(await timelock.EXECUTOR_ROLE(), contractAddress); + (await timelock.grantRole(await timelock.PROPOSER_ROLE(), contractAddress)).wait(); + (await timelock.grantRole(await timelock.CANCELLER_ROLE(), contractAddress)).wait(); + (await timelock.grantRole(await timelock.EXECUTOR_ROLE(), contractAddress)).wait(); console.log(`Timelock PROPOSER, CANCELLER, and EXECUTOR roles granted to ${contractName} contract`); - await timelock.renounceRole(await timelock.TIMELOCK_ADMIN_ROLE(), adminAddress); + (await timelock.renounceRole(await timelock.TIMELOCK_ADMIN_ROLE(), adminAddress)).wait(); console.log(`ADMIN Role renounced for ${contractName} TimelockController contract (now self-administered)`); }