-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add generic RBAC for GHO token (#332)
* feat: initial generic RBAC for GHO token * fix: use new roles exclusively, update tests for roles * fix: change certora patch * fix: bug in previous certora fix * fix: add admin param to GhoToken constructor * fix: modify Certora GhoToken harness for new admin param * fix: add role grant verification
- Loading branch information
cedephrase
authored
May 16, 2023
1 parent
4c22747
commit a834938
Showing
13 changed files
with
188 additions
and
34 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
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
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
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
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
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
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
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
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,16 @@ | ||
import { expect } from 'chai'; | ||
import { GhoToken } from './../../../types/src/contracts/gho/GhoToken'; | ||
import { task } from 'hardhat/config'; | ||
|
||
task('gho-transfer-ownership', 'Transfer Ownership of Gho') | ||
.addParam('newOwner') | ||
.setAction(async ({ newOwner }, hre) => { | ||
const DEFAULT_ADMIN_ROLE = hre.ethers.utils.hexZeroPad('0x00', 32); | ||
const gho = (await hre.ethers.getContract('GhoToken')) as GhoToken; | ||
const transferOwnershipTx = await gho.transferOwnership(newOwner); | ||
await transferOwnershipTx.wait(); | ||
const grantAdminRoleTx = await gho.grantRole(DEFAULT_ADMIN_ROLE, newOwner); | ||
await expect(grantAdminRoleTx).to.emit(gho, 'RoleGranted'); | ||
|
||
const removeAdminRoleTx = await gho.renounceRole(DEFAULT_ADMIN_ROLE, users[0].address); | ||
|
||
console.log(`GHO ownership transferred to: ${newOwner}`); | ||
}); |
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
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
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
Oops, something went wrong.