Skip to main content

Delegation

Git Source

A Delegation allows his owner to execute calls on behalf of the contract.

This contract is intended to be counterfactually instantiated via CREATE2 through the LowLevelDelegator contract.

This contract will hold tickets that will be delegated to a chosen delegatee.

State Variables​

_owner​

Contract owner.

address private _owner;

lockUntil​

Timestamp until which the delegation is locked.

uint96 public lockUntil;

Functions​

initialize​

Initializes the delegation.

function initialize(uint96 _lockUntil) external;

Parameters

NameTypeDescription
_lockUntiluint96Timestamp until which the delegation is locked

executeCalls​

Executes calls on behalf of this contract.

function executeCalls(Call[] calldata calls) external onlyOwner returns (bytes[] memory);

Parameters

NameTypeDescription
callsCall[]The array of calls to be executed

Returns

NameTypeDescription
<none>bytes[]An array of the return values for each of the calls

setLockUntil​

Set the timestamp until which the delegation is locked.

function setLockUntil(uint96 _lockUntil) external onlyOwner;

Parameters

NameTypeDescription
_lockUntiluint96The timestamp until which the delegation is locked

_executeCall​

Executes a call to another contract.

function _executeCall(address to, bytes memory data) internal returns (bytes memory);

Parameters

NameTypeDescription
toaddressThe address to call
databytesThe call data

Returns

NameTypeDescription
<none>bytesThe return data from the call

onlyOwner​

Modifier to only allow the contract owner to call a function

modifier onlyOwner();

Structs​

Call​

A structure to define arbitrary contract calls.

struct Call {
address to;
bytes data;
}

Properties

NameTypeDescription
toaddressThe address to call
databytesThe call data