You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* This contract implements the following risk mitigations on top of the AccessControl implementation:
20
20
*
21
-
* - Only one account holds the `DEFAULT_ADMIN_ROLE` at every time after construction except when renounced.
22
-
* - Enforce a 2-step process to transfer the `DEFAULT_ADMIN_ROLE` to another account. Even when it's been renounced.
23
-
* - Enforce a configurable delay between the two steps, with the ability to cancel in between. Even after the timer has passed to avoid locking it forever.
24
-
* - The `DEFAULT_ADMIN_ROLE`'s admin can be only held by itself.
21
+
* * Only one account holds the `DEFAULT_ADMIN_ROLE` at every time after construction except when renounced.
22
+
* * Enforce a 2-step process to transfer the `DEFAULT_ADMIN_ROLE` to another account.
23
+
* - Even when it's been renounced.
24
+
* * Enforce a configurable delay between the two steps, with the ability to cancel in between.
25
+
* - Even after the timer has passed to avoid locking it forever.
26
+
* * The `DEFAULT_ADMIN_ROLE` 's admin can be only held by itself.
25
27
*
26
-
* NOTE: `delay` is only configurable in the constructor to avoid issues related with handling delay management during the transfer is pending to be completed.
28
+
* Once you understand what the {constructor} parameters, you can use this reference implementation:
Copy file name to clipboardexpand all lines: docs/modules/ROOT/pages/access-control.adoc
+2
Original file line number
Diff line number
Diff line change
@@ -131,6 +131,8 @@ Every role has an associated admin role, which grants permission to call the `gr
131
131
132
132
This mechanism can be used to create complex permissioning structures resembling organizational charts, but it also provides an easy way to manage simpler applications. `AccessControl` includes a special role, called `DEFAULT_ADMIN_ROLE`, which acts as the **default admin role for all roles**. An account with this role will be able to manage any other role, unless `_setRoleAdmin` is used to select a new admin role.
133
133
134
+
NOTE: For risk mitigations related to `DEFAULT_ADMIN_ROLE` management. See xref:api:access.adoc#AccessControlAdminRules[`AccessControlAdminRules`] as an alternative with restrictions such as 2-step admin role change, single-holder enforcing and configurable minimum delay.
135
+
134
136
Let's take a look at the ERC20 token example, this time taking advantage of the default admin role:
0 commit comments