Skip to main content

Signature

IB20.sol

Description

Reassigns the admin of role to newAdminRole. After the call, grantRole and revokeRole for role require the caller to hold newAdminRole, not the previous admin. Only the current admin of role may call this function. Emits RoleAdminChanged(role, previousAdminRole, newAdminRole).

Parameters

Reverts

  • AccessControlUnauthorizedAccount(account, neededRole): caller does not hold the current admin role for role, or the token has no admins (transitioned via renounceLastAdmin).

Events

Access Control

Caller must hold getRoleAdmin(role) at the time of the call. On a fresh token, every role’s admin is DEFAULT_ADMIN_ROLE. Setting newAdminRole equal to role makes the role self-administrating. Combined with revoking all current holders, this permanently closes the ability to grant that role to new accounts.

Example

Usage Example