Likely custom pricing hook on Base

Uniswap v4 Hook Contract 0xacaf2945890ab6caea62bda459d1922532a500c8 on Base · Custom pricing

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

What it does

A custom accounting hook that manages just-in-time liquidity and takes a configurable protocol fee on swaps, with admin pause and role controls.

How it works step by step

  • Adds and removes JIT liquidity positions on specified tick ranges, tracked by position id in storage
  • Verifies backend-signed JIT authorisations with strategist nonces to prevent replay
  • Uses beforeSwapReturnDelta to adjust swap settlement amounts through the pool manager
  • Charges a configurable protocol fee recorded for a fee recipient
  • Supports pausing the whole hook and individual JIT positions
  • Holds vaulted tokens per asset and allows admin rescue of unvaulted balances
Swap behaviour
beforeSwap and afterSwap run on every swap; beforeSwap can return a delta so the hook takes or supplies tokens during settlement, and the swap is blocked while the hook is paused.
Liquidity behaviour
beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity and afterRemoveLiquidity callbacks are exposed but the permissions only enable swap callbacks. The hook manages JIT (just-in-time) liquidity positions in storage (setJITPosition, removeJITPosition, jitPositions, MAX_JIT_RANGES), with a backend-signed verifyJIT check against strategist nonces and a vault mechanism (vaultForAsset, TokenHasVault).
Fee behaviour
A protocol fee is configurable via setProtocolFee(address,uint32) and recorded per recipient; the hook appears to take or route a fee out of swap or liquidity flows, but the exact fee calculation could not be confirmed from bytecode alone.
Owner & admin controls
Role-based access control with DEFAULT_ADMIN_ROLE (role 0) and grantRole/revokeRole/renounceRole; owner-style admin role gated by a second access slot. Admin can pause and unpause the hook (pause, unpause), pause individual JIT positions (pauseJITPosition), set the backend signer (setBackendSigner), set protocol fee and recipient (setProtocolFee), toggle a boolean flag and an address-keyed permission (0x523eb523, 0xedb2d01a), and rescue unvaulted tokens (rescueUnvaultedToken). Exact role names could not be resolved without source.

Enabled Uniswap v4 callbacks

beforeSwap, afterSwap, beforeSwapReturnDelta

beforeSwap: validates the swap and can alter the swap via return delta (beforeSwapReturnDelta enabled). afterSwap: post-swap accounting and state update. beforeSwapReturnDelta: lets the hook specify a delta that changes the amounts settled by the pool manager, which is how the hook can take or supply tokens during a swap.

Security & trust assessment

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

Who controls it: A privileged admin can pause the whole hook, pause individual JIT positions, rotate the backend signer that authorises JIT liquidity, change the protocol fee and recipient, grant or revoke roles, and rescue tokens from the contract. A compromised admin or backend signer could redirect fees, block swaps or move unvaulted tokens.

Risk to user funds: The hook can take or supply tokens during swaps via return deltas, holds tokens for JIT liquidity and vaults, and admin can rescue unvaulted tokens or pause flows, so user and pool funds are exposed to both hook logic and privileged keys.

Security findings

  • [medium] Hook moves currency during swaps: The hook can pull or push tokens during swaps through beforeSwapReturnDelta and uses the pool manager take function, so swap settlement depends on hook logic.
  • [medium] Pausable by admin: pause and unpause exist and gate swap-related flows (EnforcedPause, ExpectedPause), so an admin can halt trading through this hook.
  • [medium] Admin token rescue: rescueUnvaultedToken lets an admin withdraw tokens held by the contract that are not tracked as vaulted, which can include user or pool funds if accounting is wrong.
  • [medium] Backend signer trust: JIT liquidity authorisation relies on a backend signer that can be set by an admin; signature-based verification means signer compromise allows unauthorised JIT positions.
  • [info] Role-based access control: Ownership is managed with AccessControl roles and renounce/grant functions rather than a single owner, which reduces single-key risk but still depends on who holds DEFAULT_ADMIN_ROLE.

Contract details

Verified source
No
Bytecode size
18,560 bytes
Upgradeable proxy
No
Detected patterns
moves-currency, pausable, return-delta

Pools using Likely custom pricing hook