Zenlink aims to help parachains in the ecosystem by offering them a simple way to implement dex functionalities. In order to create a variety of different ways for teams to integrate dex functionalities into parachains, we created technical solutions for anyone building a complex decentralized exchange using Substrate technology.
Writing WASM smart contracts with an ink! pallet is an effective way to deploy features. The benefit of this method is that people compile and deploy the smart contract to the parachain ink! module, rather than modify the source code of the parachain.
The WASM smart contract consists of two parts: Exchange and Factory.
The Exchange contract is the core of the ZenLink Dex Protocol. It implements the following interfaces:
- Initializing token trading pairs.
- Token swaps.
- Adding/extracting liquidity.
- Defining the liquidity constant function used throughout the protocol.
The Factory contract can be used to create exchange contracts for any ERC20 token that does not already have one. It also functions as a registry of ERC20 tokens that have been added to the system, and the exchange with which they are associated.
For more setup and test details, please find WASM smart contract repo on the following page:
The WASM implementation is supported by Web3 Grants. See more details: