RAWR! Stomp through the blockchain jungle like a prehistoric beast! π¦
A fun, T-rex themed cross-chain bridge enabling swaps between Avalanche L1s and external blockchains using Avlanche's ICM, Avalanche's ICTT and Chainlink's CCIP.
T-rex enables seamless token swapping between different blockchain networks:
- Avalanche L1s (Dispatch, Echo) using ICM/ICTT
- Avalanche C-Chain (Fuji) using both ICM/ICTT and CCIP
- External Chains (Ethereum Sepolia, Polygon Amoy) via CCIP
For a technical overview on how the multi-hop cross-chain swapping is being enabled read the src README.md
srcfolder contains the smart contracts that enable to perform the cross-chain swappingfrontendfolder contains all the frontend fileschainlink_deployedcontractsfolder contains chainlink contracts that perfom token and data transfers on the same transactions which are the basis for understanding how to implement ccip logic for the multi-hop cross-chain swappinglibfolder contains contract's dependencies that came in as handy when we had problems using forget-rex_graveyardfolder is a fun place to explore previous ideas we developed and files we just felt attached too to
# Clone and setup
git clone <repository>
cd londonhackathon
# Install frontend dependencies
cd frontend
npm install
# Start development server
npm run dev- URL: http://localhost:3001 (or next available port)
- Default Route: Dispatch β Polygon Amoy
- Default Tokens: DIS β MATIC
Get test tokens from faucets:
- Dispatch: https://test.core.app/tools/testnet-faucet/?subnet=dispatch&token=dispatch
- Echo: https://test.core.app/tools/testnet-faucet/?subnet=echo&token=echo
- Sepolia: https://faucets.chain.link/sepolia
- Polygon Amoy: https://faucet.polygon.technology/
- T-rex Swap Header with prehistoric branding
- From/To Selectors: "T-rex starts here" β "T-rex destination"
- Feed Input: "π Feed me!" placeholder
- Route Display: Shows Teleporter, CCIP, or Hybrid routes
- Green Theme: Matches jungle aesthetic
- Cave Icon: ποΈ represents T-rex habitat
- Connect State: Shows wallet address with cave branding
- Cost Breakdown: Gas, Bridge, Protocol fees
- Mock Data Badge: "π¦ Mock" indicator
- Confidence Levels: High/Medium/Low based on trade parameters
- Teleporter: Avalanche L1 β L1 (fastest)
- CCIP: External β External (standard)
- Hybrid Route: L1 β External (multi-hop)
- CCIP + Teleporter: External β L1 (complex)
frontend/
βββ pages/
β βββ index.tsx # Main T-rex interface
β βββ _app.tsx # Wallet providers
βββ src/
β βββ components/
β β βββ SwapInterface.tsx # Main swap component
β β βββ WalletConnect.tsx # Cave-themed wallet
β β βββ ChainSelector.tsx # Network selection
β β βββ TokenSelector.tsx # Token selection
β βββ constants/
β β βββ chains.ts # 4 supported networks
β β βββ tokens.ts # Token configurations
β βββ utils/
β β βββ contracts.ts # Mock pricing engine
β β βββ wallet.ts # Wallet management
β βββ styles/
β βββ globals.css # Jungle theme CSS
- Color Palette: Green/Emerald/Teal gradients
- Background:
from-green-900 via-emerald-900 to-teal-900 - Components: Green focus states, borders, buttons
- Animations: Jungle-themed pulse and shimmer effects
// Real market prices (January 2025)
const REAL_TOKEN_PRICES = {
DIS: 0.0075, // Dispatch token
ECHO: 0.012, // Echo token
ETH: 2500, // Ethereum
MATIC: 0.35, // Polygon
AVAX: 22.80, // Avalanche
USDC: 1.00, // Stablecoin
LINK: 15.30 // Chainlink
};# Frontend environment (.env.local)
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_project_id
NEXT_PUBLIC_ENVIRONMENT=development- From Chain: Dispatch (Avalanche L1)
- To Chain: Polygon Amoy (External)
- Slippage: 0.5% default
- Mock Data: Always enabled for demo
- T-rex Branding: Immediate prehistoric theme
- Jungle Background: Subtle T-rex silhouettes
- Default Setup: Ready to swap Dispatch β Amoy
- Cave Theme: ποΈ Connect Wallet button
- Green Styling: Matches jungle aesthetic
- Status Display: Shows connected address with cave icon
- Feed the T-rex: Enter amount to "feed" the beast
- Route Calculation: T-rex "thinks" and calculates best path
- Cost Display: "T-rex Feeding Costs" breakdown
- Execution: "π¦ RAWR! Execute Swap" button
- Calculating: "π¦ T-rex is calculating..."
- Processing: "π¦ T-rex is stomping..."
- Thinking: "π¦ T-rex is thinking..."
- T-rex Themed UI with jungle aesthetics
- 4 Testnet Support (Dispatch, Echo, Sepolia, Amoy)
- Realistic Mock Pricing based on real market data
- Dynamic Fee Calculation with proper slippage
- Route Type Detection (Teleporter/CCIP/Hybrid)
- Cave-themed Wallet connection
- Responsive Design for all screen sizes
- Real Price Feeds: Current market values
- Dynamic Slippage: 0.1% - 3% based on conditions
- Realistic Fees: Chain-specific gas costs
- Time Estimates: Route complexity based
- Confidence Scoring: Trade size and route dependent
- Update
frontend/src/constants/chains.ts - Add to
SUPPORTED_CHAINSobject - Configure in wagmi providers
- Modify
frontend/src/styles/globals.css - Update color variables and animations
- Add new T-rex themed components
- Edit
frontend/src/utils/contracts.ts - Update
REAL_TOKEN_PRICESobject - Modify fee calculation logic
- Background Elements: Subtle T-rex silhouettes
- Loading Messages: Prehistoric themed states
- Error Handling: "T-rex is confused!" messages
- Button Text: "Wake up T-rex!" and "RAWR! Execute"
- Input Placeholders: "π Feed me!" for amounts
- Mobile Optimized: Works on all screen sizes
- Touch Friendly: Large buttons and inputs
- Compact Layout: Efficient use of space
- Jungle Theme: Consistent across devices
- Start Server:
cd frontend && npm run dev - Open Browser: Navigate to http://localhost:3001
- Connect Wallet: Click cave-themed connect button
- Feed T-rex: Enter amount in "π Feed me!" input
- Watch Magic: See realistic pricing calculations
- Execute Swap: Click "π¦ RAWR! Execute Swap"
π¦ Built for London Hackathon 2025 Stomp through the blockchain jungle with prehistoric power! πΏπ¦