Signature
IB20.sol
Description
Reassigns the admin ofrole 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 forrole, or the token has no admins (transitioned viarenounceLastAdmin).
Events
Access Control
Caller must holdgetRoleAdmin(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