Reading the hook.
The address, the bytecode, then a swap each way through its pool. A few seconds.
v4 hook · Robinhood Chain · block 93,242,074
0x947A…c0c4
The eight checks
4 pools use this hook, the first one 90 d ago.
- 01caution
Permissions that touch your moneyThe address enables after swap returns delta. The hook is allowed to take; the next two checks measure whether it does.
- 02fail
What it takes from a swapIt took 20% of a swap on top of the pool fee.
- 03pass
LPs can get outLiquidity added and removed in the same block came back whole.
- 04pass
The fee is the feeA fixed fee of 1%, written in the pool key.
- 05caution
No one holds the switchNo owner() but it has withdrawFees, setFactory, setProtocolFee.
- 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 record4 pools over 90 days.
Measured at block 93,242,074. 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 & 0x3fff0x00c4 · 00000011000100
- 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.
v3LP-NVDA / V3DEMO
fee 1%- Swap v3LP-NVDA → V3DEMOhook takes 20%
- Swap V3DEMO → v3LP-NVDAhook takes 20%
- Add, then remove liquiditycame back whole
pool 0x73443916c5ba47e95a8d209af37615ba31d62471f5be55f3af75453c8abb8357
v4LP-NVDA / NDEMO2
fee 1%- Swap v4LP-NVDA → NDEMO2hook takes 20%
- Swap NDEMO2 → v4LP-NVDAhook takes 20%
- Add, then remove liquiditycame back whole
pool 0xde83958c485dd175e606dbd2233926dd9844a3e19b1625b29909f9b51b0c7d35
Read from the bytecode
- Code size
- 5,133 bytes
- Owner
- none found
- Proxy
- no
- DELEGATECALL
- absent
- SELFDESTRUCT
- absent
- Outside calls
- 5
- 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.
- 0x18e7346c unknown
- 0x21d0ee70 beforeRemoveLiquidity
- 0x259982e5 beforeAddLiquidity
- 0x3b3a806f withdrawFees
- 0x46904840 feeRecipient
- 0x575e24b4
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.
- After swap. Runs after every swap.
- After swap returns delta. Can take part of what you get out of every swap.
beforeSwap
0x5bb47808 setFactory0x5e3f2727 LP_FEE0x61a7b4b0 registerPool0x6c2bbe7e afterRemoveLiquidity0x6fe7e6eb afterInitialize0x787dce3d setProtocolFee0x91dd7346 unlockCallback0x9f063efc afterAddLiquidity0xb0e21e8a protocolFee0xb47b2fb1 afterSwap0xb6a8b0fa beforeDonate0xb8ca3b83 MAX_PROTOCOL_FEE0xc45a0155 unknown0xc4e833ce getHookPermissions0xd73792a9 FEE_DENOMINATOR0xdc4c90d3 poolManager0xdc98354e beforeInitialize0xe1b4af69 afterDonate0xea1468f2 isLaunchpadPool