A structural overview of the Uniswap V2 codebase, explaining the architectural split between v2-core and v2-periphery repositories. Core holds immutable contracts (Factory, Pair, ERC20) that custody funds, while Periphery holds replaceable convenience logic (Router, libraries). Key contracts are mapped: Factory deploys pools via CREATE2, Pair handles swaps and LP tokens, Router02 is the user-facing entry point. External helpers like TransferHelper (handling non-standard ERC-20 returns) and FixedPoint (for oracle math) are also covered. The call flow is summarized as User → Router → Pair → User.

Sort: