Section 16 of 18
Why the Periphery Changed
Key takeaway: V3's core never calls
transferFrom— nobody ever grants a pool an allowance. Instead the pool computes what is owed, invokes a callback onmsg.sender(uniswapV3MintCallback,uniswapV3SwapCallback,uniswapV3FlashCallback), and verifies payment arrived by checking its own balance afterward. That design pushes a sharp obligation onto every integrator: your callback is a public function that hands out your tokens, and anyone can call it directly unless you verifymsg.senderis a genuine pool. Because pools deploy via CREATE2 with constant init code,PoolAddress.computeAddressderives the only legitimate caller from(factory, token0, token1, fee)offline, andCallbackValidationreduces the check to one require. On top of this payment protocol the periphery adds what users need and the core refuses to know about: slippage bounds, deadlines, multi-hop paths, WETH, and NFT position accounting.
The Core Never Pulls Tokens
Search the pool code you wrote in Parts 1 and 2 for transferFrom. It is not there. mint, swap, and flash all follow one shape: compute what the caller owes, snapshot balances, call a function on msg.sender, then require the balance grew by at least the debt ('M0'/'M1', 'IIA', 'F0'/'F1').
This is the callback payment protocol. In V2, users approved the Router, and the Router pushed tokens into pairs before calling them. In V3, the pool trusts nothing about how payment happens — an EOA cannot mint, swap, or flash against a pool directly, because an EOA cannot implement a callback (the debt-free functions — burn, collect, observe — remain EOA-callable). The core is a settlement layer for contracts; convenience is the periphery's job.
Three callbacks exist, one per debt-creating operation:
| Operation | Callback | The pool's check |
|---|---|---|
mint | uniswapV3MintCallback(amount0Owed, amount1Owed, data) | balances grew by the owed amounts |
swap | uniswapV3SwapCallback(amount0Delta, amount1Delta, data) | balance grew by the positive (input) delta |
flash | uniswapV3FlashCallback(fee0, fee1, data) | balances grew by principal + fee |
Knowledge Check
Answer correctly to earn lynx
V3 pools never pull tokens with transferFrom. Instead, after computing what is owed, the pool invokes a function on msg.sender and checks its balance afterward. What is this payment mechanism called?
One word. The pool calls back into the caller and expects payment inside that call.
Sign up free — keep reading + earn 5 Lynx
Zealynx Academy is free. Track your progress, earn Lynx, and climb the leaderboard.
Sign up free to continueAlready have an account? Log in