Custom pricing hook on BNB Chain
Uniswap v4 Hook Contract 0xed202a7050ee856ba9f0d3cd5eabcab6b8a23a88 on BNB Chain · 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
- 209,756
What it does
A custom-curve hook that routes VT/T swaps and liquidity through its own accounting and LP token, so traders and LPs interact with the hook's reserves rather than the standard pool curve.
How it works step by step
- Validates on initialization that the pool pairs VT with T and that the hook is the pool's hook.
- Prices swaps through an external VTSwapHookHelper obtained from the protocol contract.
- Accepts liquidity through custom accounting that mints ZooERC20 LP shares and locks MINIMUM_LIQUIDITY on first deposit.
- Tracks reserve0 and reserve1 in storage and updates them on every swap and liquidity change.
- Exposes quote functions getAmountOutTforVT and getAmountOutVTforT that delegate to the helper.
- Swap behaviour
- beforeSwap takes over swap pricing: the hook asks an external helper for the specified and unspecified amounts and returns a custom delta, updating reserve0 and reserve1 accordingly.
- Liquidity behaviour
- Liquidity is custom-accounted: addLiquidity and removeLiquidity mint and burn the hook's own ZooERC20 LP shares, lock MINIMUM_LIQUIDITY (1000) to the hook on first deposit, and track reserve0/reserve1 in storage; pool-manager deltas are used to update reserves.
- Fee behaviour
- Fees are not computed in the hook itself; the swap amount and unspecified delta are delegated to an external VTSwapHookHelper contract via the protocol, so the fee logic is opaque from this contract's source alone.
- Owner & admin controls
- Owner is read from the protocol contract via ProtocolOwner.owner(); onlyOwner modifier exists but no owner-gated functions are exposed in the hook's own source; parameter values come from an external settings contract (getParamValue), so admins of the protocol/settings can change behaviour indirectly; no pausing or upgrade path is visible in this hook.
Enabled Uniswap v4 callbacks
beforeInitialize, afterInitialize, beforeAddLiquidity, beforeRemoveLiquidity, beforeSwap, beforeSwapReturnDelta
beforeInitialize and afterInitialize validate that the pool pairs VT with T and that the hook address matches; beforeAddLiquidity and beforeRemoveLiquidity route liquidity through the custom curve so direct pool liquidity is blocked; beforeSwap with beforeSwapReturnDelta lets the hook take over the swap and return a custom delta; no after-callbacks are enabled.
Security & trust assessment
Risk level: medium (verified source, medium confidence).
Who controls it: The protocol owner (via the external protocol/settings contracts) can change helper and settings addresses that determine swap pricing and parameters, which could alter the price or fee applied to users without a hook upgrade in this contract.
Risk to user funds: The hook holds the pool's VT and T reserves and executes all swaps and liquidity changes, so user funds depend on correct custom curve math and on the external helper and protocol settings; no direct pause or drain function is visible in this contract.
Security findings
- [medium] Swap pricing delegated to external mutable helper: Swap amounts and fees are computed by an external helper address resolved through the protocol contract, so users must trust that helper and the protocol's settings.
- [medium] Hook overrides swap accounting via return delta: beforeSwapReturnDelta is enabled and the hook decides the unspecified amount, meaning it fully controls the swap output and can hold or move reserve balances.
- [low] Reserve accounting depends on helper output consistency: reserve0 and reserve1 are updated with unchecked subtraction on swap; correctness depends on the external helper returning consistent amounts.
- [info] Hook custodies pooled VT and T: Hook mints and burns LP shares and holds pool liquidity on behalf of users, making it a custodian of pooled VT and T tokens.
Contract details
- Verified source
- No
- Bytecode size
- 12,470 bytes
- Upgradeable proxy
- No
- Detected patterns
- erc20, moves-currency, return-delta, self-unlock
Pools using Custom pricing hook
- FIL / vFIL (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today