On this page

LayerZero

Each chain has one router OApp. Asset OFTs are IOFT-compatible facades; the router sends LayerZero packets.

Routes

A route is the router-to-router pathway between two chains. Every route is fixed at launch and never changes:

  • Verification: five DVNs, any three of which verify a message. No delegate, no upgrades, and LayerZero default changes do not apply.
  • Rescue: if DVNs stop verifying, Omnisea can set how many of the same five must verify inbound messages on that route, from 1 up to 3 (setRouteThreshold, emits RouteThresholdSet). It cannot add, remove or replace DVNs, or require more than 3.
  • Activation: a route carries an asset only after it has been frozen for ROUTE_ACTIVATION_DELAY (5 minutes) before the asset trusted it.
  • Permanence: peers and frozen routes cannot be changed or removed.

Check a route before you rely on it:

const read = (functionName, args) =>
  sourceClient.readContract({ address: router, abi: routerAbi, functionName, args });

const frozenAt = await read("routeFrozenAt", [dstEid]);           // 0n: route not usable
const configHash = await read("routeConfigHash", [dstEid]);       // launch hash, or the one in the latest RouteThresholdSet
const enabled = await read("isChainEnabled", [assetId, dstEid]);  // this asset may use the route

If a route stops delivering (its DVNs stop verifying), use another chain as a detour. See Route outages.

Execution options

Pass extraOptions = 0x for a plain transfer. The router adds the destination gas itself, including the extra gas for a first transfer that deploys the asset, and any receive value the destination needs. Only add options for compose.

Quotes already include this gas. If you need the number for a transfer, read receiveGas(assetId, eid, gasType); for a sync, use the Lens quoteSync. Do not hard-code it. Defaults:

MessagegasTypeDestination gas
Transfer0300,000
Transfer that deploys the asset11,100,000
Sync21,100,000 + 75,000 per listed enabled chain
Owner action3350,000

Compliance assets add COMPLIANCE_RECEIVE_GAS to transfers and restores.

Compose

Set to to the destination composer and supply composeMsg. The destination facade queues the standard OFT compose envelope after credit. Authenticate the local facade, not just the router, in a composer and validate the original sender and payload. Compose execution is separate from transfer delivery.

Wire format

The descriptor and protocol messages use the strict packed format in solidity-v2/spec/WIRE_FORMAT.md. They are not abi.encode tuples. Integers are big-endian and identities are bytes32. Future non-EVM implementations must match the published vectors.