Skip to main content

LayerZeroV2BridgeAdapter

Git Source

Inherits: BridgeAdapter, ILayerZeroComposer

State Variables

LAYER_ZERO_V2_BRIDGE_ID

uint16 private constant LAYER_ZERO_V2_BRIDGE_ID = 2;

Functions

constructor

constructor(address _registry, address _layerZeroV2Endpoint)
BridgeAdapter(_registry, address(0), address(0), _layerZeroV2Endpoint);

initialize

Initializer of the contract.

function initialize(address _controller, bytes calldata) external override initializer;

Parameters

NameTypeDescription
_controlleraddress
<none>bytes

receive

Allows the contract to receive Ether.

receive() external payable;

lzCompose

Composes a LayerZero message from an OApp.

function lzCompose(address _from, bytes32, bytes calldata _message, address, bytes calldata) external payable;

Parameters

NameTypeDescription
_fromaddressThe address initiating the composition, typically the OApp where the lzReceive was called.
<none>bytes32
_messagebytesThe composed message payload in bytes. NOT necessarily the same payload passed via lzReceive.
<none>address
<none>bytes

_outBridgeTransferCancelDefault

Internal logic for outgoing bridge transfer cancellation default.

function _outBridgeTransferCancelDefault(uint256 transferId) internal view override returns (uint256);

_checkOutBridgeTransferIsCancellable

Checks if an outgoing bridge transfer is in a cancellable state.

function _checkOutBridgeTransferIsCancellable(uint256 transferId) internal override;

_sendOutBridgeTransfer

Handles logic specific to the external bridge protocol for sending out a bridge transfer.

function _sendOutBridgeTransfer(uint256 transferId, bytes calldata data) internal override;

Events

LzGuidCreated

event LzGuidCreated(bytes32 indexed guid, uint256 indexed transferId);