Nervos Swap
This application is a fork of Uniswap for the Godwoken network.
Godwoken is an EVM-compatible layer 2 built on top of the Nervos blockchain.
Nervos Swap enables the automated and decentralized exchange of cryptocurrencies through the use of smart contracts.
The protocol works through liquidity pools. Users provide liquidity to the app by depositing cryptocurrency tokens. These tokens can be bought and sold by other users. In return, liquidity providers receive a percentage of the fees generated by each exchange on the platform.
All swaps involving the native currency CKB are carried out with the CKB ERC20 (pCKB).
App structure
The application is composed of a user interface and a backend of smart contracts.
User Interface
The user interface is built with the open-source library React developed by Facebook. React code is made up of reusable entities called components.
Backend
The backend is composed of Uniswap smart contracts. These smart contracts are computer programs written in the solidity language. They manage all the logic of the exchange protocol. The main smart contracts of the application are:
Router
Entry point of the application, allowing to call the functions of adding/withdrawing/exchanging liquidity. As well as the pair consultation functions.
Pair Factory
Smart contract managing cryptocurrency trading pairs. It allows to retrieve an existing pair and create new ones.
Multicall Utility
Utility contract which provides a function to batch together multiple calls in a single external call. This in order to perform atomic transactions comprising several operations.
Test procedure
Use this Faucet to generate test tokens (TOKENA and TOKENB).
Test the application with one of these pairs: TOKENA/TOKENB, CKB/TOKENA, CKB/TOKENB.
Addresses of smart contracts
- Router: 0x3Ea455fad8d7bdcEDC53aa1B76E019712D0e6134
- Pair Factory: 0xfE336Bb4985F7f5294d01161a83A01C460a7d481
- Multicall Utility: 0xeB182C35983B1ABbaDBb73E25c3e85787A323013
- pCKB (CKB ERC 20): 0x86efaff75201Ed513c2c9061f2913eec850af56C
- TOKENA Test token: 0xD29cb1824544C30AEa1F22443e9DCF688ecA0bE4
- TOKENB Test token: 0xD2Da53D65C362E81C0580C5441baaDD16d4c7D48
Log in or sign up for Devpost to join the conversation.