Sui Extension
A sui 1inch Fusion+ Extension for make atomic cross chain swaps between Sui and Ethereum
Problem Statement
smart contracts for Hash Time-Locked Contracts (HTLCs) in Move for the Sui Blockchain, demonstrating 1inch Fusion+ swaps from Ethereum to Move. We used the cross-chain-resolver example as base, and used the HTLC contract for atomic cross chain swaps.We used Next and Pnpm and Move
Solution
This is a cross-chain atomic swap solution that extends 1inch Fusion+ to support swaps between Ethereum and Sui blockchains. The project demonstrates how to implement secure, trustless cross-chain transactions using Hash Time-Locked Contracts (HTLCs) in Move.Frontend: Next.js 14 application with modern UI components (Shadcn UI + Tailwind CSS) that provides a seamless user experience for cross-chain swaps. Users can connect both MetaMask (Ethereum) and Sui Wallet to initiate swaps.Smart Contracts:Ethereum: Solidity escrow contracts using the 1inch Cross-Chain SDK with resolver patterns for automated executionSui: Move language HTLC contracts (oneinch_movemodule) that handle lock/unlock mechanisms with time-based constraintsKey Technical FeaturesAtomic Swap Security: Uses cryptographic secrets and hash locks to ensure either both sides of the swap complete or both failCross-Chain Communication: Bypasses 1inch SDK chain validation limitations while maintaining security guaranteesDual Wallet Integration: Seamless integration with both Ethereum (Wagmi/Viem) and Sui (Sui TypeScript SDK) walletsReal-time Tracking: Complete order lifecycle monitoring with status updates and transaction confirmationsMock Fusion+ API: Realistic simulation of 1inch Fusion+ endpoints with proper timing, cryptographic operations, and state managementSwap Flow ProcessPhase 1: Quote generation and EIP-712 order creation with cryptographic secret generationPhase 2: Escrow deployment on both chains with safety deposits and timelock mechanismsPhase 3: Secret revelation and atomic claim/withdrawal process ensuring trustless execution