Skip to content
Request an audit

Uniswap V4 mechanics: unlock callbacks, the sign of a delta, and sync before settle

We continued the Panoptic contest on Code4rena.

Lesson Summary:

  • Entry point for UniswapV4 is the `unlock` function (call unlock and it callbacks you)
  • NonZeroDeltaCount must be 0 after every UniV4 pool swap
  • UniV4 callback implementation should always check if the msg.sender is the pool
  • UniV4 delta could be positive or negative - depends if you send funds to UniV4 or UniV4 sends funds to you
  • sync needs to be called before settles in UniV4
  • Transfer `delta` to the UniV4 pool first, then you .mint 1-1 the delta you transferred
  • Check if .symbol can revert before going to the catch (like in Sukukfi)
  • Check how uniV4 delta works - when's the delta negative/positive (on send or on receive)? Negative - Pool manager is owed tokens, positive - user is owed tokens
  • Check why aren't they calling `sync` in one of the branches in `unlockCallback` - ОК
  • Check if tokens with Reentrancy are in-scope
  • What happens if the delta is type(int256).min and I negate it?
Watch the session on YouTube ↗
Message on Telegram All 62 posts