-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔨 deploy: revoke timelock canceller role from deployer
- Loading branch information
1 parent
058c948
commit 9956f32
Showing
3 changed files
with
6 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
import { deployments } from "hardhat"; | ||
import type { IAccessControl } from "../../types"; | ||
import executeOrPropose from "./executeOrPropose"; | ||
import format from "./format"; | ||
|
||
const { log } = deployments; | ||
|
||
export default async (contract: IAccessControl, role: string, account: string) => { | ||
if (!(await contract.hasRole(role, account))) { | ||
log("granting role", `${await format(contract.address)}.${await format(role)}`, "to", await format(account)); | ||
await (await contract.grantRole(role, account)).wait(); | ||
await executeOrPropose(contract, "grantRole", [role, account]); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
import { deployments } from "hardhat"; | ||
import type { IAccessControl } from "../../types"; | ||
import executeOrPropose from "./executeOrPropose"; | ||
import format from "./format"; | ||
|
||
const { log } = deployments; | ||
|
||
export default async (contract: IAccessControl, role: string, account: string) => { | ||
if (await contract.hasRole(role, account)) { | ||
log("revoking role", `${await format(contract.address)}.${await format(role)}`, "from", await format(account)); | ||
await (await contract.revokeRole(role, account)).wait(); | ||
await executeOrPropose(contract, "revokeRole", [role, account]); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters