Skip to content

Fission extends 1inch's Fusion+ Cross-Chain Atomic Swap to Sui Network with full recoverability.

Notifications You must be signed in to change notification settings

Suryansh-23/fission

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Fission πŸš€

Trustless Cross-Chain Atomic Swaps Between Ethereum and Sui

Fission enables secure, decentralized token exchanges across Ethereum and Sui blockchains without requiring trusted intermediaries. Using cryptographic hash locks and time-locked escrows, Fission guarantees that swaps either complete atomically or allow safe fund recovery.

License: MIT TypeScript Solidity Move

UI

🌟 Key Features

  • πŸ”’ Trustless: No custody of funds by centralized parties
  • βš›οΈ Atomic: Swaps complete entirely or fail safely with fund recovery
  • 🌐 Cross-Chain: Seamless exchanges between Ethereum and Sui ecosystems
  • πŸ›‘οΈ Secure: Time-locked escrows with cryptographic guarantees
  • πŸ“Š Flexible: Support for partial fills and multiple order fulfillment
  • πŸ† Economically Secure: Safety deposits prevent griefing attacks

πŸ—οΈ Architecture Overview

Fission operates through a dual-escrow system:

  1. Source Escrow: Holds maker's tokens on the origin chain
  2. Destination Escrow: Holds resolver's tokens on the target chain
  3. Hash Lock: Cryptographic secret enables atomic claiming
  4. Time Locks: Escalating permissions ensure safe fund recovery

πŸ“– For detailed technical specifications, see Architecture Documentation

οΏ½ Contract Calls Flow

The following diagrams illustrate the contract interaction flows for cross-chain atomic swaps between Ethereum and Sui:

General Cross-Chain Flow

Cross-Chain Flow

Sui-Specific Contract Interactions

Sui Contract Flow

οΏ½πŸš€ Quick Start

Prerequisites

  • Node.js 18+ and npm/yarn
  • Rust and Cargo (for Sui development)
  • Foundry (for Ethereum development)

Installation

# Clone the repository
git clone https://github.com/Suryansh-23/fission.git
cd fission

# Install dependencies for cross-chain SDK
cd cross-chain-sdk
npm install

# Install dependencies for off-chain services
cd ../off-chain/resolver
npm install

Basic Usage

Creating a Cross-Chain Order

import { SuiCrossChainOrder, EvmCrossChainOrder } from '@fission/cross-chain-sdk'

// Sui β†’ Ethereum swap
const suiOrder = SuiCrossChainOrder.new({
  makerAsset: new SuiAddress('0x2::sui::SUI'),
  takerAsset: EvmAddress.fromString('0xA0b86a33E6441E27'), // USDC
  makingAmount: 1000000000n, // 1 SUI
  takingAmount: 2000000n,    // 2 USDC
  maker: new SuiAddress('0x...'),
  receiver: EvmAddress.fromString('0x...')
}, escrowParams, auctionDetails)

// Ethereum β†’ Sui swap  
const evmOrder = EvmCrossChainOrder.new(
  factoryAddress,
  orderData,
  escrowParams,
  auctionDetails
)

Running a Resolver

cd off-chain/resolver
npm run start

πŸ“ Project Structure

fission/
β”œβ”€β”€ contracts/                    # Smart contracts
β”‚   β”œβ”€β”€ evm/                     # Ethereum Solidity contracts
β”‚   β”‚   └── resolver/            # Resolver and escrow contracts
β”‚   └── move/                    # Sui Move contracts
β”‚       └── fusion_plus/         # Source/destination escrow modules
β”œβ”€β”€ cross-chain-sdk/             # TypeScript SDK
β”‚   β”œβ”€β”€ src/                     # SDK implementation
β”‚   └── tests/                   # Integration tests
β”œβ”€β”€ off-chain/                   # Off-chain infrastructure
β”‚   β”œβ”€β”€ resolver/                # Order fulfillment service
β”‚   └── relayer/                 # Order broadcast service
└── docs/                        # Documentation

πŸ”§ Development

Smart Contract Development

Sui Move Contracts

cd contracts/move/fusion_plus
sui move test                    # Run tests
sui move build                   # Build contracts

Ethereum Solidity Contracts

cd contracts/evm/resolver
forge test                       # Run tests
forge build                      # Build contracts
forge script Deploy             # Deploy contracts

SDK Development

cd cross-chain-sdk
npm run test                     # Run unit tests
npm run test:integration         # Run integration tests
npm run build                    # Build SDK

Off-Chain Services

# Resolver service
cd off-chain/resolver
npm run dev                      # Development mode
npm run test                     # Run tests

# Relayer service (Go)
cd off-chain/relayer
make build                       # Build relayer
make test                        # Run tests

πŸ§ͺ Testing

End-to-End Testing

# Start local networks
npm run start:anvil              # Ethereum local node
npm run start:sui-local          # Sui local network

# Run integration tests
cd cross-chain-sdk
npm run test:e2e

Contract Testing

# Sui Move tests
cd contracts/move/fusion_plus
sui move test

# Ethereum tests
cd contracts/evm/resolver
forge test -vvv

🌐 Supported Networks

Mainnet

  • Ethereum: Mainnet, Arbitrum, Polygon
  • Sui: Mainnet

Testnet

  • Ethereum: Sepolia, Arbitrum Sepolia
  • Sui: Testnet, Devnet

About

Fission extends 1inch's Fusion+ Cross-Chain Atomic Swap to Sui Network with full recoverability.

Resources

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •