@evmcrispr/module-acl
v0.11.0
Published
Access control operations: Ownable ownership, AccessControl and AccessManager roles.
Readme
acl module
Access control operations: Ownable ownership, AccessControl and AccessManager roles.
⚗️ Experimental — available at next.evmcrispr.com.
load aclCommands
| Command | Description | |---------|-------------| | acl:accept-default-admin-transfer | Accept a pending default admin transfer after its schedule has passed. Must be sent by the pending admin. | | acl:accept-ownership | Accept a pending ownership transfer of an Ownable2Step contract. Must be sent by the pending owner. | | acl:begin-default-admin-transfer | Start the delayed two-step transfer of the DEFAULT_ADMIN_ROLE on an AccessControlDefaultAdminRules contract. | | acl:cancel-default-admin-transfer | Cancel a pending default admin transfer. Must be sent by the current default admin. | | acl:cancel-scheduled | Cancel a scheduled AccessManager operation. Callable by its scheduler, a guardian of the required role, or an admin. | | acl:change-default-admin-delay | Schedule a change of the delay applied to future default admin transfers. | | acl:execute-scheduled | Execute an operation through an AccessManager, consuming its schedule when the operation was delayed. | | acl:grant | Grant a role on an AccessControl contract (string roles, hashed with keccak256) or an AccessManager (numeric role ids). | | acl:label-role | Attach a human-readable label to an AccessManager role (emitted as an event for off-chain indexing). | | acl:renounce | Renounce a role held by the connected account on an AccessControl contract or an AccessManager. | | acl:renounce-ownership | Renounce ownership of an Ownable contract, leaving it without an owner and permanently disabling its onlyOwner functions. | | acl:revoke | Revoke a role on an AccessControl contract (string roles, hashed with keccak256) or an AccessManager (numeric role ids). | | acl:rollback-default-admin-delay | Cancel a scheduled default admin delay change. | | acl:schedule | Schedule a delayed operation on an AccessManager for later execution with acl:execute-scheduled. | | acl:set-role-admin | Set the admin role that manages grants and revocations of an AccessManager role. | | acl:set-role-guardian | Set the guardian role allowed to cancel scheduled operations of an AccessManager role. | | acl:set-target-closed | Close or reopen a contract managed by an AccessManager. While closed, all calls to its restricted functions revert. | | acl:set-target-function-role | Map functions of a managed contract to the AccessManager role required to call them. | | acl:transfer-ownership | Transfer ownership of an Ownable contract. On Ownable2Step contracts this stages the pending owner, who must then accept. |
Helpers
| Helper | Returns | Description |
|--------|---------|-------------|
| @acl:canCall | bool | Whether a caller can immediately call a restricted function of a contract managed by an AccessManager. |
| @acl:defaultAdmin | address | Current default admin of an AccessControlDefaultAdminRules contract. |
| @acl:defaultAdminDelay | number | Delay in seconds applied to default admin transfers of an AccessControlDefaultAdminRules contract. |
| @acl:hasRole | bool | Whether an account holds a role on an AccessControl contract (string roles) or an AccessManager (numeric role ids). |
| @acl:operationId | bytes32 | Operation id of an AccessManager call (hashOperation of caller, target and calldata), for use with @acl:operationSchedule. |
| @acl:operationSchedule | number | Timestamp at which a scheduled AccessManager operation becomes executable (0 when unset, expired or already executed). |
| @acl:owner | address | Current owner of an Ownable contract. |
| @acl:pendingDefaultAdmin | address | Pending default admin of an AccessControlDefaultAdminRules contract (the zero address when no transfer is in progress). |
| @acl:pendingOwner | address | Pending owner of an Ownable2Step contract (the zero address when no transfer is in progress). |
| @acl:roleAdmin | bytes32 \| number | Admin role that controls a role: a bytes32 value on AccessControl contracts, a role id on AccessManagers. |
