diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..4fc454f --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,34 @@ +name: Tests +on: + pull_request: + push: + branches: + - master + +jobs: + tests: + name: Test + runs-on: ubuntu-latest + defaults: + run: + shell: bash + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Get Aptos + uses: pontem-network/get-aptos@main + with: + version: latest + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + run: aptos move compile + + #- name: Test + # run: aptos move test + + - name: Build lp-pool-example/ + working-directory: ./lp-pool-example + run: aptos move compile diff --git a/LICENSE b/LICENSE index a105397..fe333f8 100644 --- a/LICENSE +++ b/LICENSE @@ -9,7 +9,7 @@ Parameters Licensor: Pontem Foundation LTD -Licensed Work: AptosSwap Core +Licensed Work: MultiSwap Core The Licensed Work is (c) 2022 Pontem Foundation LTD Additional Use Grant: None diff --git a/Move.toml b/Move.toml index 3f498ee..d5c35fd 100644 --- a/Move.toml +++ b/Move.toml @@ -1,9 +1,9 @@ [package] -name = "AptosSwap" +name = "MultiSwap" version = "0.1.0" [addresses] -AptosSwap = "0x43417434fd869edee76cca2a4d2301e528a1551b1d719b75c350c3c97d15b8b9" +MultiSwap = "0x43417434fd869edee76cca2a4d2301e528a1551b1d719b75c350c3c97d15b8b9" CoinAdmin = "0x12" [dependencies.MoveStdlib] diff --git a/README.md b/README.md index 6efc53a..165a5ee 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# Aptos Swap +# Multi Swap **The project is currently at MVP stage, not for production usage yet.** -**Aptos Swap** is clone of [Uniswap V2](https://uniswap.org/) for [Aptos](https://www.aptos.com/) project. +**MultiSwap** is clone of [Uniswap V2](https://uniswap.org/) for [Aptos](https://www.aptos.com/) project. Inspired from original Uniswap code, docs and math. diff --git a/lp-pool-example/Move.toml b/lp-pool-example/Move.toml index e3a396c..ce38337 100644 --- a/lp-pool-example/Move.toml +++ b/lp-pool-example/Move.toml @@ -6,4 +6,4 @@ version = "0.1.0" Sender = "0x42" [dependencies] -AptosSwap = { local = "../" } +MultiSwap = { local = "../" } diff --git a/lp-pool-example/sources/Example.move b/lp-pool-example/sources/Example.move index e1aa755..17eabc4 100644 --- a/lp-pool-example/sources/Example.move +++ b/lp-pool-example/sources/Example.move @@ -1,4 +1,4 @@ -/// Just an example how you can register your test coins and than make liquidity pool on Aptos Swap. +/// Just an example how you can register your test coins and than make liquidity pool on MultiSwap. /// Implement two tests coins `USDT` and `BTC`, also `LP` coin that will be Liquidity Pool coin for our pool. /// Allows to mint tests coin, register new pool. module Sender::Example { @@ -7,7 +7,7 @@ module Sender::Example { use AptosFramework::Coin::{Self, MintCapability, BurnCapability}; - use AptosSwap::Router; + use MultiSwap::Router; /// Represents test USDT coin. struct USDT {} diff --git a/sources/libs/CoinHelper.move b/sources/libs/CoinHelper.move index 7e43856..f6590c6 100644 --- a/sources/libs/CoinHelper.move +++ b/sources/libs/CoinHelper.move @@ -1,5 +1,5 @@ /// The `CoinHelper` module contains helper funcs to work with `AptosFramework::Coin` module. -module AptosSwap::CoinHelper { +module MultiSwap::CoinHelper { use Std::BCS; use Std::ASCII::String; use Std::Option; @@ -7,7 +7,7 @@ module AptosSwap::CoinHelper { use AptosFramework::Coin; - use AptosSwap::Compare; + use MultiSwap::Compare; // Errors. diff --git a/sources/libs/Compare.move b/sources/libs/Compare.move index 65bb639..63e0e46 100644 --- a/sources/libs/Compare.move +++ b/sources/libs/Compare.move @@ -1,6 +1,6 @@ /// Copy from Move Standard Library. /// Utilities for comparing Move values based on their representation in BCS. -module AptosSwap::Compare { +module MultiSwap::Compare { use Std::Vector; // Move does not have signed integers, so we cannot use the usual 0, -1, 1 convention to diff --git a/sources/libs/SafeMath.move b/sources/libs/SafeMath.move index f418f2b..bef3637 100644 --- a/sources/libs/SafeMath.move +++ b/sources/libs/SafeMath.move @@ -1,5 +1,5 @@ -/// Implementation of math functions needed for Aptos Swap. -module AptosSwap::SafeMath { +/// Implementation of math functions needed for Multi Swap. +module MultiSwap::SafeMath { use Std::Errors; // Errors codes. diff --git a/sources/libs/UQ64x64.move b/sources/libs/UQ64x64.move index 2f33f3b..cc3d1a3 100644 --- a/sources/libs/UQ64x64.move +++ b/sources/libs/UQ64x64.move @@ -1,5 +1,5 @@ /// Implementation of FixedPoint u64. -module AptosSwap::UQ64x64 { +module MultiSwap::UQ64x64 { use Std::Errors; // Error codes. diff --git a/sources/swap/LiquidityPool.move b/sources/swap/LiquidityPool.move index 95e0712..8e645b1 100644 --- a/sources/swap/LiquidityPool.move +++ b/sources/swap/LiquidityPool.move @@ -1,6 +1,6 @@ -/// Aptos Swap liquidity pool. +/// Multi Swap liquidity pool. /// Stores liquidity pool pairs, implements mint/burn liquidity, swap of coins. -module AptosSwap::LiquidityPool { +module MultiSwap::LiquidityPool { use Std::Signer; use Std::Errors; use Std::Event; @@ -8,9 +8,9 @@ module AptosSwap::LiquidityPool { use AptosFramework::Timestamp; use AptosFramework::Coin::{Coin, Self}; - use AptosSwap::SafeMath; - use AptosSwap::UQ64x64; - use AptosSwap::CoinHelper::{Self, assert_has_supply, assert_is_coin, supply}; + use MultiSwap::SafeMath; + use MultiSwap::UQ64x64; + use MultiSwap::CoinHelper::{Self, assert_has_supply, assert_is_coin, supply}; // Error codes. diff --git a/sources/swap/Router.move b/sources/swap/Router.move index 2d774ef..1366b76 100644 --- a/sources/swap/Router.move +++ b/sources/swap/Router.move @@ -1,12 +1,12 @@ /// Router for Liquidity Pool, similar to Uniswap router. -module AptosSwap::Router { +module MultiSwap::Router { use Std::Errors; use AptosFramework::Coin::{Coin, Self}; - use AptosSwap::SafeMath; - use AptosSwap::CoinHelper::{Self, supply}; - use AptosSwap::LiquidityPool; + use MultiSwap::SafeMath; + use MultiSwap::CoinHelper::{Self, supply}; + use MultiSwap::LiquidityPool; // Errors codes. diff --git a/sources/swap/Scripts.move b/sources/swap/Scripts.move index b270707..6a3fa3e 100644 --- a/sources/swap/Scripts.move +++ b/sources/swap/Scripts.move @@ -1,10 +1,10 @@ -/// The current module contains pre-deplopyed scripts for Aptos Swap. -module AptosSwap::Scripts { +/// The current module contains pre-deplopyed scripts for Multi Swap. +module MultiSwap::Scripts { use Std::Signer; use AptosFramework::Coin; - use AptosSwap::Router; + use MultiSwap::Router; /// Add liquidity to pool `X`/`Y` with liquidity coin `LP`. /// * `pool_addr` - address of account registered pool. diff --git a/tests/CoinHelperTests.move b/tests/CoinHelperTests.move index ee3028b..aaf20d1 100644 --- a/tests/CoinHelperTests.move +++ b/tests/CoinHelperTests.move @@ -5,7 +5,7 @@ module CoinAdmin::CoinHelperTests { use AptosFramework::Genesis; use AptosFramework::Coin; - use AptosSwap::CoinHelper; + use MultiSwap::CoinHelper; struct USDT {} struct BTC {} diff --git a/tests/LiquidityPoolTests.move b/tests/LiquidityPoolTests.move index 1ea3e1c..41de4a4 100644 --- a/tests/LiquidityPoolTests.move +++ b/tests/LiquidityPoolTests.move @@ -6,7 +6,7 @@ module CoinAdmin::LiquidityPoolTests { use AptosFramework::Genesis; use AptosFramework::Coin::{Self, MintCapability, BurnCapability}; - use AptosSwap::LiquidityPool; + use MultiSwap::LiquidityPool; struct USDT {} diff --git a/tests/RouterTests.move b/tests/RouterTests.move index fe7e08d..009715f 100644 --- a/tests/RouterTests.move +++ b/tests/RouterTests.move @@ -6,8 +6,8 @@ module CoinAdmin::RouterTests { use AptosFramework::Genesis; use AptosFramework::Coin::{Self, MintCapability, BurnCapability}; - use AptosSwap::LiquidityPool; - use AptosSwap::Router; + use MultiSwap::LiquidityPool; + use MultiSwap::Router; use AptosFramework::Timestamp; struct USDT {} diff --git a/tests/SafeMathTests.move b/tests/SafeMathTests.move index 9f2b6a5..daad697 100644 --- a/tests/SafeMathTests.move +++ b/tests/SafeMathTests.move @@ -1,6 +1,6 @@ #[test_only] -module AptosSwap::SafeMathTests { - use AptosSwap::SafeMath; +module MultiSwap::SafeMathTests { + use MultiSwap::SafeMath; #[test] fun test_mul_div() { diff --git a/tests/ScriptsTests.move b/tests/ScriptsTests.move index 6911138..0f851b2 100644 --- a/tests/ScriptsTests.move +++ b/tests/ScriptsTests.move @@ -3,11 +3,11 @@ module CoinAdmin::ScriptsTests { use Std::Signer; use Std::ASCII::string; use AptosFramework::Coin; - use AptosSwap::Router; - use AptosSwap::LiquidityPool; + use MultiSwap::Router; + use MultiSwap::LiquidityPool; use AptosFramework::Coin::{MintCapability, BurnCapability}; use AptosFramework::Genesis; - use AptosSwap::Scripts; + use MultiSwap::Scripts; struct USDT {} diff --git a/tests/UQ64x64Tests.move b/tests/UQ64x64Tests.move index ba4957a..2f9f25a 100644 --- a/tests/UQ64x64Tests.move +++ b/tests/UQ64x64Tests.move @@ -1,6 +1,6 @@ #[test_only] -module AptosSwap::UQ64x64Tests { - use AptosSwap::UQ64x64; +module MultiSwap::UQ64x64Tests { + use MultiSwap::UQ64x64; #[test] fun test_is_zero() {