Delegation
Git Source (opens in a new tab)
Library for managing and verifying delegations.
Functions
exists
Check if a delegation control ID exists by comparing it to an empty bytes32
value.
function exists(ResourceId delegationControlId) internal pure returns (bool);
Parameters
Name | Type | Description |
---|---|---|
delegationControlId | ResourceId | The ResourceId of the delegation control. |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | true if the delegation control ID exists, false otherwise. |
isUnlimited
Check if a delegation is unlimited by comparing it to the constant for unlimited delegations.
function isUnlimited(ResourceId delegationControlId) internal pure returns (bool);
Parameters
Name | Type | Description |
---|---|---|
delegationControlId | ResourceId | The ResourceId of the delegation control. |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | true if the delegation is unlimited, false otherwise. |
isLimited
Check if a delegation is limited.
function isLimited(ResourceId delegationControlId) internal pure returns (bool);
Parameters
Name | Type | Description |
---|---|---|
delegationControlId | ResourceId | The ResourceId of the delegation control. |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | true if the delegation is limited, false otherwise. |
verify
Verify a delegation.
Verifying the delegation might have side effects in the delegation control contract.
function verify(
ResourceId delegationControlId,
address delegator,
address delegatee,
ResourceId systemId,
bytes memory callData
) internal returns (bool);
Parameters
Name | Type | Description |
---|---|---|
delegationControlId | ResourceId | The ResourceId of the delegation control. |
delegator | address | The address of the delegator. |
delegatee | address | The address of the delegatee. |
systemId | ResourceId | The ResourceId of the system. |
callData | bytes | The call data of the call that is being delegated. |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | true if the delegation is exists and is valid, false otherwise. |
DelegationControl
Git Source (opens in a new tab)
Inherits: System, IDelegationControl
Abstract contract to manage delegations and check interface support. Inherits functionalities from WorldContextConsumer and IDelegationControl.
Functions
supportsInterface
Check if the given interfaceId is supported by this contract.
Overrides the functionality from IERC165 and WorldContextConsumer to check for supported interfaces.
function supportsInterface(
bytes4 interfaceId
) public pure virtual override(IERC165, WorldContextConsumer) returns (bool);
Parameters
Name | Type | Description |
---|---|---|
interfaceId | bytes4 | The bytes4 identifier for the interface. |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | true if the interface is supported, false otherwise. |