Custom pricing hook on BNB Chain

Uniswap v4 Hook Contract 0x4c7abc6c1c81757c0d6caffe136ec8c136be2888 on BNB Chain · Custom pricing

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

What it does

A proxy-based custom-accounting hook that gates which pools and users can swap or add liquidity and can alter swap settlement through a return delta, with an owner who can upgrade it.

How it works step by step

  • Registers pools on initialization and tracks allowed pool ids and pool keys in storage
  • Checks pool allowance and sender whitelist before swaps
  • Can return a custom before-swap delta so the hook takes or supplies tokens during a swap
  • Gates liquidity additions through beforeAddLiquidity
  • Offers deposit and withdraw entry points that use the pool manager unlock flow and ERC6909 claims
  • Owner can sweep token balances from the hook and upgrade the implementation
Swap behaviour
beforeSwap checks whether the pool is allowed and whether the sender is whitelisted, and beforeSwapReturnDelta lets the hook settle a custom delta with the pool manager instead of the default AMM result.
Liquidity behaviour
beforeAddLiquidity is implemented and the selectors suggest it may restrict liquidity provision, along with deposit and withdraw entry points that use poolManager unlock and modifyLiquidity to move liquidity through the hook's own accounting. beforeRemoveLiquidity and after-liquidity callbacks are present as selectors but their enablement is not confirmed by the permissions shown. Deposit and withdraw functions exist (278f2ab8, 5c334e8f) and may mint or burn ERC6909 claims.
Fee behaviour
No fee logic identified in the decoded functions; the hook does not appear to set or share fees. Uses the pool's static fee as far as can be determined.
Owner & admin controls
Owner (storage slot 0) can set a new owner via setOwner, initialize the proxy once, upgrade the implementation via upgradeToAndCall (UUPS-style, ERC1967 implementation slot), whitelist addresses (setWhitelisted/setWhitelistedBatch), allow or disallow pools (setPoolAllowed), and sweep tokens from the hook via sweep(address,address,uint256).

Enabled Uniswap v4 callbacks

beforeInitialize, beforeAddLiquidity, beforeSwap, beforeSwapReturnDelta

beforeInitialize: records pool registration and pool ids in storage. beforeAddLiquidity: likely gates liquidity provision for allowed pools or whitelisted users. beforeSwap: checks pool allowance and whitelist and may return a custom delta (beforeSwapReturnDelta), letting the hook take or supply tokens in place of the standard AMM swap.

Security & trust assessment

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

Who controls it: The owner can add or remove whitelist and pool-allowance entries, which can block swaps or liquidity for chosen users or pools. The owner can upgrade the implementation, so it could change arbitrary logic and move any balance the hook holds. The owner can sweep tokens out of the hook. A change of owner transfers all of these powers.

Risk to user funds: The hook can hold and move tokens (it uses take, settle, sync, and the sweep function, and its return delta can change swap amounts). The owner can upgrade it or sweep balances, so user funds held or routed through the hook are exposed to the owner's key.

Security findings

  • [high] Upgradeable proxy with owner-controlled sweep: The owner can upgrade the implementation through upgradeToAndCall and can sweep arbitrary token balances held by the hook.
  • [medium] Return delta lets the hook alter swap settlement: beforeSwapReturnDelta is enabled, so the hook can take or supply tokens during swaps. Combined with the upgrade path, the hook's swap accounting can change after deployment.
  • [medium] Owner can gate access to swaps and liquidity: setWhitelisted, setWhitelistedBatch and setPoolAllowed let the owner block specific users or pools from swapping or providing liquidity.
  • [low] Single-step ownership transfer: Ownership can be reassigned with setOwner in a single transaction and there is no visible two-step transfer or timelock in the decoded selectors.
  • [info] Unverified source; analysis is partial: Source is unverified and the runtime is only 163 bytes, so most behaviour is inferred from selectors and storage. The implementation at 0x2dd9c5... is what executes, and its logic could not be fully checked.

Contract details

Verified source
No
Bytecode size
163 bytes
Upgradeable proxy
Yes
Detected patterns
access-control, erc20, erc6909-claims, moves-currency, ownable, return-delta, self-unlock, upgradeable

Pools using Custom pricing hook