Fundamental
engineering

Building Uniswap V2

Build the actual Uniswap V2 protocol from scratch. Every line of code. Modernized to Solidity 0.8.x. When you finish, you have a complete, deployable fork you understand because you wrote it.

What you are building

You will write the actual Uniswap V2 code: UniswapV2ERC20, UniswapV2Pair, UniswapV2Factory, UniswapV2Library, and UniswapV2Router02. Five contracts, modernized to Solidity 0.8.x. The architecture, math, and invariants are identical to the production protocol that handles billions in daily volume.

License: GPL-3.0Source: Uniswap/v2-coreSolidity: ^0.8.20
16 sections
Lynx340 Lynx
~240 min

Fork ready, audit ready next

Built or forked Uniswap V2? Run a Krait readiness check before a full review.

Krait helps teams catch fork specific AMM risks in reserves, LP accounting, TWAP assumptions, router paths, and fee on transfer behavior before they ask Zealynx for a scoped audit.

Check my fork in Krait