Skip to main content

ILZBridgeAndDelegateConfig

Git Source

Inherits: ITimelockBatchQueue

Title: ILZBridgeAndDelegateConfig

Timelock policy that owns LayerZero bridge configuration on behalf of the LZBridgeGateway, LZEndpointDelegate, and periphery LZCrossChainBridge contracts.

The policy is intended to hold the bridge_configurator role on the gateway/delegate and to be pinned as configurator on the periphery bridge. In that deployment shape every bridge_configurator-gated mutator on the gateway and the delegate, and every configurator-gated setter on the periphery, is reached only through the queue exposed here; the contracts themselves only enforce the role / configurator gate. Gateway, delegate, and facilitator mutators are submitted as sub-actions of queue; the policy's own configuration (target slots, timelock delay) is managed through the typed queueSetTarget* and queueSetTimelockDelay helpers. Proposer roles map back to the existing bridge_admin, bridge_rate_limiter, and admin roles; emergency cancels malicious or stale queued actions.

Implementations are expected to inherit TimelockBatchQueue and extend its event and error surface; the inherited interface is exposed by also implementing ITimelockBatchQueue.

Functions​

gateway​

The LZBridgeGateway this policy manages.

function gateway() external view returns (address);

Returns

NameTypeDescription
<none>address

delegate​

The LZEndpointDelegate this policy manages.

function delegate() external view returns (address);

Returns

NameTypeDescription
<none>address

facilitator​

The periphery LZCrossChainBridge this policy manages.

function facilitator() external view returns (address);

Returns

NameTypeDescription
<none>address

MIN_TIMELOCK_DELAY​

Minimum accepted timelock delay.

function MIN_TIMELOCK_DELAY() external view returns (uint48);

Returns

NameTypeDescription
<none>uint48

MAX_TIMELOCK_DELAY​

Maximum accepted timelock delay.

function MAX_TIMELOCK_DELAY() external view returns (uint48);

Returns

NameTypeDescription
<none>uint48

EXECUTION_WINDOW​

Length of the window after executableAt during which a queued action may be executed before it expires.

function EXECUTION_WINDOW() external view returns (uint48);

Returns

NameTypeDescription
<none>uint48

queueSetTargetGateway​

Queues a self-call updating the policy's gateway target slot.

Proposer access: admin only.

function queueSetTargetGateway(address newGateway_) external returns (uint64 actionId);

Parameters

NameTypeDescription
newGateway_addressThe new gateway address.

Returns

NameTypeDescription
actionIduint64The queued action ID.

queueSetTargetDelegate​

Queues a self-call updating the policy's delegate target slot.

Proposer access: admin only.

function queueSetTargetDelegate(address newDelegate_) external returns (uint64 actionId);

Parameters

NameTypeDescription
newDelegate_addressThe new delegate address.

Returns

NameTypeDescription
actionIduint64The queued action ID.

queueSetTargetFacilitator​

Queues a self-call updating the policy's facilitator target slot.

Proposer access: admin only.

function queueSetTargetFacilitator(address newFacilitator_) external returns (uint64 actionId);

Parameters

NameTypeDescription
newFacilitator_addressThe new facilitator address.

Returns

NameTypeDescription
actionIduint64The queued action ID.

queueSetTimelockDelay​

Queues a self-call updating the configured timelock delay.

Proposer access: admin only.

function queueSetTimelockDelay(uint48 delay_) external returns (uint64 actionId);

Parameters

NameTypeDescription
delay_uint48The new timelock delay in seconds.

Returns

NameTypeDescription
actionIduint64The queued action ID.

queue​

Queues a batch of one or more gateway, delegate, or facilitator sub-actions for atomic timelocked execution.

Each sub-action is validated as if it had been submitted individually; the caller must hold the proposer role required by every sub-action in the batch. Self-targeted sub-actions are rejected: the policy's own configuration is managed only through the typed queueSetTarget* / queueSetTimelockDelay helpers.

function queue(
ITimelockBatchQueue.BatchAction[] memory actions_
) external returns (uint64 actionId);

Parameters

NameTypeDescription
actions_ITimelockBatchQueue.BatchAction[]The sub-actions to queue.

Returns

NameTypeDescription
actionIduint64The queued action ID.

Events​

TargetGatewaySet​

Emitted when the gateway target slot is updated through the timelock queue.

event TargetGatewaySet(address indexed gateway);

Parameters

NameTypeDescription
gatewayaddressThe new gateway address.

TargetDelegateSet​

Emitted when the delegate target slot is updated through the timelock queue.

event TargetDelegateSet(address indexed delegate);

Parameters

NameTypeDescription
delegateaddressThe new delegate address.

TargetFacilitatorSet​

Emitted when the facilitator target slot is updated through the timelock queue.

event TargetFacilitatorSet(address indexed facilitator);

Parameters

NameTypeDescription
facilitatoraddressThe new facilitator address.

Errors​

LZBridgeAndDelegateConfig_InvalidAddress​

Thrown when a constructor argument or proposed target slot is the zero address.

error LZBridgeAndDelegateConfig_InvalidAddress(string parameter);

Parameters

NameTypeDescription
parameterstringThe name of the invalid parameter.

LZBridgeAndDelegateConfig_SubActionTargetStale​

Thrown at execution when the target slot for a sub-action's queue-time TargetKind no longer holds the address the action was queued against (the slot was rotated between queue and execution). The action can be cleared via emergency cancellation and re-queued against the new target.

error LZBridgeAndDelegateConfig_SubActionTargetStale(
uint64 actionId,
uint256 index,
address queuedTarget,
address currentTarget
);

Parameters

NameTypeDescription
actionIduint64The queued action ID.
indexuint256The sub-action position within the batch.
queuedTargetaddressThe address the sub-action was validated against at queue time.
currentTargetaddressThe address the slot currently holds.

Enums​

TargetKind​

Which target slot a queued sub-action was validated against at queue time.

NONE is the zero value, meaning "no sub-action recorded".

enum TargetKind {
NONE,
GATEWAY,
DELEGATE,
FACILITATOR,
SELF
}

Variants

NameDescription
NONE
GATEWAY
DELEGATE
FACILITATOR
SELF