BurnOnSwapHook on Base

Uniswap v4 Hook Contract 0xb3ae7c0495fe4d20786cf6d119c7a821f83f40cc on Base · Token · Verified contract

Volume (24h)
$3.36K
Value locked (TVL)
$51.75K
All-time volume
$77.37K
Pools using this hook
6
Swaps (24h)
244 (18 traders)
Total swaps
6,337

What it does

Burns a configured token on swaps in a pool, taking a fee of up to 3% of the swap amount in that token and destroying it.

How it works step by step

  • Stores a per-pool burn config holding the burn token (set once to token0 or token1) and a burn fee in basis points capped at 300.
  • On swaps where the burn token is the specified token and the swap is exact-input, beforeSwap computes amount times fee and records it as a specified delta.
  • afterSwap takes the burn amount from the pool manager to the hook and calls burn(address,uint256) on the token, requiring success.
  • On swaps where the burn token is the unspecified side, afterSwap takes a fee of the absolute flow times burn fee and burns it.
  • Owner can create the config for a pool with updateBurnConfig and adjust the fee with updateBurnFee.
Swap behaviour
On exact-input swaps where the burn token is the specified token, beforeSwap reserves a burn amount and afterSwap takes it from the pool and burns it. On swaps where the burn token is the unspecified side, afterSwap takes a fee proportional to the swap flow and burns it, returning it as an unspecified delta. Both are burnFee/10000 of the swap amount.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
Does not change the LP fee. Takes an extra burn fee of up to 3% (burnFee/10000, max 300) of the swap amount in the burn token, which is taken from the pool via poolManager.take and then burned.
Owner & admin controls
Owner (Ownable) can call updateBurnConfig to set the burn token and burn fee for a pool once (burn config can only be set once per pool), and updateBurnFee to change the burn fee up to MAX_BURN_FEE (300 bps, 3%). Owner can renounce or transfer ownership. No pausing or upgrade mechanism found.

Enabled Uniswap v4 callbacks

beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeSwap: computes the burn amount on exact-input swaps where the burn token is the specified token and records it as a specified-side delta. afterSwap: takes the burn token from the pool and calls burn on the token; for the unspecified side it takes a burn fee based on the swap flow and returns it as an unspecified delta. beforeSwapReturnDelta and afterSwapReturnDelta: allow the hook to take tokens from swaps.

Security & trust assessment

Risk level: medium (verified source, high confidence).

Who controls it: The owner cannot directly seize user funds, but can set the burn fee up to 3% per pool on swaps and can update the burn fee at any time, which changes the effective execution price for traders in pools using this hook. The owner cannot change the burn token after it is first set.

Risk to user funds: The hook takes up to 3% of swap flow in the burn token from the pool and burns it. It does not custody user funds beyond the transient take within the swap. Traders receive less output and LPs lose the burned amount. The hook could block swaps if the burn call fails.

Security findings

  • [medium] Owner-adjustable burn fee: updateBurnFee lets the owner raise the burn fee to 300 bps (3%) at any time, immediately affecting swap output for traders.
  • [low] Dependence on token burn() implementation: The hook calls burn on the configured token via a low-level call and only checks success and a boolean return; a token whose burn function behaves unexpectedly or reverts would block swaps on that pool.
  • [info] Burn reduces pool reserves: Burn tokens are taken from the pool's own balances via poolManager.take and burned, so the hook reduces the circulating supply of the burn token and liquidity providers bear the cost of the burn fee as pool value leaves the pool.

Contract details

Verified source
Yes (BurnOnSwapHook)
Compiler
solc 0.8.30+commit.73712a01
Bytecode size
7,311 bytes
Upgradeable proxy
No
Detected patterns
ownable, return-delta

Pools using BurnOnSwapHook