Other

fluxswap

Decentralised exchange in Solidity

A set of smart contracts for a decentralised exchange (DEX), written in Solidity and built with Foundry. It covers liquidity pools, a router, staking and a timelock.

fluxswap

About the project

fluxswap is a decentralised exchange (DEX) protocol in Solidity: contracts for swapping tokens directly on the blockchain, with no intermediary. It consists of liquidity pools (contracts that hold the funds to be swapped), a router that directs operations to the pools, staking and a timelock, which delays the execution of operations. It is built with Foundry, a toolkit for building and testing contracts, and has full test coverage plus invariants: conditions that must hold after every operation.

The challenge

In a DEX protocol the contracts move real funds, so a bug in the code is not a defect to fix in the next release, it is lost money. That is why invariants and full test coverage mattered, rather than the mere impression that a contract works.

What we did

  1. 01 Liquidity pool contracts
  2. 02 A router that directs operations to the right pools
  3. 03 A staking contract
  4. 04 A timelock that delays the execution of operations
  5. 05 Invariant tests and full test coverage in Foundry

Related projects

Describe your project.

A free quote comes back within an hour during working hours.

Tell us what you want to build.

A free quote comes back within an hour during working hours. You talk to the person who writes the code.