Unlisted
Start

Flags glossary

Reading the address

A v4 hook's permissions are written in the last 14 bits of its own address. The PoolManager only calls the hook at the moments whose bit is set, so nobody can hide a permission: the address says it. The Pons hook 0xe5e702641ea86f4ae6cc3cdaed2b886f976be044 ends in f044:

13beforeInitialize
12afterInitialize
11beforeAddLiquidity
10afterAddLiquidity
9beforeRemoveLiquidity
8afterRemoveLiquidity
7beforeSwap
6afterSwap
5beforeDonate
4afterDonate
3beforeSwapReturnsDelta
2afterSwapReturnsDelta
1afterAddLiquidityReturnsDelta
0afterRemoveLiquidityReturnsDelta

All 14 flags

BitFlagIn plain words
13beforeInitializeRuns code when a pool is created. Called once, when someone creates a pool with this hook.
12afterInitializeRuns code after a pool is created. Called once, right after a pool with this hook is created.
11beforeAddLiquidityCan block people from adding liquidity. Called before each deposit into the pool.
10afterAddLiquidityRuns code after liquidity is added. Called after each deposit into the pool.
9beforeRemoveLiquidityCan block LPs from withdrawing. Called before each withdrawal. It can revert, which stops liquidity providers from leaving.
8afterRemoveLiquidityRuns code after liquidity is removed. Called after each withdrawal.
7beforeSwapRuns code before your swap and can block it. The hook is called before every swap. It can revert, which makes your swap fail.
6afterSwapRuns code after your swap and can block it. The hook is called after every swap. It can revert, which undoes your swap.
5beforeDonateRuns code before a donation to the pool. Donations are tips paid to the pool's LPs.
4afterDonateRuns code after a donation to the pool. Donations are tips paid to the pool's LPs.
3beforeSwapReturnsDeltaCan change the price you get. Before your swap runs, the hook can take or add tokens, so the amount you get is set by its code as well as the pool.
2afterSwapReturnsDeltaCan take a fee from your output. After the pool fills your swap, the hook can keep part of what you were about to receive.
1afterAddLiquidityReturnsDeltaCan take a cut when LPs deposit. The hook can change the amounts a liquidity provider pays in.
0afterRemoveLiquidityReturnsDeltaCan take a cut when LPs withdraw. The hook can change the amounts a liquidity provider gets back.

Properties