This project is the practical part of a Computer Engineering final degree project related to the RSK Blockchain.
The goal of the project was to deploy two ERC20 tokens in the RSK Testnet Network and develop a dApp that replicates the basic functionalities of a DEX (Decentralized Exchange) such as Add Liquidity and Swap tokens.
- tokenA ($TKA) 0xD92084733Aca1149E6F36275Cd79083Fb34a1370
- tokenB ($TKB) 0x093060F7787D740C0185C402d5c1B1a7a427f858
To add liquidity of a token, the user will provide the balance of the token he wants to add along with the equivalent amount of RBTC, the RSK blockchain native token.
Depending on whether the user wants to add liquidity of the tokenA ($TKA) or the tokenB ($TKB), will use the TokensA Liquidity Pool or the TokenB Liquidity Pool.
The user will first indicate the amount of the token pool that he wants to contribute along with the amount of equivalent value of the RBTC token. This RBTC equivalent value is automatically calculated when the user inputs the token amount, based on the tokenX/RBTC price relation.
It will then be necessary to approve the expenditure of these tokens through the Metamask wallet so the Smart Contract can spend the user tokens and finally confirm the liquidity aggregation transaction.
The Swap page provides the interface to exchanged between both ERC20 tokens deployed in RSK network.
The user needs to select the input and output token, specify the amount of the input token he wants to exchange and the output token amount will be automatically calculated based on the price relation between both ERC20 tokens so the user don't have to manually calculate the output amount he will obtain.
Like in the Liquidity provision process, the user will need to first approve the action, a needed process to give spending permissions to the Smart Contract.
This Demo works with the Uniswap protocol UniswapV2Router02.sol, a Smart Contracts deployed both in the test and main RSK network.
This contract is deployed at 0xf55c496bb1058690DB1401c4b9C19F3f44374961 and provides functions to manage and maintain liquidity pools and exchange between tokens deployed in the RSK network.
npm install
npm run dev
- Local: http://localhost:8080/
- Network: http://192.168.1.70:8080/
-
Copyright 2018 Creative Tim (https://www.creative-tim.com/)
-
Licensed under MIT (https://github.com/creativetimofficial/vue-black-dashboard/issues/blob/master/LICENSE.md)