Twin Documentation
  • Overview
  • Consumer
  • Developer
  • Operations
Arquitectura
    Backend ArchitectureDashboard ArchitecturePlatform ArchitectureBridge Contracts Architecture
Flujos Técnicos
Base de Datos
Local SetupConventions
powered by Zudoku
Arquitectura

Platform Architecture

React 19 + MUI + wagmi + RainbowKit user-facing application. Built with Vite. Provides wallet connectivity for bridging, minting, redeeming, swapping, and token migration.

Tech Stack

  • React 19 with TypeScript
  • Material UI (MUI) for components and theming
  • wagmi + RainbowKit for wallet connectivity
  • Vite bundler
  • Google Analytics (G-M59KE7VL17)

Pages

PagePathDescription
Explore/exploreBrowse available tokenized assets
Portfolio/portfolioView connected wallet's holdings
Assets/assetsAsset detail pages with market data
Swap/swapToken swaps via DEX integration
Bridge/bridgeCross-chain bridging (Base <-> Polygon)
Migration/migrationLegacy token migration (nARS/nBRL/nMEX to ARGt/BRAt/MEXt)
Mint/mintMint new tokens (institutional)
Redeem/redeemRedeem tokens for underlying value
Disperse/disperseBatch-send tokens to multiple recipients
Login/loginCollaborator authentication

Supported Chains

ChainChain IDUsage
Base8453Primary chain for all tokens
Polygon137Secondary chain (ARGT bridged)

Migration State Machine

The /migration page implements a two-step migration flow for converting legacy tokens to their new versions via the TwinMigrationNum contract on Base.

The UI uses a horizontal Stepper showing "Paso N de 2" with contextual hint text. The confirm dialog is irreversible -- migration tokens cannot be converted back.

Migration pairs:

  • nARS -> ARGt
  • nBRL -> BRAt
  • nMEX -> MEXt

Pairs that are not yet enabled on the contract display "aun no esta habilitada" (the contract does not have an activatePair function).

Market Data Flow

Token prices come from the on-chain oracle contract. Fiat conversion rates (ARS, BRL, MXN) come from external APIs. The backend aggregates both and serves them via the platform API.

Responsive Design

  • All pages use MUI's Grid and Stack for responsive layout
  • Mobile breakpoint handling via useMediaQuery
  • Bottom navigation on mobile replaces sidebar
  • Wallet connect modal is full-screen on small viewports

Environment Variables

VariableDescription
VITE_API_URLBackend platform API URL
VITE_WALLET_CONNECT_PROJECT_IDWalletConnect Cloud project ID (build-time)
Last modified on April 29, 2026
Dashboard ArchitectureBridge Contracts Architecture
On this page
  • Tech Stack
  • Pages
  • Supported Chains
  • Migration State Machine
  • Market Data Flow
  • Responsive Design
  • Environment Variables