Skip to content
Lattice

LayerZeroGatewayAdapterInit

Git Source

Title: LayerZeroGatewayAdapterInit

Author: David Dada <daveproxy80@gmail.com> (https://github.com/dadadave80)

One-shot initializer for a LayerZero gateway-adapter diamond — seeds AccessControl so the eid, peer and destination setters are admin-gated, and wires the LayerZero v2 EndpointV2 (registering the ERC-7786 gateway-source interface via ERC-165). The adapter is its own OApp; setDelegate is NOT called here (only needed to reconfigure LayerZero libs later). Delegatecalled by Diamond.initialize inside the initializing window (so it must NOT open its own pre/postInitializer; each __*_init guard passes because the window is already open). Companion to the CCIPGatewayAdapterInit pattern — a first-class production deploy artifact.

Functions

init

Runs the access-control + LayerZero-adapter module initializers. MUST be invoked via the diamond's initialize _init delegatecall.

function init(address admin, address endpoint) external;

Parameters

NameTypeDescription
adminaddressThe address granted DEFAULT_ADMIN_ROLE (controls every adapter setter).
endpointaddressThe LayerZero v2 EndpointV2 the adapter dispatches send to and accepts lzReceive from.