Section 15 of 18
The Factory and Pool Deployment
Key takeaway: V3 pools take no constructor arguments. The factory stashes
(factory, token0, token1, fee, tickSpacing)in a transientparametersstorage slot, CREATE2-deploys the pool with saltkeccak256(abi.encode(token0, token1, fee)), and the pool's constructor callsIUniswapV3PoolDeployer(msg.sender).parameters()to read its configuration into immutables. Because the init code never varies, the init code hash is a chain-wide constant — which is what lets the periphery compute any pool's address offline and verify callbacks without trusting anyone. Around this trick sits ordinary governance: a fee-tier registry (500/10,3000/60,10000/200at launch, extendable viaenableFeeAmount, never reconfigurable), token sorting, agetPoolmapping populated in both directions, and asetOwnerhandoff that instantly re-parents protocol-fee control of every pool ever deployed.
What You Are Building
Two contracts: UniswapV3PoolDeployer (the deploy function and its transient parameters slot) and UniswapV3Factory (fee-tier registry, createPool, setOwner, enableFeeAmount). A condensed pool contract is provided — only its constructor matters here.
Your Code
Requirements
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 continueAlready have an account? Log in