Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

AccessControlDefaultAdminRulesComponent

AccessControlDefaultAdminRules Component

Extension of AccessControl that allows specifying special rules to manage the DEFAULT_ADMIN_ROLE holder, which is a sensitive role with special permissions over other roles that may potentially have privileged rights in the system.

If a specific role doesn’t have an admin role assigned, the holder of the DEFAULT_ADMIN_ROLE will have the ability to grant it and revoke it.

This contract implements the following risk mitigations on top of {AccessControl}:

  • Only one account holds the DEFAULT_ADMIN_ROLE since deployment until it’s potentially renounced.
  • Enforces a 2-step process to transfer the DEFAULT_ADMIN_ROLE to another account.
  • Enforces a configurable delay between the two steps, with the ability to cancel before the transfer is accepted.
  • The delay can be changed by scheduling, see change_default_admin_delay.
  • It is not possible to use another role to manage the DEFAULT_ADMIN_ROLE.

Fully qualified path: openzeppelin_access::accesscontrol::extensions::accesscontrol_default_admin_rules::AccessControlDefaultAdminRulesComponent

Modules

Constants

Free functions

Structs

Storage
DefaultAdminTransferScheduledEmitted when a default_admin transfer is started. Sets new_admin as the next address to become the default_admin by calling accept_default_admin_transfer only after accept_schedule `…
DefaultAdminTransferCanceledEmitted when a pending_default_admin is reset if it was never accepted, regardless of its schedule.
DefaultAdminDelayChangeScheduledEmitted when a default_admin_delay change is started. Sets new_delay as the next delay to be applied between default admins transfers after effect_schedule has passed.
DefaultAdminDelayChangeCanceledEmitted when a pending_default_admin_delay is reset if its schedule didn’t pass.
ComponentState

Enums

Event

Traits