Permissions
Permissions
This contracts provides extending-contracts with role-based access control mechanisms
Methods
DEFAULT_ADMIN_ROLE
Default admin role for all roles. Only accounts with this role can grant/revoke other roles.
Returns
_0
bytes32
undefined
getRoleAdmin
Returns the admin role that controls the specified role.
See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.
Parameters
role
bytes32
keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE")
Returns
_0
bytes32
undefined
grantRole
Grants a role to an account, if not previously granted.
Caller must have admin role for the role
. Emits {RoleGranted Event}.
Parameters
role
bytes32
keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE")
account
address
Address of the account to which the role is being granted.
hasRole
Checks whether an account has a particular role.
Returns true
if account
has been granted role
.
Parameters
role
bytes32
keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE")
account
address
Address of the account for which the role is being checked.
Returns
_0
bool
undefined
hasRoleWithSwitch
Checks whether an account has a particular role; role restrictions can be swtiched on and off.
Returns true
if account
has been granted role
. Role restrictions can be swtiched on and off: - If address(0) has ROLE, then the ROLE restrictions don't apply. - If address(0) does not have ROLE, then the ROLE restrictions will apply.
Parameters
role
bytes32
keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE")
account
address
Address of the account for which the role is being checked.
Returns
_0
bool
undefined
renounceRole
Revokes role from the account.
Caller must have the role
, with caller being the same as account
. Emits {RoleRevoked Event}.
Parameters
role
bytes32
keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE")
account
address
Address of the account from which the role is being revoked.
revokeRole
Revokes role from an account.
Caller must have admin role for the role
. Emits {RoleRevoked Event}.
Parameters
role
bytes32
keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE")
account
address
Address of the account from which the role is being revoked.
Events
RoleAdminChanged
Parameters
role indexed
bytes32
undefined
previousAdminRole indexed
bytes32
undefined
newAdminRole indexed
bytes32
undefined
RoleGranted
Parameters
role indexed
bytes32
undefined
account indexed
address
undefined
sender indexed
address
undefined
RoleRevoked
Parameters
role indexed
bytes32
undefined
account indexed
address
undefined
sender indexed
address
undefined
Last updated