World
Reference
Internals
Delegation

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

NameTypeDescription
delegationControlIdResourceIdThe ResourceId of the delegation control.

Returns

NameTypeDescription
<none>booltrue 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

NameTypeDescription
delegationControlIdResourceIdThe ResourceId of the delegation control.

Returns

NameTypeDescription
<none>booltrue if the delegation is unlimited, false otherwise.

isLimited

Check if a delegation is limited.

function isLimited(ResourceId delegationControlId) internal pure returns (bool);

Parameters

NameTypeDescription
delegationControlIdResourceIdThe ResourceId of the delegation control.

Returns

NameTypeDescription
<none>booltrue 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

NameTypeDescription
delegationControlIdResourceIdThe ResourceId of the delegation control.
delegatoraddressThe address of the delegator.
delegateeaddressThe address of the delegatee.
systemIdResourceIdThe ResourceId of the system.
callDatabytesThe call data of the call that is being delegated.

Returns

NameTypeDescription
<none>booltrue 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

NameTypeDescription
interfaceIdbytes4The bytes4 identifier for the interface.

Returns

NameTypeDescription
<none>booltrue if the interface is supported, false otherwise.