Reading the hook.
The address, the bytecode, then a swap each way through its pool. A few seconds.
v4 hook · Robinhood Chain · block 92,979,893
0xC74E…4088
The eight checks
27 pools use this hook, the first one 36 d ago.
- 01caution
Permissions that touch your moneyThe address enables before swap returns delta. The hook is allowed to take; the next two checks measure whether it does.
- 02caution
What it takes from a swapIt takes 2.26% of each swap on top of the pool fee.
- 03pass
LPs can get outLiquidity added and removed in the same block came back whole.
- 04caution
The fee is the feeIts pools use a dynamic fee that the hook sets before every swap. It stands at 5% now and can change.
- 05caution
No one holds the switchOwned by 0x575Cf154924f07c10a74b46fECFeB02e8763a4bF. Owner-style functions: setPoolFee, withdrawToken, setPoolEnabled.
- 06pass
The code cannot changeNot a proxy, no DELEGATECALL, no SELFDESTRUCT.
- 07pass
Only the PoolManager can call itEach callback refused a call that did not come from the PoolManager.
- 08pass
Track record27 pools over 35 days.
Measured at block 92,979,893. A hook with an owner or a dynamic fee can behave differently later; scan again before a large trade.
What the address allows
A v4 hook's permissions are the last fourteen bits of its address. The PoolManager calls only what they switch on.
address & 0x3fff0x0088 · 00000010001000
- bit 13Before initialize
- bit 12After initialize
- bit 11Before add liquidity
- bit 10After add liquidity
- bit 9Before remove liquidity
- bit 8After remove liquidity
- bit 7Before swap
- bit 6After swap
- bit 5Before donate
What it did to a real swap
A small swap each way and a liquidity round trip, run through the PoolManager and this hook inside a call that is never sent. The pool fee is expected; anything else missing is the hook.
ETH / duck
fee dynamic, now 5%- Swap ETH → duckhook takes 0.36%
- Swap duck → ETHhook takes 1.57%
- Add, then remove liquiditycame back whole
pool 0xc297514a520eca66a2cbab081cd7fe7cfee8eff23a1821e60126b44c76a03819
ETH / TOFU
fee dynamic, now 5%- Swap ETH → TOFUhook adds 0.33%
- Swap TOFU → ETHhook takes 2.26%
- Add, then remove liquiditycame back whole
pool 0x04cb9c2ef3a86b128ee84af4b36ecfae567b22c0d5242ccab15a0fb96c668383
Read from the bytecode
- Code size
- 13,750 bytes
- Owner
- 0x575Cf154924f07c10a74b46fECFeB02e8763a4bF
- Proxy
- no
- DELEGATECALL
- absent
- SELFDESTRUCT
- absent
- Outside calls
- 18
- Callbacks open to anyone
- none
Its functions, uncensored
Selectors found in the dispatcher, named from the public signature database. Red ones are what an owner usually keeps for itself.
- 0xe1b4af69 afterDonate
- 0xe433c4fe unknown
- 0xeedc966a tokenBalance
- 0xfae97998 unknown
- 0xda2076d9 setPoolFee
- 0xdc4c90d3 poolManager
bit 4
After donate
bit 3Before swap returns deltabit 2After swap returns deltabit 1After add returns deltabit 0After remove returns delta- Before swap. Runs before every swap. On a dynamic-fee pool it can set the fee each time.
- Before swap returns delta. Can take part of what you put into a swap, or change how much is swapped.
0xdc98354e
beforeInitialize
0xe1a45218 BPS_DENOMINATOR0xc34c08e5 executor0xc4e833ce getHookPermissions0xc6878f4e MAX_HOOK_FEE_BPS0xd999984d WRAPPED_NATIVE0xb47b2fb1 afterSwap0xb6a8b0fa beforeDonate0xbbfe243e unknown0x8d1227ac unknown0x8da5cb5b owner0x9f063efc afterAddLiquidity0xb2df5b86 unknown0x5da4bd8c getPoolConfig0x6c2bbe7e afterRemoveLiquidity0x6fe7e6eb afterInitialize0x21d0ee70 beforeRemoveLiquidity0x259982e5 beforeAddLiquidity0x3fc48eba MAX_LP_FEE0x575e24b4 beforeSwap0x01e33667 withdrawToken0x1325ad88 POOL_MANAGER_ADDRESS0x1dd3e63e setPoolEnabled