Likely custom pricing hook on Ethereum

Uniswap v4 Hook Contract 0xaf4b3384c4ac6ae853f3dbcb87468d0677138088 on Ethereum · Custom pricing

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

This hook turns its pool into a managed buy and sell venue with its own token balances, using a return delta in beforeSwap that can change how swaps settle, so trade costs depend on the hook's logic rather than a fixed fee alone.

How it works step by step

  • Acts as an ERC20-style token (name, symbol, decimals, totalSupply, balanceOf, transfer, approve, transferFrom) that is itself traded against a Uniswap v4 pool via the hook
  • Exposes buy and sell functions that move the token and the MAD currency through the PoolManager using unlock and unlockCallback, with take used to settle deltas
  • beforeSwap gates pool swaps and returns a delta, so the hook can take over part of a swap's amounts (beforeSwapReturnDelta)
  • Stores MANAGER, ROUTER, FREEZER, MAD and seller addresses, suggesting a restricted seller and freezer role that can control trading
  • Uses a self-unlock pattern: the hook calls the PoolManager unlock and then handles settlement inside unlockCallback
Swap behaviour
beforeSwap is invoked on pool swaps and can return a delta that the hook fills, so swaps routed through this pool are partly settled by the hook's own logic rather than the pool's curve alone. The exact pricing and which trades pay more or less cannot be determined from the decoded bytecode.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
Uses the pool's static fee. The hook does not appear to expose a dynamic fee callback, but any fee-like amounts taken through return deltas cannot be fully determined without source.
Owner & admin controls
A FREEZER address and a seller address are stored, which suggests privileged roles that can restrict or pause trading and token movement. The exact functions that change these roles were not identified in the decoded selectors, so their scope is uncertain.

Enabled Uniswap v4 callbacks

beforeSwap, beforeSwapReturnDelta

beforeSwap is used to inspect and gate swaps on the pool and to apply the hook's delta. beforeSwapReturnDelta lets the hook return a delta that changes the amounts settled for the swap.

Security & trust assessment

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

Who controls it: A privileged FREEZER or seller key could likely halt or redirect trading and token transfers, and the hook's return delta gives it influence over swap settlement amounts.

Risk to user funds: The hook holds token balances and moves token and MAD through the PoolManager, so user funds in swaps and buy/sell flows pass through hook-controlled logic that could block or alter them.

Security findings

  • [high] Return delta can take part of swaps: beforeSwapReturnDelta is enabled and beforeSwap is present, so the hook can alter the amounts a swap settles. This can move value between traders, the hook, and the pool.
  • [medium] Freezer and seller roles: Stored FREEZER and seller addresses suggest privileged accounts that may block transfers or swaps. Their power cannot be fully confirmed without source.
  • [medium] Token and currency movement inside the hook: The hook holds balances (mapping at slot 2) and calls transferFrom, transfer, take and unlock, so it can hold and move both the token and MAD on behalf of users.
  • [info] Unverified source: No verified source is available, so behaviour is inferred from decoded selectors and storage only and may be incomplete.

Contract details

Verified source
No
Bytecode size
5,920 bytes
Upgradeable proxy
No
Detected patterns
erc20, moves-currency, return-delta, self-unlock

Pools using Likely custom pricing hook