Cross-chain Fusion+ swaps with partial fills using escrow contracts on Non-EVM and EVM
This project is a mechanism for swapping tokens atomically between two independent blockchains—Sui (using Move smart contracts) and Ethereum (using Solidity contracts) following the 1inch Fusion+ documentation. It uses Hashed Timelock Contracts (HTLCs) to ensure that either both parts of the swap happen or neither does.
HTLC Contracts
1 ) On Sui (Move): --> escrow_factory for single fill swap : Handles create_src_escrow, create_dst_escrow, redeem, and refund. Emits events and enforces timelocks. --> escrow_factory for partial fill swap: Handles create_src_escrow, place_order, fill_order, create_dst_escrow, redeem, and refund. Emits events and enforces timelocks. --> Events such as SrcEscrowCreated, DstEscrowCreated, Redeemed, and Refunded are emitted to allow off-chain services to watch for on-chain activity.
Off-Chain Relayer: A small off-chain service (written in Nodejs and using Supabase for storing the secret and other data ) performs the following:
--> Listens to events on both the Sui and Ethereum blockchains. --> Acts as the mediator between the User and the Resolvers --> When it sees that the escrow is created on Source and Destination, it reveals the secret to the resolvers.
Swap Lifecycle
--> The Maker (Alice) on Sui chooses a random secret s and computes the hash h = keccak_256(s), then creates the order and signs it and send it to the relayer . --> The relayer announces the order to all the resolvers. --> Resolverthen calls create_src_escrow(h, amount, timelock_A) to lock Source tokens and calls create_dst_escrow() on the destination chain and funds it. --> The Relayer detects the both events and reveals the secret to resolves. --> The Resolver redeems on Source with the preimage s, which becomes public. Using this secret, the resolver then calls Resolver.redeem(h, s) on Destination. This releases the mock USDC tokens to Alice’s Destination address.
Refund Paths (If Something Goes Wrong)
--> If the resolver never fund Destination escrow before timelock_B expires, Alice can call refund_src_escrow(h) on Source after timelock_A.
We built a cross-chain HTLC protocol integrating Ethereum and Sui. Ethereum contracts were written in Solidity, and Sui logic in Move. For coordination, a custom relayer observes events on both chains and triggers actions accordingly.
We used Tenderly to fork Ethereum mainnet for realistic testing and for Sui we used the devnet, and Sui AI for contract assistance on the Sui side, which sped up development. A minimal React interface communicates directly with both chains via RPC.
Notably, we bypassed full backend infrastructure by embedding logic into the frontend and using Supabase for event caching—a hacky yet effective move for a hackathon timeline.