This project is intended to provide an easy and efficient way to exchange tokens and XTZ on Tezos blockchain in a wide number of directions. Using smart contracts listed in this repo users can add their tokens to exchange, provide liquidity, and potentially make a profit in a fully decentralized way.
The solution consists of 6 types of contracts:
Factory- singleton used to deploy new TokenX-XTZ exchange pair;
Dex- contract for TokenX-XTZ pair exchanges;
TTDex- contract for TokenX-TokenY pair exchanges;
Token- FA token implementation.
BakerRegistry- bakery registrar.
MetadataStorage- contract to store and upgrade the shares token metadata.
. ├── ci/ # scripts for continues integration ├── contracts/ # contracts |──────── main/ # the contracts to be compiled |──────── partial/ # the code parts imported by main contracts ├── test/ # test cases ├── storage/ # initial storage for contract originations ├── scripts/ # cli for dex/factory actions ├── test.md # cases covered by tests ├── README.md # current file ├── .env ├── .gitignore ├── package.json └── Architecture.png
Installed NodeJS (tested with NodeJS v12+)
Installed Yarn (NPM isn't working properly with
curl https://gitlab.com/ligolang/ligo/raw/dev/scripts/installer.sh | bash -s "next"
- Installed node modules:
cd quipuswap-core && yarn
To compile and deploy contracts to Delphinet
- Chose configure the version -
FA2- by setting
For other networks:
yarn migrate --network NAME
Contracts are processed in the following stages:
- Interactions on-chain
As the Quipuswap supports 2 token standards that vary only in the token interface implementation and the inter contract communication between Dex and external tokens, the shared codebase is used. Therefore to work with the specific standard version, you should configure it by setting
.env to either
To compile the contracts run:
Artifacts are stored in the
For deployment step the following command should be used:
Addresses of deployed contracts are displayed in terminal. At this stage, new MetadataStorage, Factory are originated. Aditionaly, for testnets two new pairs are deployed.
If you'd like to run tests on the local environment, you might want to run
ganache-cli for Tezos using the following command:
Truffle framework is used for testing. Run:
NOTE: if you want to use a different network, configure
truffle-config.js. If you need to use a different standard, configure