Custom pricing hook on BNB Chain
Uniswap v4 Hook Contract 0x2ca43c99100fa83425b5cee7f1ea292e808ee58b on BNB Chain · Custom pricing
- Volume (24h)
- $0
- Value locked (TVL)
- $0.02
- All-time volume
- $0
- Pools using this hook
- 1
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 0
What it does
This hook charges dynamic, owner-adjustable amounts on swaps and liquidity actions, with fees routed to a configurable receiver, so the direction and size of fees for each trade cannot be determined from the decoded bytecode alone.
How it works step by step
- Declares beforeSwap with return-delta permission, so it can take over swap accounting and return custom deltas to the PoolManager
- Declares after add/remove liquidity callbacks with return-delta permission, so it can adjust the liquidity deltas settled by the pool
- Maintains per-pool and per-address debt accounting in a nested mapping (slot 1) and a running uint256 counter (slot 3), updated during liquidity and swap callbacks
- Uses a take(address,address,uint256) call to the PoolManager to withdraw tokens that the hook is entitled to, and an Unauthorized error for access control
- Exposes a feeReceiver and a uint16 fee-related setter pair, indicating the hook can route a portion of value to a configurable recipient
- Implements Uniswap V3 style swap callbacks (uniswapV3SwapCallback, pancakeV3SwapCallback), suggesting it may perform internal swaps against a pool during hook execution
- Swap behaviour
- beforeSwap is enabled with return-delta permission, so the hook can alter swap amounts or charge a custom delta on each swap; the exact pricing logic cannot be fully determined from decoded bytecode.
- Liquidity behaviour
- afterAddLiquidity and afterRemoveLiquidity are enabled with return-delta permission, so the hook can modify the balance changes of LP actions; debt is tracked per position key and address in storage.
- Fee behaviour
- Uses dynamic fees via the hook; the uint16 values stored at slot 0 and slot 0 offset 2 appear to be fee or rate parameters writable by the owner, and a feeReceiver address receives collected value. Exact fee formula is not determinable from bytecode.
- Owner & admin controls
- Owner-controlled: transferOwnership, renounceOwnership, setFeeReceiver, and two uint16 parameter setters. The owner can change where fees are sent and adjust fee-related parameters. No pause or upgrade mechanism was observed.
Enabled Uniswap v4 callbacks
beforeInitialize, afterAddLiquidity, afterRemoveLiquidity, beforeSwap, beforeSwapReturnDelta, afterAddLiquidityReturnDelta, afterRemoveLiquidityReturnDelta
beforeInitialize sets up per-pool state when a pool is created; beforeSwap can override or charge swap deltas; afterAddLiquidity and afterRemoveLiquidity can return deltas to adjust settlement; the return-delta flags let the hook move currency to or from the pool.
Security & trust assessment
Risk level: high, estimated (decoded bytecode, low confidence).
Who controls it: A single owner key can change the fee receiver and fee parameters, redirecting value from swaps and liquidity actions to a chosen address.
Risk to user funds: The hook has return-delta permissions and can take tokens from the pool during swaps and liquidity changes; user funds in the pool are exposed to the logic of these deltas and to owner-set parameters.
Security findings
- [high] Return-delta hook moves currency: beforeSwap and liquidity callbacks carry return-delta permissions and the bytecode calls take(), so the hook can take tokens from the pool on user operations.
- [medium] Owner can change fee parameters: Owner-only setters for uint16 parameters and feeReceiver can redirect or raise charges on swaps and liquidity actions without a timelock observed in bytecode.
- [medium] Owner key controls the hook: Ownable with transferOwnership and renounceOwnership; a compromised owner key could alter fee parameters or the fee receiver.
- [info] Pancake/Uniswap V3 swap callbacks present: The contract implements swap callbacks, implying it can initiate swaps; the trust checks on the callback caller could not be confirmed from bytecode.
Contract details
- Verified source
- No
- Bytecode size
- 12,611 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, moves-currency, ownable, return-delta
Pools using Custom pricing hook
- BNB / USDT (0.00% fee) — 24h volume $0, TVL $0.02, 0 swaps today