/tonswap-contracts

Core smart contracts for TON mainnet

Primary LanguageTypeScript

Tonswap - FunC Smart Contracts

Work in progress!

This project is still experimental and in an ongoing research phase.

Overview

TonSwap is a DEX/AMM using the Uniswap V2 curve (a financial model shared by many popular AMMs like PancakeSwap, QuickSwap, Sushi) to create liquidity pairs and allow traders to swap tokens and liquidity providers to supply liquidity and earn rewards.

The project depends on an Jetton standard implementation for Jetton.

Develop

run npm install

Compile contract and run tests

This project depends on the executables fift, func . You can build them from source, or you can download the pre compiled binaries.

Func Compiler

This project is using the latest func features such as #include and const so please use the latest func compiler , If you want to set an explicit func path you may use the FUNC_PATH environment variable export FUNC_PATH=/usr/local/bin/func

Run tests

the project uses ton-contract-executor package to run Jest based tests. Use npm run test to execute the test suite.

Run end to end test on Mainnet or Testnet

npm run e2e (this process will generate a deploy wallet during uts execution)

Roadmap

  • Full functional AMM with 0.3% fees
  • End to end Jest test coverage using ton-contract-executor
  • Gas Optimizations , sender should receive the gas change in the end of the message flows
  • Move to Jetton architecture
  • Add Liquidity should validate sufficient gas for minting LP contract , so liquidity slippage check should include it.
  • Write end to end script that deploys on test/main-net
  • enforce overflows in price calculation
  • upgrade to latest npm ton
  • Connect Bot to mainnet
  • Connect Web app