Skip to content
LogoLogo

ILayerZeroV2BridgeEncoder

Git Source

Inherits: IBridgeEncoder

Functions

getLzEndpointId

EVM chain ID => LayerZero endpoint ID

function getLzEndpointId(uint256 evmChainId) external view returns (uint32);

Parameters

NameTypeDescription
evmChainIduint256

Returns

NameTypeDescription
<none>uint32

isOftRegistered

OFT => Whether the OFT is registered

function isOftRegistered(address oft) external view returns (bool);

Parameters

NameTypeDescription
oftaddress

Returns

NameTypeDescription
<none>bool

setLzEndpointId

Associates an EVM chain ID with a LayerZero endpoint ID in the contract storage.

function setLzEndpointId(uint256 evmChainId, uint32 lzEndpointId) external;

Parameters

NameTypeDescription
evmChainIduint256The EVM chain ID.
lzEndpointIduint32The LayerZero endpoint ID.

addOft

Registers an OFT contract.

function addOft(address oft) external;

Parameters

NameTypeDescription
oftaddressThe address of the OFT.

removeOft

Unregisters an OFT contract.

function removeOft(address oft) external;

Parameters

NameTypeDescription
oftaddressThe address of the OFT.

Events

LzEndpointIdRegistered

event LzEndpointIdRegistered(uint256 indexed evmChainId, uint32 indexed lzEndpointId);

Parameters

NameTypeDescription
evmChainIduint256
lzEndpointIduint32

OftAdded

event OftAdded(address indexed oft);

Parameters

NameTypeDescription
oftaddress

OftRemoved

event OftRemoved(address indexed oft);

Parameters

NameTypeDescription
oftaddress