LogoLogo
  • Introduction
    • What We Do
  • The DeFi Problem
  • How iLayer solves it
  • Use Cases
  • Architecture
    • RFQ
  • Hub & Spoke
    • OrderHub
    • OrderSpoke
  • Router
    • LayerZero Router
    • Axelar Router
    • NullRouter
    • AxLzRouter
  • Solvers
  • Integration
    • Industries
    • EVM Smart contracts
      • Example: cross-chain LPing on Aave
      • Example: cross-chain contract call
  • Audit
Powered by GitBook
On this page
Export as PDF
  1. Router

LayerZero Router

PreviousRouterNextAxelar Router

Last updated 24 days ago

This LzRouter contract is a LayerZero-powered implementation of the Router contract that lets users send and receive arbitrary payloads across supported chains. It extends LayerZero’s OApp base to:

  1. Map between standardised chain IDs and LayerZero EIDs

  2. Send messages via LayerZero (using the option Bridge.LAYERZERO)

  3. Estimate the native fee required for a given cross-chain call

  4. Receive incoming LayerZero messages and dispatch them to a target contract Implementing a onMessageReceived hook


Events

Event
Parameters
Description

LzEidUpdated

uint32 indexed chainId uint32 indexed lzEid

Emitted whenever the owner sets or updates the mapping for a chain’s LayerZero EID.

MessageRoutedLz

MessagingReceipt msg

Emitted after successfully sending a LayerZero message; includes the LayerZero receipt.


Errors

Error
When It’s Thrown

UnsupportedLzChain()

In _sendWithLz, if no LayerZero EID has been configured for the target chainId.

UnsupportedBridgingRoute()

In send(), if the caller specifies any bridge other than Bridge.LAYERZERO.