Skip to content

Commit

Permalink
tasks: Fix renounce role to run before registration
Browse files Browse the repository at this point in the history
  • Loading branch information
victorges committed Oct 11, 2023
1 parent f21b583 commit 021ae03
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions tasks/treasury-renounce-admin-role.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {task} from "hardhat/config"
import {Controller, Treasury} from "../typechain"
import {contractId} from "../utils/helpers"
import {Treasury} from "../typechain"

task(
"treasury-renounce-admin-role",
Expand All @@ -10,15 +9,12 @@ task(

const {deployer} = await hre.getNamedAccounts()

const controller = await deployments.get("Controller")
const Controller: Controller = await hre.ethers.getContractAt(
"Controller",
controller.address
const treasury = await deployments.get("Treasury")
const Treasury: Treasury = await ethers.getContractAt(
"Treasury",
treasury.address
)

const address = await Controller.getContract(contractId("Treasury"))
const Treasury: Treasury = await ethers.getContractAt("Treasury", address)

const adminRole = await Treasury.TIMELOCK_ADMIN_ROLE()
let hasAdminRole = await Treasury.hasRole(adminRole, deployer)
if (!hasAdminRole) {
Expand Down

0 comments on commit 021ae03

Please sign in to comment.