crossr
Build on crossr

Bridging

  • TokenBridge.quoteSend(dstEid, token, to, amount, options) gives the LayerZero fee; send(...) with that fee as msg.value burns the tokens and emits BridgeSent(guid, …).
  • dstEid is the LayerZero endpoint id, not the chain id: use chainMeta(chainId).lzEid. Options: lzReceiveOptions(BRIDGE_RECEIVE_GAS). No approval needed, the bridge is the token's burn authority.
  • The destination emits BridgeReceived(guid, token, to, srcEid, amount) with the same guid; the indexer stores both halves in bridge_transfers.