Skip to content

Commit 445fa6c

Browse files
authored
Merge pull request #373 from MrRobWeb/foundry-advanced-dao-video-6
Advanced-foundry: DAO - video 6 | adding note for changed admin role; missing semicolon;
2 parents 5f1ef9a + ffac170 commit 445fa6c

File tree

1 file changed

+9
-1
lines changed
  • courses/advanced-foundry/8-daos/6-tests

1 file changed

+9
-1
lines changed

courses/advanced-foundry/8-daos/6-tests/+page.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ contract MyGovernorTest is Test {
8686
address public USER = makeAddr("user");
8787
uint256 public constant INITIAL_SUPPLY = 100 ether;
8888

89-
uint256 public constant MIN_DELAY = 3600 // 1 hour after a vote passes
89+
uint256 public constant MIN_DELAY = 3600; // 1 hour after a vote passes
9090
address[] proposers;
9191
address[] executors;
9292

@@ -107,6 +107,14 @@ contract MyGovernorTest is Test {
107107
108108
Now's the point where we want to tighten up who is able to control what aspects of the DAO protocol. The Timelock contract we're using contains a number of roles which we can set on deployment. For example, we only want our governor to be able to submit proposals to the timelock, so this is something we want want to configure explicitly after deployment. Similarly the `admin` role is defaulted to the address which deployed our timelock, we absolutely want this to be our governor to avoid centralization.
109109

110+
> **NOTE**
111+
> For version 5 of OpenZeppelin's TimelockController contract, we need to use another admin role.
112+
> TimelockController: Changed the role architecture to use DEFAULT_ADMIN_ROLE as the admin for all roles, instead of the bespoke TIMELOCK_ADMIN_ROLE that was used previously. This aligns with the general recommendation for AccessControl and makes the addition of new roles easier. Accordingly, the admin parameter and timelock will now be granted DEFAULT_ADMIN_ROLE instead of TIMELOCK_ADMIN_ROLE
113+
> PR: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3799
114+
> We have to modify our code to account for this when
115+
> running `forge test` so that our project will not error. Like this:
116+
> `bytes32 adminRole = timelock.DEFAULT_ADMIN_ROLE();`
117+
110118
```js
111119
function setUp() public {
112120
govToken = new GovToken();

0 commit comments

Comments
 (0)