Reading the hook.
The address, the bytecode, then a swap each way through its pool. A few seconds.
v4 hook · Robinhood Chain · block 92,998,150
0x3BDA…15C7
The eight checks
16 pools use this hook, the first one 12 d ago.
- 01caution
Permissions that touch your moneyThe address enables after swap returns delta, after add returns delta, after remove returns delta. The hook is allowed to take; the next two checks measure whether it does.
- 02n/a
What it takes from a swapNo pool with liquidity to swap through yet.
- 03caution
LPs can get outTaking liquidity straight back out lost 1.41%.
- 04caution
The fee is the feeA fixed fee, but a high one: 10%.
- 05caution
No one holds the switchOwned by 0x26E8134eCC3af5cCE32f34B03E7BD2f318B25158. Owner-style functions: withdraw, setRef, setPonsFactory, setBeneficiary, setParams, sweepToll.
- 06caution
The code cannot changeThe bytecode contains DELEGATECALL.
- 07pass
Only the PoolManager can call itEach callback refused a call that did not come from the PoolManager.
- 08pass
Track record16 pools over 11 days.
Measured at block 92,998,150. 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 & 0x3fff0x15c7 · 01010111000111
- 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.
USDG / JUSTTESTIN
fee 10%- Swap USDG → JUSTTESTINno liquidity at the current price
- Swap JUSTTESTIN → USDGno liquidity at the current price
- Add, then remove liquiditylost 1.41%
pool 0x26d9a61a926f9b19ee40f2a508da78f7f6947f5809c61db48539752be419d284
Read from the bytecode
- Code size
- 18,619 bytes
- Owner
- 0x26E8134eCC3af5cCE32f34B03E7BD2f318B25158
- Proxy
- no
- DELEGATECALL
- present
- SELFDESTRUCT
- absent
- Outside calls
- 14
- 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.
- 0x0e5eab20 dueLength
- 0x0e917f76 withdraw
- 0x21d0ee70 beforeRemoveLiquidity
- 0x2247b655 register
- 0x259982e5 beforeAddLiquidity
- 0x30c58ee3
bit 4
After donate
bit 3Before swap returns deltabit 2After swap returns deltabit 1After add returns deltabit 0After remove returns delta- After initialize. Runs once, right after a pool is created.
- After add liquidity. Runs after each deposit.
- After remove liquidity. Runs after each withdrawal.
- 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.
- After add returns delta. Can charge LPs on the way in.
- After remove returns delta. Can take part of what LPs withdraw.
stepAuto
0x30ef6f46 FLOOR_PIPS0x35997ee1 referencesThisBlock0x37eb92d9 familyKey0x3873308a setRef0x38af3eed beneficiary0x4596ca11 unwind0x47e7ef24 deposit0x4a95d9d5 tiers0x4e494587 openPair0x4f68c981 setPonsFactory0x502e1e7c setBeneficiary0x575e24b4 beforeSwap0x5be19fc6 setParams0x5db61a97 stepShield0x5e615a6b getParams0x5f55cd23 graduate0x61c48e46 pairTick0x6c2bbe7e afterRemoveLiquidity0x6fe7e6eb afterInitialize0x6fe958d8 rebalance0x7bc18b08 position0x7be34a2d CAP_PIPS0x8da5cb5b owner0x91dd7346 unlockCallback0x95b0e5e1 sigma0x9f063efc afterAddLiquidity0xa193d3ca sweepToll0xae9fc205 SINK0xb01bce5c ratchetPips0xb47b2fb1 afterSwap0xb6a8b0fa beforeDonate0xc4b6ebdf ref0xc4e833ce getHookPermissions0xc7aad574 poolBooks0xd5ab07f5 listPons0xd6a5d7db quotes0xdc4c90d3 poolManager0xdc98354e beforeInitialize0xddd391a8 family0xdfcb6388 rebalanceQuotes0xe1b4af69 afterDonate0xe34a5f65 tollOf0xe52b3218 setBook0xef38eaf1 getBook0xf2fde38b transferOwnership0xf44c71e4 K_FREE0xf51ffda5 listQuote0xf7888aec balanceOf