web3wagmi
← All standards

ERC-5982 Role-based Access Control

ReviewERCcreated 2022-11-15requires ERC-165, ERC-5750

An interface for role-based access control for smart contracts.

Author: Zainan Victor Zhou (@xinbenlv)

ERC-165 interface ids

Computed here as the XOR of the selectors each interface defines.

IERC_ACL_CORE0x6bb9cd16
IERC_ACL_GENERAL0x9d938539
IERC_ACL_METADATA0x61ff8267

Functions this standard introduces (15)

0xb7416ccecanExecute(bytes32,bytes4,bytes32,bytes)view
0xc7072a8fcanGrantRole(bytes32,bytes32,bytes)view
0x7712f836canRevokeRole(bytes32,bytes32,address,bytes)view
0xa9a61cbecreateRole(bytes32,bytes32,string,string,string,bytes32)
0x3f5fe075destroyRole(bytes32,bytes32)
0xf4f5eb5dgrantRole(bytes32,address,bytes)
0x2f2ff15dgrantRole(bytes32,address)
0xf5d5408bhasRole(bytes32,address,bytes)view
0x91d14854hasRole(bytes32,address)view
0x3f038cc7revokeRole(bytes32,address,bytes)
0xd547741frevokeRole(bytes32,address)
0x0aa6afferoleDescription(bytes32)view
0xf5ef8476roleName(bytes32)view
0x9eb6a9efroleURI(bytes32)view
0x321de094setRolePower(bytes32,bytes4,bytes)view

Events (5)

Topic0 is the keccak256 hash of the signature, which is what a log filter matches on.

0xf864a7b2d7c5ae6a7656f270c3d8c32f2f09a035bb3e86d17dfb2261e132b2deRoleGranted(address,bytes32,address,bytes)
0xe32b29384eaf6d489b295ab5d51929839479320b699d647d28a92e91797a7886RoleRevoked(address,bytes32,address,bytes)
0x9535507e6c5938fea7a744bb556c376acb718084de0074a09b5130a94189559bRoleCreated(address,bytes32,bytes32,string,string,string,bytes32)
0x8a6a63d45eefc7872f2d7f03474b7eaf8f0abbdb0a28fdb8bf87ce62c223e67cRoleDestroyed(address,bytes32,bytes32)
0x84e9bf4baca5694f3938b8a59d9f09ad3ee80463204a7ee8c080f09f50046c3cRolePowerSet(address,bytes32,bytes4,bytes)

Depends on (2)

Proposals this one names in its requires field.

What the specification covers

Compare with

Parsed from the canonical specification · discussion