Extension of the 1inch Fusion+ to Ton the ton blockchain. Lets you swap to and from Ton
We built an extension of the 1inch Fusion+ protocol to the TON network. Our goal was to build the smoothest and most secure way to go to and from TON. This needed us to implement Hash Time Lock Contracts on the TON network and mirror that to work on the Ethereum side.
The project represents a comprehensive cross-chain bridge that brings TON into the 1inch ecosystem for the first time, enabling gasless swaps with MEV protection through Dutch auction mechanisms. We implemented a complete atomic swap infrastructure using Hash Time-Locked Contracts (HTLCs) that ensure either both parties receive their desired assets or transactions are safely reverted - no funds can ever be lost or permanently locked.
Our implementation required mastering TON's unique FunC programming language and overcoming significant technical challenges like TON's cell structure limitations and message-based actor model. We built or deployed dual escrow systems on both networks: source and destination escrows that coordinate through cryptographic hashlocks and economic safety deposits. The architecture includes resolver infrastructure that acts as professional market makers, competing to fill orders while providing deep liquidity and Interfaces for components to work with Each other.
Orbis swap is composed of multiple tightly integrated components, combining smart contracts, indexing infrastructure, and protocol-level innovations.
TON Smart Contracts We implemented HTLC based Escrows and Escrow factory on the Ton network. We have two kinds of escrows mirroring the one the EVM side. the source escrow and the destination escrow. Both implement Hash Time Lock mechanisms in them. Working with ton was one of the hardest challenges. This needed thorough understanding of the ecosystem and the FunC the programming language on Ton. We also spent a lot of time dealing with TON's unique cell structure and gas optimization requirements. The biggest technical hurdle was TON's unique cell structure with a 1023-bit limit, while our escrow contracts needed to store complex data including addresses, amounts, safety deposits, secret hashes, and timelock parameters. . TON's message-based actor model also required completely rethinking contract interactions compared to Ethereum's direct function calls.
EVM Smart Contracts On Ethereum's Sepolia testnet, we setup a dev environment for the Fusion+. This included deploying the EscrowFactory contract provided by 1inch.
Resolver To interface with the Escrow Contracts on Ethereum, we built an interface contract for the Resolver. This Resolver Interface Is used by our minimal implementation of a Fusion+ Resolver. Our resolver is responsible for interfacing with both the Ton and the EVM sides. We implemented dedicated adapters for the Resolver to interface with both sides, with the resolver on the Ethereum side interfacing indirectly to the on-chain resolver contract that we deployed for gas estimation and transaction coordination. The resolver coordinates atomic swap execution, manages secret generation and revelation, and ensures economic security through safety deposit mechanisms.
Relayer We built an implementation of a relayer that listens for orders on both Ton and Ethereum Sepolia and then relays that order to our resolver implementation. This architecture is extendable to N number of resolvers constantly bidding for the orders in a competitive marketplace, enabling true decentralized market-making with economic incentives aligned through safety deposits and fee structures.
UI We built a beautiful and clean interface to sum it all up. It allows a user to go from TON to ETH and ETH to TON seamlessly, with integrated wallet support for both ecosystems (TON Connect and RainbowKit) and sophisticated error handling for optimal user experience.