Section 2 of 16

Build
+15 Lynx

The LP Token (UniswapV2ERC20)

Key takeaway: UniswapV2ERC20 is the base LP token contract that every Uniswap V2 pair inherits from. It is a complete ERC-20 with one critical addition: EIP-2612 permit(), which lets users approve and swap in a single transaction via off-chain signatures. The contract owns its own minting and burning rather than delegating to a separate token, keeping the pair stateless and its attack surface minimal.

What You Are Building

Every Uniswap V2 pair is also an ERC-20 token. When you add liquidity, the pair contract mints LP tokens to you. When you remove liquidity, it burns them. These LP tokens represent your share of the pool's reserves.

UniswapV2ERC20 is the base contract that UniswapV2Pair inherits from. It implements the full ERC-20 standard (transfer, approve, transferFrom) plus one critical addition: permit(), which implements EIP-2612 gasless approvals. This is the first contract you build because everything else depends on it.

Your Code

Solution.sol
Solidity
Loading editor...

Requirements

Write your implementation, then click Run Tests. Tests execute on the server.

Sign up free — keep reading + earn 15 Lynx

Zealynx Academy is free. Track your progress, earn Lynx, and climb the leaderboard.

Sign up free to continue

Already have an account? Log in