HookLibrary on Robinhood Chain
Uniswap v4 Hook Contract 0x5962eb3aaae3711c1b61766d0d5f1ed4734ffacc on Robinhood Chain · Fee sharing · Verified contract
- Volume (24h)
- $0.95
- Value locked (TVL)
- $1.14K
- All-time volume
- $8.08K
- Pools using this hook
- 3
- Swaps (24h)
- 1 (1 traders)
- Total swaps
- 1,541
What it does
This hook charges a per-token buy and sell tax in basis points on swaps of taxed tokens, taking it on the fee currency before the swap for the specified amount and after the swap on the realized output, while tokens with zero tax trade untouched.
How it works step by step
- Reads a per-token buy/sell tax in basis points from the BDeFi core registry via tokenTaxBps for the fee-currency of each swap
- Before-swap: computes a tax amount proportional to the specified swap amount and returns it as a hook specified delta, taking the tax in the fee currency
- After-swap: computes a tax from the realized output amount in balanceDelta and returns it as a hook unspecified delta
- Maintains a truncated geometric TWAP oracle per pool (observations, observe, getState/getObservation) and exposes TWAP price and observation-age helpers for off-chain or on-chain consumers
- Returns tax deltas to the pool manager through return-delta permissions, so the hook itself can receive pool tokens as tax
- Tax direction is determined by swap direction (zeroForOne) and sign of amountSpecified, so one side of the pool is taxed on buys and the other on sells
- Swap behaviour
- Swaps on tokens with a non-zero tokenTaxBps are charged a tax on the fee-currency side, computed before the swap on the specified amount and after the swap on the realized output; tokens with zero tax are unaffected.
- Liquidity behaviour
- No liquidity callbacks are used as tax logic; beforeAddLiquidity and beforeRemoveLiquidity are enabled in permissions, but the decoded library does not show their logic, so this is not determinable from the input.
- Fee behaviour
- Fees are not dynamic LP fees; a per-token tax in bps (tokenTaxBps from the core registry) is taken on the fee currency and routed by the hook's tax distribution logic, which is not visible in the supplied library.
- Owner & admin controls
- Proxy is upgradeable, so the implementation can be changed by whoever controls the proxy admin; tax rates are read from the BDeFi core registry, which the core owner may be able to change; no pause or owner function is visible in the supplied library.
Enabled Uniswap v4 callbacks
beforeInitialize, afterInitialize, beforeAddLiquidity, beforeRemoveLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeInitialize and afterInitialize initialize per-pool oracle state; beforeSwap and afterSwap compute and apply buy/sell tax; beforeSwapReturnDelta and afterSwapReturnDelta let the hook claim tax amounts from swaps; beforeAddLiquidity and beforeRemoveLiquidity are enabled but their role is not visible in the supplied code.
Security & trust assessment
Risk level: high, estimated (decoded bytecode, medium confidence).
Who controls it: A privileged key controlling the proxy admin or the core registry could change the implementation or raise token tax rates, affecting all swaps of taxed tokens in pools using this hook.
Risk to user funds: The hook can take a percentage of swap output or input as tax through return deltas, and an upgrade could change how funds are handled; the hook does not hold a balance beyond what is routed by the tax mechanism, which is not fully visible.
Security findings
- [high] Upgradeable proxy: The hook is a proxy delegating to implementation 0xd988...; whoever controls the upgrade authority can replace the swap, tax and liquidity logic at any time.
- [high] Hook takes tokens via return deltas: beforeSwapReturnDelta and afterSwapReturnDelta are enabled and getBuySellTaxDelta returns a tax amount in the fee currency, so the hook can extract a share of every swap of a taxed token.
- [medium] Tax rate controlled externally: Tax bps are read from bdefiCore.tokenTaxBps; a change in the core registry can raise a token's tax (the library does not cap it), potentially to a level that makes swaps uneconomic.
- [medium] Tax distribution not visible: The supplied library computes the tax amount but the routing of collected tax to receivers is not in the provided source, so where funds go cannot be verified here.
- [info] Rounding and oracle truncation: Tax uses integer division by 10000 and the TWAP is truncated to 9116 ticks per observation; these are neutral observations about precision and manipulation limits.
Contract details
- Verified source
- Yes (HookLibrary)
- Compiler
- solc 0.8.28+commit.7893614a
- Bytecode size
- 15,965 bytes
- Upgradeable proxy
- Yes
- Detected patterns
- oracle, return-delta, tax, upgradeable
Pools using HookLibrary
- ETH / SMKD (1.00% fee) — 24h volume $0.95, TVL $908, 1 swaps today
- SMKD / SMOKE (1.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- CASHCAT / PCCC (1.00% fee) — 24h volume $0, TVL $231, 0 swaps today