Skip to content

Commit

Permalink
Wait for the grant/renounce role transactions to complete
Browse files Browse the repository at this point in the history
  • Loading branch information
jferas authored and apbendi committed Jul 29, 2024
1 parent 0c705cd commit 054c6f4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions script/DeployZkGovOpsGovernor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)`);
}

Expand Down
8 changes: 4 additions & 4 deletions script/DeployZkProtocolGovernor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)`);
}

Expand Down
8 changes: 4 additions & 4 deletions script/DeployZkTokenGovernor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)`);
}

Expand Down

0 comments on commit 054c6f4

Please sign in to comment.