Rule Craft

Learn · 4 min read

Permission bits, explained

Reading a hook's powers from its address in ten seconds.

Take any hook address and look at its last four hex characters. Those encode 14 bits, one per callback. A set bit means the PoolManager will call that function.

address ...0x00C0  ->  bits 7 and 6  ->  beforeSwap + afterSwap

Which bits deserve attention

CallbackWhy it matters
beforeRemoveLiquidityCan delay or block LP exits. Read the unlock terms.
beforeSwapReturnDeltaThe hook can change what you pay in. Read every rule that uses it.
afterSwapReturnDeltaThe hook can change what you receive. Taxes and burns live here.
afterAddLiquidityReturnDeltaDeposit fees or rebates on adding liquidity.
afterRemoveLiquidityReturnDeltaExit fees on removing liquidity.

The scanner does this decoding for you and adds a risk read.