ODCutils

LZChainidMapping

Contract to manage mappings between chain id and LZ eid for cross-chain communication

See chain id list on https://chainlist.org/ See LZ eid list on https://docs.layerzero.network/v2/developers/evm/technical-reference/deployed-contracts

UnknownChainByChainid

error UnknownChainByChainid(uint32 chainId)

Error thrown when chain id does not have a set LZ eid

UnknownChainByEID

error UnknownChainByEID(uint32 eid)

Error thrown when LZ eid does not have a registered chain id

WrongChainIdentifier

error WrongChainIdentifier()

Error thrown when chain id or LZ eid is zero

ChainMappingAlreadyExists

error ChainMappingAlreadyExists()

Error thrown when chain id or LZ eid are already registered

ChainMappingAdded

event ChainMappingAdded(uint32 chainId, uint32 eid)

Event emitted when a chain id and LZ eid are registered

ChainMappingRemoved

event ChainMappingRemoved(uint32 chainId)

Event emitted when a chain id and LZ eid are removed

addChainMapping

function addChainMapping(uint32 chainId, uint32 eid) external

Adds a chain id and LZ eid mapping

Parameters

NameTypeDescription
chainIduint32Chain id to map
eiduint32LZ eid to map

removeChainMapping

function removeChainMapping(uint32 chainId) external

Removes a chain id and LZ eid mapping

Parameters

NameTypeDescription
chainIduint32Chain id to remove

_chainid2eid

function _chainid2eid(uint32 chainId) internal view returns (uint32 eid)

Retrieves LZ eid for a chain id

Parameters

NameTypeDescription
chainIduint32Chain id to retrieve LZ eid for

Return Values

NameTypeDescription
eiduint32LZ eid for the chain id

_eid2chainid

function _eid2chainid(uint32 eid) internal view returns (uint32 chainId)

Retrieves chain id for a LZ eid

Parameters

NameTypeDescription
eiduint32LZ eid to retrieve chain id for

Return Values

NameTypeDescription
chainIduint32Chain id for the LZ eid

On this page