Problems in making Liquidity Locker in ZilSwap

Bibek Koirala
2 min readJan 1, 2022

Liquidity lockers are widely used smart contracts in Ethereum and other chains. Liquidity lockers are the smart contracts that hold the LP tokens (tokens like ERC20 tokens that users mint from the DEXes while providing the liquidity) for a specific amount of time or forever. While the LP tokens are locked up in the liquidity locker, the users cannot move the liquidity.

Some of the benefits of having a liquidity locker contract for the projects are:

  • The project creator’s liquidity or the liquidity from ILOs cannot rug-pulled.
  • Liquidity locker assures a minimal amount of liquidity in the pool for a certain amount of time.
  • Increases trust among the community.

In Zilswap or any other DEXes in Zilliqa, we haven’t seen any liquidity locker smart contract to do the same. Here are some of the major reasons behind it.

  • In Scilla, there is no concept of LP tokens yet. Since remote state reads weren’t possible in previous Scilla versions and we can’t inherit any other contracts, it made it almost unfeasible for the DEXes to introduce LP tokens in their platform.
  • Since there is no concept of Factory contracts in Scilla, a new LP token contract couldn’t be deployed in the network dynamically as new tokens join the pool.

Despite these problems, we can still build the liquidity locker by making the necessary changes according to the Zilswap contract. We are currently building and testing this in testnet and it will soon be available for ZRC-2 projects of Zilswap, XCAD DEX and other in future to use. We will discuss that in more detail in the upcoming blog.

--

--

Bibek Koirala

A blockchain dev | Zilliqa Developer Ambassador | RedChillies Labs, Inc. | Pastel Soft | JS Security Technologies | AART