Twin Documentation
  • Overview
  • Consumer
  • Developer
  • Operations
Dashboard Guide
    Cron JobsMinteo (Minting)Circulacion (Circulation)Uniswap PoolsBridge AdminRewardsSeguimiento de Circulante (Balance Tracking)Oracle Wallets (Configuración)Tokens (CRUD)
Deploy
MonitoringContracts & AddressesTroubleshooting
powered by Zudoku
Dashboard Guide

Bridge Admin

The bridge allows cross-chain transfers of Twin tokens using LayerZero V2 OFT adapters.

Access Paths

  • Operations > Bridge -- Operational view: execute bridge transfers (Admin + Operations roles)
  • Configuracion > Bridge -- Configuration view: manage bridge routes (Admin only)

Route Configuration

Each bridge route is stored in the bridge_route table with the following fields:

FieldDescription
bridge_token_keyGroups routes for the same conceptual token (e.g., ARGT). Auto-uppercased.
ops_token_idFK to ops_token -- the specific token on this network
networkNetwork where this route operates (BASE, POLYGON, etc.)
adapter_addressOFT adapter contract address on this network
lz_eidLayerZero endpoint ID for this network (Base: 30184, Polygon: 30109)

The table has a partial unique index (bridge_token_key, network) WHERE deleted_at IS NULL to prevent duplicate active routes for the same token on the same network while supporting soft-delete.

Why bridge_token_key? The ops_token table has one row per (address, network). The bridge thinks in terms of "ARGT" across chains, not "ARGT@Base + ARGT@Polygon". The bridge_token_key groups these together.

Operating the Bridge

Steps

  1. Connect wallet via RainbowKit (ConnectButton in the top bar).
  2. Select token from available bridgeable tokens (grouped by bridge_token_key).
  3. Select destination network from available routes for that token.
  4. Enter amount to bridge.
  5. Quote -- the frontend calls LayerZero's quoteSend to get the native fee estimate.
  6. Approve -- if the adapter needs ERC20 allowance, approve first.
  7. Send -- execute the bridge transaction via the connected wallet.

Flow

Code
User connects wallet | v Select token + destination | v Enter amount --> quoteSend() --> display fee | v Approve (if needed) --> send() --> TX submitted | v recordBridgeTransaction (non-blocking) | v TX appears in history table

TX History

Bridge transactions are stored in the bridge_transaction table with: token, amount, source network, destination network, sender address, TX hash, LayerZero message ID, and status.

Notes

  • Wallet-path only in this iteration. Safe wallets and EOA wallets are supported via WalletConnect/RainbowKit. BitGo path (constructing calldata via encodeFunctionData and sending through BitGo Express) is a planned follow-up.
  • useWaitForTransactionReceipt is NOT used because Safe multisig wallets return a safeTxHash that does not appear on-chain until the signing threshold is met.
  • useSwitchChain() is NOT used because Safe wallets do not support wallet_switchEthereumChain. An Alert is shown asking the user to connect on the correct network.
  • recordBridgeTransaction is non-blocking: if the record call fails after the bridge TX is already sent on-chain, it logs a warning but does not throw. The TX already happened and cannot be undone.
  • Bridge hooks (use-bridge.ts) are parametrized -- token address, adapter address, and chain ID are passed as arguments, not hardcoded constants.
Last modified on May 12, 2026
Uniswap PoolsRewards
On this page
  • Access Paths
  • Route Configuration
  • Operating the Bridge
    • Steps
    • Flow
  • TX History
  • Notes