
fusion+monad
A 1inch Fusion+ bridge for trustless USDC swaps using a gas-efficient factory pattern.
Demo
About
## Project Description **Fusion Artery** is a production-aligned, trustless, and bidirectional atomic swap bridge connecting the **Ethereum Sepolia** and **Monad** testnets. Built for the **1inch Fusion+ bounty**, our project enables the seamless and secure transfer of **USDC** between these two cutting-edge EVM-compatible ecosystems. Our core mission was not just to build a bridge, but to build it the right way. We have meticulously replicated the sophisticated, gas-efficient factory pattern used in the 1inch production protocol, demonstrating a deep understanding of the architecture required for secure and scalable cross-chain infrastructure. --- ## The Problem: Liquidity Fragmentation In the emerging multi-chain world, liquidity is fragmented across diverse blockchain networks. A user with assets on a next-gen chain like **Monad** has no direct, trustless way to deploy that capital on Ethereum without relying on centralized or custodial solutions. This fragmentation leads to inefficiencies, lost opportunities, and security risks. Existing bridges often suffer from: * Custodial intermediaries * Monolithic, inflexible designs * Poor developer experience and user trust --- ## Our Solution: A Trustless "Unique Lockbox" System **Fusion Artery** offers a secure, **non-custodial**, and **atomic** pathway for value transfer. A user can initiate a swap of USDC on one chain (e.g., Ethereum Sepolia) and receive the equivalent on the other chain (Monad) **atomically**, or have the operation revert entirely if incomplete — no third party holds custody at any point. The entire system is governed by smart contracts and an automated off-chain resolver to ensure full safety and transparency. --- ## System Components ### 1. On-Chain Smart Contract Architecture (The Foundation) Instead of a monolithic design, we adopted the **factory + proxy pattern** as used by 1inch — a modular and gas-efficient approach. * **EscrowFactory.sol** Deployed once per chain (Ethereum Sepolia and Monad). It creates lightweight **EIP-1167 clones** of the escrow contract, acting like a "Lockbox Company" that issues secure, isolated lockboxes for each swap. * **Escrow\.sol** The master HTLC (Hashed Timelock Contract) implementation that governs atomicity. It enforces that funds are released **only** with a valid secret or refunded after a time-lock expiry. All clones delegate logic to this blueprint. * **MockUSDC.sol** A standard ERC20 contract deployed on both chains to simulate a realistic, controlled bridging environment. --- ### 2. The Off-Chain Resolver (The Automated Heart) A stateless, fault-tolerant **Node.js** service written in **TypeScript** that operates the bridge logic in an automated, non-custodial manner. * **Stateless & Resilient**: Powered by **viem**, it predicts clone addresses using deterministic logic, avoiding the need for a database or centralized state. * **Event-Driven Automation**: Listens for `NewEscrow` events on Ethereum Sepolia and Monad. Upon detection, it deploys the corresponding escrow contract on the destination chain. When the user completes the withdrawal, revealing the secret, the resolver completes the atomic swap by claiming the original funds. --- ### 3. The Frontend dApp (The Human Layer) Built using **Next.js**, **wagmi**, and **viem**, the dApp abstracts away complexity and delivers a smooth user experience. * **Wallet Connection & Swap UI**: Users connect wallets, enter the USDC amount, and follow a simple flow — approve and initiate. * **Live Swap Tracking**: The dApp tracks the progress in real-time with explorer links, making it transparent and intuitive for users. --- ## Key Technical Highlights & Features * **Production-Aligned Architecture**: We implemented the same advanced factory pattern used by 1inch in production. * **Gas Efficiency**: Minimal deployment costs using **EIP-1167** proxies and immutable variables. * **Stateless Resolver**: Fully restartable and resilient with zero reliance on stateful tracking. * **Modern Type-Safe Stack**: TypeScript, Hardhat, viem — ensuring strong typing, fast iteration, and maintainability. * **Full Bidirectionality**: The bridge supports swaps from **Ethereum Sepolia to Monad** and **Monad to Ethereum Sepolia** — atomic in both directions. --- ## Future Vision This hackathon project lays the groundwork for a **secure, modular, and extensible cross-chain USDC bridge**. Future enhancements will include: * Supporting **any ERC20 token** with generalized factory deployment. * Expanding support to **more EVM-compatible chains** (e.g., Base, Linea, Polygon zkEVM). * Introducing a **decentralized resolver network** to eliminate off-chain trust and maximize uptime. * Optimizing for **Monad's high-throughput environment** with even leaner gas usage and faster finality.
How it's made
Of course. This is the perfect place to showcase your technical decisions and problem-solving process. Here’s a detailed, nitty-gritty breakdown of how the project was built, designed for the hackathon judges. How We Built This: The Nitty-Gritty Details Our core philosophy for this hackathon was "Production-Aligned Prototyping." We didn't want to just build something that worked; we wanted to build a scaled-down version of a system that could work in production. This meant studying the 1inch team's own architecture and adapting its core principles to a 48-hour timeline. The Technology Stack We chose a modern, robust, and type-safe stack to maximize development speed and minimize runtime errors. Smart Contracts: Solidity (^0.8.20): The industry standard. We used modern features like immutable state variables for significant gas savings on our Escrow clones. Hardhat: Our development environment of choice. We leveraged its powerful scripting and testing environment, and especially the hardhat-deploy plugin for managing our multi-contract deployments across both Sepolia and Arbitrum Sepolia in a repeatable, deterministic way. OpenZeppelin Contracts: We used the industry-standard Clones library for our gas-efficient EIP-1167 proxy deployments and the ERC20 implementation for our MockUSDC. There's no reason to reinvent the wheel when secure, audited components are available. Off-Chain Resolver: Node.js & TypeScript: For a robust, type-safe backend service. Viem: We chose Viem over Ethers.js for its modern, lightweight design, tree-shakable modules, and excellent TypeScript support. It made handling event logs and interacting with contracts incredibly clean and predictable. Express.js: While the resolver is primarily a background service, we wrapped it in a minimal Express server to provide a simple / health-check endpoint. This makes it easy to verify that the service is running.