Dynamic fee hook on Base

Uniswap v4 Hook Contract 0xc0864cfb0d6c41dd25a9953a99b7ef46034de8c0 on Base · Dynamic fee

Volume (24h)
$0
Value locked (TVL)
$0
All-time volume
$0
Pools using this hook
1
Swaps (24h)
0 (0 traders)
Total swaps
0

What it does

A proxy-based Uniswap v4 hook that appears to apply an adjustable swap fee and may route fees to a treasury, with liquidity additions possibly restricted to approved providers.

How it works step by step

  • Stores a configurable uint16 fee in basis points that swap callbacks read via effectiveFeeBps
  • Runs beforeSwap logic and afterSwap accounting, possibly taking a fee from the swap
  • Can take or transfer pool currency and send it to a stored treasury address
  • Gates liquidity additions through beforeAddLiquidity, possibly reverting for unauthorized providers
  • Upgradeable through a proxy that delegates to a separate implementation
Swap behaviour
beforeSwap and afterSwap run on every swap and read a configurable fee parameter; they may take a fee and send it to a treasury, but exact accounting is not confirmed from decoded bytecode.
Liquidity behaviour
beforeAddLiquidity is implemented and may revert with UnauthorizedLiquidityProvider, suggesting liquidity additions are gated to permitted providers. afterAddLiquidity and afterRemoveLiquidity exist as view stubs; beforeRemoveLiquidity is also present.
Fee behaviour
effectiveFeeBps() reads a uint16 fee value from storage slot 3 (offset 1), and beforeSwap/afterSwap read it, suggesting the hook applies a configurable fee in basis points on swaps. The exact fee formula and whether it is taken or returned as a delta cannot be confirmed from decoded bytecode.
Owner & admin controls
Storage slot 0 and 1 hold addresses set by 0x19d9b705 (likely initialization or owner/config setter); 0x4afd579d(uint16) sets a fee parameter stored at slot 3 offset 1, and 0xed23238c toggles a bool at slot 3 offset 0. Who can call these setters is not determinable without access control checks in the bytecode, which are not decoded.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeAddLiquidity, beforeSwap, afterSwap

beforeInitialize: pool initialization hook. beforeAddLiquidity: gates or inspects liquidity provision. beforeSwap: applies logic before swap execution, likely fee handling. afterSwap: post-swap accounting, possibly fee or delta processing.

Security & trust assessment

Risk level: medium (decoded bytecode, low confidence).

Who controls it: A privileged caller can likely change the fee via the uint16 setter and toggle the bool flag at slot 3, which could affect swap pricing for all users. The presence of a treasury() selector and take/withdraw calls suggests the operator can move accumulated currency.

Risk to user funds: The hook can take currency via take() and transfer() calls and may send funds to a treasury, so swappers and LPs could have value diverted if the fee or treasury logic is abused; the upgradeable proxy adds further uncertainty.

Security findings

  • [medium] Hook can withdraw or take pool currency: The bytecode contains take(address,address,uint256) and withdraw(uint256) selectors plus a treasury() getter, indicating the hook can move currency to a treasury address.
  • [medium] Upgradeable proxy: The proxy delegates all calls to implementation 0xca3eb46cc39c7426307c36bafc97f585c6244884, which can be changed if the proxy admin upgrades it, so future behaviour is not fixed.
  • [medium] Adjustable fee parameter: A uint16 fee setter (selector 0x4afd579d) is present and read by swap callbacks; an unrestricted or weakly restricted setter could set extreme fees.
  • [info] Unverified source: Source is not verified; behaviour is inferred from selectors and storage access only, and the access control on setters is unknown.

Contract details

Verified source
No
Bytecode size
291 bytes
Upgradeable proxy
Yes
Detected patterns
moves-currency, upgradeable

Pools using Dynamic fee hook