🚀 True Gasless Cross-Chain Swaps between Ethereum and Aptos using the Fusion+ protocol.
✨ Users pay ZERO gas fees - Just sign transactions, resolver covers all gas costs!
# From root directory
npm install
# Install backend dependencies
cd backend/order-engine && npm install && cd ../..
cd backend/resolver && npm install && cd ../..
# Install frontend dependencies
cd frontend && npm install && cd ..
# Install contract dependencies
cd contracts/ethereum && npm install && cd ../..# Test Ethereum contracts
cd contracts/ethereum
npx hardhat test
# Test Aptos contracts
cd contracts/aptos
aptos move test --named-addresses fusion_plus=0xCAFEcd backend/order-engine
npm testYou'll need 3 terminal windows:
Terminal 1 - Order Engine Backend:
cd backend/order-engine
npm run dev
# Should see: "Order engine server running on port 3001"Terminal 2 - Frontend:
cd frontend
npm start
# Opens http://localhost:3000Terminal 3 - Test the API:
# Create a test order
curl -X POST http://localhost:3001/api/orders \
-H "Content-Type: application/json" \
-d '{
"fromChain": "ETHEREUM",
"toChain": "APTOS",
"fromToken": "0x0000000000000000000000000000000000000000",
"toToken": "0x0000000000000000000000000000000000000000",
"fromAmount": "1000000000000000",
"minToAmount": "100000000",
"maker": "0x742d35Cc6634C0532925a3b844Bc9e7595f00000",
"receiver": "0x742d35Cc6634C0532925a3b844Bc9e7595f00000",
"deadline": 1999999999,
"nonce": "123456",
"partialFillAllowed": false,
"signature": "0x00"
}'
# Get all orders
curl http://localhost:3001/api/orders
# Get specific order (replace ORDER_ID)
curl http://localhost:3001/api/orders/ORDER_ID- Open http://localhost:3000
- Connect MetaMask (Sepolia testnet)
- Connect Petra wallet (Aptos testnet)
- Create a swap order
- Monitor order status in the Order History section
🚀 Experience true gasless swaps:
- Get WETH: Wrap some ETH to WETH on Sepolia
- One-Time Setup: Approve WETH to gasless escrow (pays gas once)
- Gasless Forever: All future swaps are gasless!
- Select WETH → APT
- Sign meta-transaction (no gas)
- Receive APT automatically
- Monitor Progress: Watch real-time swap execution with zero fees
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ │ │ │ │ │
│ Ethereum │ │ Order Engine │ │ Aptos │
│ Escrow │◄────┤ (Off-chain) ├────►│ Escrow │
│ Contract │ │ │ │ Module │
│ │ └────────┬────────┘ │ │
└─────────────────┘ │ └─────────────────┘
│
┌────────▼────────┐
│ │
│ Resolver │
│ (Relayer) │
│ │
└─────────────────┘
- Zero Gas Fees: Users pay no gas after one-time WETH approval
- Meta-Transactions: EIP-712 signatures enable gasless WETH transfers
- Production Ready: Deployed and tested on Sepolia + Aptos Testnet
- Hashlock/Timelock: Cryptographic guarantees for cross-chain safety
- Trustless: No custody risk, funds locked in smart contracts
- Resolver Incentives: Safety deposits ensure completion
- WETH → APT: Gasless swaps using meta-transactions
- APT → WETH: Sponsored transactions on Aptos
- Bidirectional: Full support for both swap directions
- One-Click Approval: Approve WETH once, swap forever gaslessly
- Real-Time Updates: Live swap progress with asset flow tracking
- Auto-Complete: Resolver handles all on-chain execution
- Regular Escrow:
0x5Ea57C2Fb5f054E9bdBdb3449135f823439E1338 - Gasless Escrow:
0x4868C055E894f6C774960a175aD11Dec26f8475f✨ - WETH Token:
0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14
- Escrow Module:
0x9835a69eb93fd4d86c975429a511ed3b2900becbcbb4258f7da57cc253ab9fca
📚 Detailed Guides:
- Gasless WETH Swaps - Complete technical implementation
- Deployment Summary - Contract deployment details
- Testing Scripts - Utilities for testing gasless functionality
🔧 Smart Contracts:
- FusionPlusGaslessEscrow.sol - Gasless escrow with meta-transactions
- Aptos Escrow Module - Cross-chain escrow on Aptos
The system includes development mode signatures that bypass full validation for testing. In production, proper signature validation must be implemented.
- CORS errors: Ensure backend is running before frontend
- Connection issues: Check you're on correct networks (Sepolia/Aptos Testnet)
- Order creation fails: Check browser console for detailed errors
- WebSocket not connecting: Verify order engine is running on port 3001
- "Gasless swaps require WETH approval": Approve WETH to gasless escrow contract first
- Meta-transaction fails: Check WETH balance and allowance using debug scripts
- Escrow not found: Ensure Aptos escrow module is deployed correctly
- Signature errors: Confirm MetaMask is connected and on Sepolia testnet
# Check WETH approval status
node scripts/check-weth-approval-gasless.js
# Test gasless functionality
node scripts/test-gasless-weth.js
# Decode failed transactions
node scripts/decode-gasless-tx.js