Skip to main content

System Architecture

Omni.fun is a hub-and-spoke architecture with Base as the home chain and 7 remote chains connected via LayerZero V2 messaging and Across Protocol bridging. Every cross-chain operation ultimately settles on Base, where the bonding curves and Uniswap V3 pools live.

High-Level Topology

┌─────────────────────────────────────────────────────────┐
│                    BASE (Home Chain)                      │
│                                                           │
│  OmniLaunchFactory ──→ LaunchToken + BondingCurve        │
│  CCBuyerV3         ←── LZ _lzReceive() ← remote buys    │
│  CrossChainSellerV3 ←── LZ _lzReceive() ← remote sells  │
│  AcrossSellHandler ←── LZ lzCompose() ← OFT compose     │
│  CrossChainLauncher ←── LZ _lzReceive() ← remote launch │
│  OFTFactory        ──→ LZ messages to 6 OFTFactoryRemote│
│  OFTAdapter        ←→ OFT lock/unlock (per token)        │
│                                                           │
│  Uniswap V3 ← graduation pool + post-grad trading        │
│  FeeOnlyVault ← permanent LP lock (no admin, no keys)    │
└─────────────┬───────────────────────────────┬─────────────┘
              │ LayerZero V2                  │ Across Protocol
              │ (OApp + OFT)                  │ (USDC settlement)
              ▼                               ▼
┌──────────────────────────────────────────────────────────┐
│              REMOTE CHAINS (7 EVM + Solana)               │
│                                                            │
│  EVM (Ethereum, Arbitrum, Optimism, Polygon, BSC, Avax):  │
│    AcrossBuyAdapter    → Across USDC deposit → buy Base   │
│    NativeBuyAdapter    → swap native→USDC → Across → buy  │
│    AcrossSellAdapter   → OFT bridge + LZ compose → sell   │
│    OFTFactoryRemote    → receives LZ → CREATE2 OmniOFT   │
│    RemoteLauncher      → LZ message → deploy on Base      │
│    OmniOFT             → burn/mint (LZ OFT standard)      │
│                                                            │
│  Solana:                                                   │
│    CC Buyer Program    → LZ message → buy on Base          │
│    CC Seller Program   → LZ message → sell on Base         │
│    OFT Program         → SPL token bridging via LZ         │
│    Token Launcher      → LZ message → launch on Base       │
└──────────────────────────────────────────────────────────┘

LayerZero Integration Points

Omni.fun uses LayerZero V2 through four distinct integration patterns. Each one uses _lzReceive() or lzCompose() as the entry point on Base.

1. Cross-Chain Buy (LZ OApp)

A user on any remote chain initiates a buy. The adapter encodes the buy parameters and sends an LZ message to CCBuyerV3 on Base.
Remote Chain                          Base
┌──────────────┐    LayerZero V2    ┌─────────────────┐
│ CC Buyer     │ ──── lzSend ────→ │ CCBuyerV3       │
│ (EVM or Sol) │                    │ _lzReceive()    │
└──────────────┘                    │   ↓ buyFor()    │
                                    │   ↓ OFT send()  │──→ tokens bridge
                                    └─────────────────┘    back to buyer
Key detail: After buying tokens on the bonding curve, CCBuyerV3 automatically bridges tokens back to the buyer’s origin chain via OFT send(). The buyer receives tokens on their home chain — not on Base.

2. Cross-Chain Sell (LZ OApp + Across)

A user burns their OFT tokens on a remote chain. The LZ message triggers a sell on Base, and USDC returns via Across Protocol.
Remote Chain                          Base
┌──────────────┐    LayerZero V2    ┌─────────────────────┐
│ OFT burn()   │ ──── lzSend ────→ │ CrossChainSellerV3  │
│ + sell msg   │                    │ _lzReceive()        │
└──────────────┘                    │   ↓ sellFor()       │
                                    │   ↓ Across deposit  │──→ USDC returns
                                    └─────────────────────┘    to seller
Key detail: The seller auto-detects whether the token is still on the bonding curve or has graduated to Uniswap V3, and routes accordingly. No user intervention needed.

3. Cross-Chain Launch (LZ OApp)

A user on BSC, Ethereum, or Solana launches a token that deploys on Base.
Remote Chain                          Base
┌──────────────┐    LayerZero V2    ┌─────────────────────┐
│ RemoteLauncher│ ──── lzSend ────→ │ CrossChainLauncher  │
│ or Token     │                    │ _lzReceive()        │
│ Launcher(Sol)│                    │   ↓ factory         │
└──────────────┘                    │     .launchFor()    │
                                    └─────────────────────┘
                                      ↓ deploys Token + Curve
Key detail: The Solana Token Launcher ABI-encodes the launch parameters in an Anchor program and sends them via LZ. The CrossChainLauncher on Base decodes and calls the factory — enabling cross-VM token launches from Solana to EVM.

4. OFT Factory Deployment (LZ OApp)

A single Base transaction deploys an OFTAdapter locally and sends LZ messages to 6 remote OFTFactoryRemote contracts, each of which CREATE2-deploys an OmniOFT.
Base                                  Remote Chains (×6)
┌──────────────┐    LayerZero V2    ┌─────────────────────┐
│ OFTFactory   │ ──── 6× lzSend ──→│ OFTFactoryRemote    │
│ deployOFT()  │                    │ _lzReceive()        │
│  ↓ adapter   │                    │   ↓ CREATE2 deploy  │
│  ↓ set peers │                    │   ↓ set peers       │
│  ↓ options   │                    │   ↓ enforced opts   │
└──────────────┘                    └─────────────────────┘
Key detail: OFTFactory predicts all 6 remote OFT addresses using CREATE2 determinism before sending the messages. This allows it to set bidirectional peers on the adapter in the same transaction. Total cost: ~$1.60 in LZ fees for 6-chain deployment.

LZ Configuration

All Omni.fun OFT deployments use the following LayerZero V2 configuration:
ParameterValueNotes
LZ Endpoint V20x1a44076050125825900e736c501f859c50fE728cSame on all EVM chains
ULN Confirmations10Increased from default 5 — required for cross-chain delivery
OFT Receive Gas65,000Enforced options on all OFT pairs
Message Type1 (SEND)Standard OFT send
Peer Formatbytes32(uint256(uint160(address)))Left-padded for EVM, raw 32 bytes for Solana
Solana Endpoint76y77prsiCMvXMjuoZ5VRrhG5qYBrUMYTE5WgHqgjEn6LZ Endpoint on Solana

Cross-Chain Routing Summary

ActionProtocol UsedLZ Message TypeSettlement
Buy from EVM (Across path)Across ProtocolNone (Across intent)Tokens on Base
Buy from EVM (CC Buy path)LayerZero V2_lzReceive() → OFT send()Tokens on origin chain
Buy from SolanaLayerZero V2_lzReceive() → OFT send()Tokens on Solana
Buy with native currencyAcross ProtocolNone (swap + Across)Tokens on Base
Sell from EVM (compose)LayerZero V2lzCompose() → AcrossUSDC on origin chain
Sell from EVM (LZ direct)LayerZero V2_lzReceive() → AcrossUSDC on origin chain
Sell from SolanaLayerZero V2_lzReceive() → AcrossUSDC on Solana
Bridge OFT tokensLayerZero V2OFT send() / lz_receiveTokens on destination
Launch from EVMLayerZero V2_lzReceive()Token + Curve on Base
Launch from SolanaLayerZero V2_lzReceive()Token + Curve on Base
Deploy OFTs (6 chains)LayerZero V2_lzReceive()OmniOFT on each chain
Every row with “LayerZero V2” generates LZ messages that flow through LayerZero’s DVN and executor infrastructure.