Skip to content

threshold-network/tbtc-sui-integration

Repository files navigation

tBTC Sui Move Contracts

This repository contains Sui Move contracts for integrating tBTC functionality, including:

  • tBTC Coin Module: Defines the tBTC coin type and related operations.
  • Wormhole Gateway Module: Facilitates cross-chain interactions using the Wormhole protocol.
  • Bitcoin Depositor Module: Manages Bitcoin deposit processes within the Sui network.

Documentation

For detailed documentation and usage instructions of the specific contract check their respective documentation files.

Prerequisites

Before deploying these contracts, ensure you have the following installed:

Project Structure

tbtc-sui-move/
├── docs/
│   ├── bitcoin_depositor.md
│   ├── tbtc.md
│   ├── gateway.md
├── sources/
│   ├── token
│   ├── ├── tbtc.move
│   ├── gateway
│   |   ├── helpers.move
│   |   ├── wormhole_gateway.move
│   ├── bitcoin_depositor
│   |   ├── bitcoin_depositor.move
│   ├── ...
├── tests/
│   ├── l2_tbtc_tests.move
│   ├── other tests...
├── Move.toml
└── README.md
  • docs/: Contains project documentation in Markdown format.
  • sources/: Contains the Move modules for tBTC coin, Wormhole gateway, and Bitcoin depositor.
  • tests/: Includes test scripts for the respective modules.
  • Move.toml: Package manifest file detailing dependencies and addresses.

Building and testing Steps

  1. Clone the Repository and get Wormhole stuff:

    git clone https://github.com/4-point-0/tbtc-sui-integration.git
  2. Clone the Wormhole Repository:

    Clone the Wormhole repository from GitHub in the same directory as tbtc-sui-move:

    git clone https://github.com/wormhole-foundation/wormhole.git
    cd tbtc-sui-move
  3. Copy two files from wormhole repo to the shared directory:

    ./wormhole/sui/wormhole
    
    ./wormhole/sui/token_bridge
    
  4. Attach published-at

    In both of these we need to locate move.toml and change/add the published_at field to their respective addresses where they are deployed.

    example for testnet for both of them:

    #token_bridge
    published-at = "0x562760fc51d90d4ae1835bac3e91e0e6987d3497b06f066941d3e51f6e8d76d0"
    
    #wormhole
    published-at = "0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94"
  5. Build the Modules:

    Compile the Move modules to ensure there are no errors:

    cd tbtc-sui-integration
    sui move build -d
  6. Run Tests:

    Execute the test scripts to validate module functionality:

    sui move test
  7. Publish Modules:

    Deploy the modules to the Sui network:

    sui client publish ./ --gas-budget 1000000

Usage

After deployment, you can interact with the modules using the Sui CLI or integrate them into your applications. Refer to the module documentation for available entry functions and their parameters.

Resources

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages