ILayerZeroReceiver
Title: ILayerZeroReceiver (LayerZero v2) — vendored subset
Authors: David Dada <daveproxy80@gmail.com> (https://github.com/dadadave80), Vendored minimal subset of LayerZero v2's ILayerZeroReceiver (https://github.com/LayerZero-Labs/LayerZero-v2). Upstream license: MIT.
Minimal vendored subset of the LayerZero v2 ILayerZeroReceiver — the destination-side interface an
OApp implements so the endpoint can deliver inbound messages via lzReceive and query the OApp's
nonce/path acceptance policy.
Verified verbatim against LayerZero-Labs/LayerZero-v2 (MIT):
packages/layerzero-v2/evm/protocol/contracts/interfaces/ILayerZeroReceiver.sol. Re-declared at pragma
^0.8.30 — do NOT add a LayerZero-v2 dependency. Shares the Origin struct with ILayerZeroEndpointV2.
Note:
- lattice-source: LayerZero
Functions
allowInitializePath
Returns whether the OApp accepts initialization of the messaging path from _origin.
function allowInitializePath(Origin calldata _origin) external view returns (bool);Parameters
| Name | Type | Description |
|---|---|---|
| _origin | Origin |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bool |
nextNonce
Returns the next expected inbound nonce for (_eid, _sender) (0 ⇒ unordered / no nonce enforced).
function nextNonce(uint32 _eid, bytes32 _sender) external view returns (uint64);Parameters
| Name | Type | Description |
|---|---|---|
| _eid | uint32 | |
| _sender | bytes32 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint64 |
lzReceive
Called by the endpoint to deliver an inbound message. _executor / _extraData are supplied by
the executor that triggered delivery.
function lzReceive(
Origin calldata _origin,
bytes32 _guid,
bytes calldata _message,
address _executor,
bytes calldata _extraData
) external payable;Parameters
| Name | Type | Description |
|---|---|---|
| _origin | Origin | |
| _guid | bytes32 | |
| _message | bytes | |
| _executor | address | |
| _extraData | bytes |