Custom pricing hook on Robinhood Chain
Uniswap v4 Hook Contract 0xbaafe4b884f342d9dbd9a10dc59691f68a4120cc on Robinhood Chain · Custom pricing
- Volume (24h)
- $0.94
- Value locked (TVL)
- $0
- All-time volume
- $0.94
- Pools using this hook
- 1
- Swaps (24h)
- 2 (1 traders)
- Total swaps
- 2
What it does
This hook charges a basis-point toll on swaps in its pool, taking it through return deltas, and holds the accumulated tolls that designated bearers can withdraw.
How it works step by step
- Hook exposes an ERC20 token interface (name, symbol, decimals, balanceOf, transfer, approve, transferFrom) alongside Uniswap v4 pool callbacks, so the hook contract is itself a token.
- Takes a toll (fee) in basis points, bounded by TOLL_MIN_BPS and TOLL_MAX_BPS, tracked in tollTaken and tollDrawn counters.
- Uses beforeSwapReturnDelta and afterSwapReturnDelta to modify the swap's net currency amounts, meaning it can take or give currency during swaps.
- Maintains a home pool (homePool, HOME_TICK_SPACING) and a house/commons/bearer structure with a draw(uint8,uint256) function that moves value out of the hook via unlockCallback and take.
- Gates draws behind bearerOf(uint8) and a NotBearer error, so only designated bearers can withdraw accumulated balances.
- Owner-controlled via Ownable (owner, transferOwnership, renounceOwnership) with a fixed SUPPLY and metadataURI/contractURI.
- Swap behaviour
- beforeSwap and afterSwap run on every swap of the pool; they compute a toll in basis points and apply it through return deltas, so the trader's net amount is adjusted by the toll on the affected side.
- Liquidity behaviour
- beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity and afterRemoveLiquidity are present as view selectors; the decoded bytecode suggests they are view or gating hooks rather than actively moving funds, but this cannot be confirmed without source.
- Fee behaviour
- A toll in basis points is charged on swaps, bounded between TOLL_MIN_BPS and TOLL_MAX_BPS; the exact rate source (fixed or variable via set()) and direction of application cannot be fully determined from the decoded bytecode.
- Owner & admin controls
- Owner (Ownable) can transfer or renounce ownership; a set() function exists and may adjust toll parameters, but the exact permissions are not confirmed. Bearers gated by bearerOf control draws.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeInitialize sets up pool state at initialization; beforeSwap computes and gates the toll before the swap; afterSwap settles the toll after execution; beforeSwapReturnDelta and afterSwapReturnDelta let the hook take currency from swaps; afterSwapReturnDelta additionally lets the hook adjust the output amount.
Security & trust assessment
Risk level: high, estimated (decoded bytecode, low confidence).
Who controls it: The owner can change ownership and possibly toll parameters; bearers control draws of accumulated funds. A privileged key could alter or redirect toll revenue.
Risk to user funds: The hook takes currency via return deltas and holds accumulated toll balances that can be withdrawn via draw by bearers, so it can hold and move pool and user funds.
Security findings
- [medium] Return-delta fee taking: beforeSwapReturnDelta and afterSwapReturnDelta let the hook alter swap amounts and take currency, so users' effective execution depends on the toll logic in the bytecode.
- [medium] Withdrawal via draw and bearer role: draw(uint8,uint256) moves accumulated value out of the hook through unlockCallback and take, gated only by bearerOf; a compromised bearer could drain accrued tolls.
- [low] Owner can transfer or renounce control: Ownable transferOwnership and renounceOwnership are exposed, and an owner-set toll parameter could raise the fee within the configured bounds.
- [info] Unverified source: Without verified source, function names beyond selectors cannot be confirmed and some behaviour is inferred from decoded bytecode.
Contract details
- Verified source
- No
- Bytecode size
- 8,196 bytes
- Upgradeable proxy
- No
- Detected patterns
- erc20, moves-currency, ownable, return-delta, self-unlock, tax
Pools using Custom pricing hook
- ETH / TGNM (0.00% fee) — 24h volume $0.94, TVL $0, 2 swaps today