V2 Factory & Pair
V2 Factory
The V2 Factory creates and indexes V2 trading pairs. Each unique token pair has exactly one V2 pool.Key Functions
getPair
Returns the pair contract address for two tokens, or zero address if no pair exists.Token order does not matter —
getPair(A, B) returns the same result as getPair(B, A).allPairs
Returns the pair address at a given index. Used for enumeration.ABI
V2 Pair
Each V2 Pair is an ERC-20 contract (LP token) that also holds the pool reserves and executes swaps.Key Functions
getReserves
Returns the current token reserves and the last block timestamp.token0 is always the token with the lower address.