Skip to content

Commit

Permalink
Rename contract to MultiSwap, add compilation to CI (#1)
Browse files Browse the repository at this point in the history
* renaming

* update workflow

* update workflow

* workflow currently without tests
  • Loading branch information
borispovod authored May 26, 2022
1 parent 390930f commit ed6d60b
Show file tree
Hide file tree
Showing 19 changed files with 71 additions and 37 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Move.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "AptosSwap"
name = "MultiSwap"
version = "0.1.0"

[addresses]
AptosSwap = "0x43417434fd869edee76cca2a4d2301e528a1551b1d719b75c350c3c97d15b8b9"
MultiSwap = "0x43417434fd869edee76cca2a4d2301e528a1551b1d719b75c350c3c97d15b8b9"
CoinAdmin = "0x12"

[dependencies.MoveStdlib]
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
2 changes: 1 addition & 1 deletion lp-pool-example/Move.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ version = "0.1.0"
Sender = "0x42"

[dependencies]
AptosSwap = { local = "../" }
MultiSwap = { local = "../" }
4 changes: 2 additions & 2 deletions lp-pool-example/sources/Example.move
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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 {}
Expand Down
4 changes: 2 additions & 2 deletions sources/libs/CoinHelper.move
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/// 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;
use Std::Errors;

use AptosFramework::Coin;

use AptosSwap::Compare;
use MultiSwap::Compare;

// Errors.

Expand Down
2 changes: 1 addition & 1 deletion sources/libs/Compare.move
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions sources/libs/SafeMath.move
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion sources/libs/UQ64x64.move
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// Implementation of FixedPoint u64.
module AptosSwap::UQ64x64 {
module MultiSwap::UQ64x64 {
use Std::Errors;

// Error codes.
Expand Down
10 changes: 5 additions & 5 deletions sources/swap/LiquidityPool.move
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/// 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;

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.

Expand Down
8 changes: 4 additions & 4 deletions sources/swap/Router.move
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
6 changes: 3 additions & 3 deletions sources/swap/Scripts.move
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion tests/CoinHelperTests.move
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module CoinAdmin::CoinHelperTests {
use AptosFramework::Genesis;
use AptosFramework::Coin;

use AptosSwap::CoinHelper;
use MultiSwap::CoinHelper;

struct USDT {}
struct BTC {}
Expand Down
2 changes: 1 addition & 1 deletion tests/LiquidityPoolTests.move
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module CoinAdmin::LiquidityPoolTests {
use AptosFramework::Genesis;
use AptosFramework::Coin::{Self, MintCapability, BurnCapability};

use AptosSwap::LiquidityPool;
use MultiSwap::LiquidityPool;

struct USDT {}

Expand Down
4 changes: 2 additions & 2 deletions tests/RouterTests.move
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Expand Down
4 changes: 2 additions & 2 deletions tests/SafeMathTests.move
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[test_only]
module AptosSwap::SafeMathTests {
use AptosSwap::SafeMath;
module MultiSwap::SafeMathTests {
use MultiSwap::SafeMath;

#[test]
fun test_mul_div() {
Expand Down
6 changes: 3 additions & 3 deletions tests/ScriptsTests.move
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}

Expand Down
4 changes: 2 additions & 2 deletions tests/UQ64x64Tests.move
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[test_only]
module AptosSwap::UQ64x64Tests {
use AptosSwap::UQ64x64;
module MultiSwap::UQ64x64Tests {
use MultiSwap::UQ64x64;

#[test]
fun test_is_zero() {
Expand Down

0 comments on commit ed6d60b

Please sign in to comment.