
1millimeter
1Millimeter Exchange is a cross chain swap platform for Ethereum to ICP swaps.
Demo
About
1 millimeter Exchange is a web-based cross-chain DEX that lets anyone swap assets between Ethereum Holesky and the Internet Computer in a single click. Powered by 1inch Fusion+ intents, an on-chain ICP ↔ ETH bridge and atomic HTLC escrow, every swap is permissionless, MEV-protected and either completes or fully reverts. The frontend is a lightweight React dApp—connect MetaMask, confirm, done.
How it's made
# 1 millimeter Exchange – Technical Deep-Dive ## Project Goal Provide a seamless, trust-minimised bridge for value between Ethereum (Holesky) and the Internet Computer. The user experience must resemble a single-chain swap: connect MetaMask, sign once, and watch funds arrive on the other chain without juggling RPCs or bridges. ## Tech Stack | Layer | Technology | Purpose | |-------|------------|---------| | **Smart Contracts** | Solidity 0.8.x | Escrow, Hash-Time-Lock, Fusion Resolver, ICP Bridge contracts | | | Motoko / Rust canisters | ICP-side resolver & ledger interactions | | **Intents** | 1inch Fusion+ | MEV-proof limit-order execution on the ETH side | | **Relayer** | Node 18, ethers.js, @dfinity/agent | Listens for escrow events, forwards proofs cross-chain, triggers ICP canisters | | **Frontend** | React 18, Vite, TailwindCSS | Single-page dApp with wallet hooks | | | canvas-confetti | Visual confirmation burst on swap completion | | | react-icons | Chain & token glyphs | ## Deployment Targets • Ethereum **Holesky** test-net (verified source code) • Internet Computer main network (canister IDs baked into build) ## Scripts / Tooling - **generate-config.sh** – bootstraps every `.env` from one prompt - **deploy-holesky.sh** – Foundry script deploying all ETH contracts and writing addresses to disk - **verify-deployment.sh** – Hardhat + Etherscan API verification helper - **monitor-system.sh** – bash script hitting health endpoints (relayer & RPC status) ## Key Features 1. **Intent-Based Swaps** – users post intents executed by off-chain solvers; the Fusion Resolver enforces price and deadline on-chain. 2. **HTLC Safety Net** – both sides must reveal the same secret within their time-lock window; otherwise funds automatically refund. 3. **Progress Overlay** – centre-screen modal shows staged messages (sign → swapping → almost done → success tick). 4. **Token Lore & Onboarding Panels** – gamified educational panels flanking the swap UI. ## Challenges & Solutions | Challenge | Solution | |-----------|----------| | Bridging two execution environments (EVM vs IC) | Lightweight relayer using @dfinity/agent to sign ingress messages and submit proofs back to ETH. | | Preserving UX despite cross-chain latency | 10-second staged overlay keeps the user informed while the relayer completes the remote leg. | | MEV protection on L2 test-net | Leveraged 1inch Fusion+ Dutch-auction intents which are natively resistant to sandwich attacks. | | Handling two wallet paradigms | MetaMask for ETH, Internet Identity for ICP, stitched together with a shared React context so components can query `ethConnected` / `icpConnected`. | | Gas optimisation | Foundry benchmarks drove inline assembly in the resolver, achieving < 190 k gas per swap intent fulfilment. | ## Future Work - Multi-hop routing (e.g. Holesky → Base → ICP) - Zero-knowledge proofs replacing HTLCs for lower latency - Mobile wallet deep-links & WalletConnect 2.0 --- © 2024 1 millimeter Labs