Rewards hook on Ethereum
Uniswap v4 Hook Contract 0xa6d34d6ac8be369072ccacc6700c1a7363997acc on Ethereum · Rewards
- Volume (24h)
- $106
- Value locked (TVL)
- $2.66K
- All-time volume
- $19.72K
- Pools using this hook
- 39
- Swaps (24h)
- 118 (50 traders)
- Total swaps
- 5,877
What it does
This hook charges a per-token buy/sell tax on swaps: the taxed side is set by swap direction, the tax is a basis-point percentage read from the BuilDeFi registry, and the hook also reads a TWAP oracle, so traders on taxed tokens receive less output while LPs are not directly affected.
This read was written for the hook 0x14f1…facc on Robinhood Chain and reused here: the two share a code shape, so constants such as fees, owners and addresses can differ.
How it works step by step
- Exposes a library of helper functions (HookLibrary) used by a BuilDeFi Uniswap v4 hook: TWAP observation checks, TWAP sqrt price lookup, and a sqrt-ratio quote helper.
- Computes a buy/sell tax as a flat percentage of the swap amount, with the tax currency chosen from swap direction and sign of amountSpecified.
- Reads per-token tax rates (tokenTaxBps) from the BuilDeFi core registry to decide how much tax applies to each side of a swap.
- Before-swap tax is taken from the specified amount; after-swap tax is taken from the realized output amount in the balance delta.
- Reads a truncated geometric-mean oracle (observe, getState, getObservation) stored on the hook to derive arithmetic mean ticks over a lookback window.
- Swap behaviour
- Swap-time tax is computed in the library: beforeSwap returns a specified-currency delta equal to swapAmount times tokenTaxBps/10000, and afterSwap returns an unspecified-currency delta equal to the realized output amount times tokenTaxBps/10000. Which token is taxed depends on direction; the taxed token is whichever side the registry has a nonzero tax for.
- Liquidity behaviour
- No liquidity callbacks.
- Fee behaviour
- Uses the pool's static fee for the pool itself; the hook adds a separate per-token buy/sell tax (tokenTaxBps, in basis points) that is collected through return deltas rather than the LP fee.
- Owner & admin controls
- Not determinable from the provided library source; the tax rates live in the external BuilDeFi core registry (IBDeFiCore.tokenTaxBps), whose setters and owner are not included. Proxy upgrade authority for the implementation is also not shown.
Enabled Uniswap v4 callbacks
beforeInitialize, afterInitialize, beforeAddLiquidity, beforeRemoveLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeInitialize and afterInitialize are enabled for pool setup and oracle initialization; beforeAddLiquidity and beforeRemoveLiquidity are enabled for liquidity gating or bookkeeping; beforeSwap and afterSwap are enabled to read the oracle and apply the buy/sell tax; beforeSwapReturnDelta and afterSwapReturnDelta are enabled so the hook can take tax amounts from swaps.
Security & trust assessment
Risk level: high, estimated (decoded bytecode, medium confidence).
Who controls it: A privileged key on the core registry or the proxy admin could raise tokenTaxBps to a large value or replace the implementation, changing what traders pay on taxed tokens.
Risk to user funds: The hook takes a tax from swap amounts via return deltas on tokens with nonzero tax, so it does hold a claim on user swap proceeds in the taxed currency; it does not appear to block swaps outright, but a high tax setting would materially reduce user output.
Security findings
- [medium] Return-delta tax collection: beforeSwapReturnDelta and afterSwapReturnDelta are enabled, so the hook can take a cut of every swap on taxed tokens; the tax rate is read live from the core registry, so a change there takes effect immediately on existing pools.
- [medium] Upgradeable proxy: The hook address is a proxy delegating to implementation 0x4fc22a11ac7b0684ff8c42351e5ef7afe442c3e6; the implementation can be swapped by whoever controls the proxy admin, changing all logic including tax and oracle behaviour.
- [low] Oracle observation reads: getOldestObservationSecondsAgo requires cardinality > 0 and TWAP consults revert when the lookback predates the oldest observation, which can block dependent calls on newly initialized pools.
- [info] Unchecked tax arithmetic: Tax math uses int256/int128 casts of unbounded amounts; very large swap amounts could overflow the cast, though typical amounts are well within range.
Contract details
- Verified source
- No
- Bytecode size
- 17,701 bytes
- Upgradeable proxy
- Yes
- Detected patterns
- return-delta, upgradeable
Pools using Rewards hook
- ETH / BSX (1.00% fee) — 24h volume $71, TVL $808, 4 swaps today
- ETH / OMEGA (1.00% fee) — 24h volume $32, TVL $439, 5 swaps today
- ETH / EOS (1.00% fee) — 24h volume $2.16, TVL $185, 1 swaps today
- TXS / TITANX (1.00% fee) — 24h volume $0, TVL $0, 6 swaps today
- AU / OMEGA (1.00% fee) — 24h volume $0, TVL $0, 6 swaps today
- TXS / BSX (1.00% fee) — 24h volume $0, TVL $0, 4 swaps today
- SMOKE / LOUNGE (1.00% fee) — 24h volume $0, TVL $0, 4 swaps today
- ERIKX / DRAGONX (1.00% fee) — 24h volume $0, TVL $0, 4 swaps today
- BTJ / BST (1.00% fee) — 24h volume $0, TVL $0, 3 swaps today
- AU / VTECH (1.00% fee) — 24h volume $0, TVL $0, 3 swaps today
- AU / BST (1.00% fee) — 24h volume $0, TVL $0, 3 swaps today
- OMEGA / HYDRA (1.00% fee) — 24h volume $0, TVL $0, 3 swaps today
- SYM / AU (1.00% fee) — 24h volume $0, TVL $0, 2 swaps today
- EOS / H420 (1.00% fee) — 24h volume $0, TVL $0, 2 swaps today
- SYM / DRAGONX (1.00% fee) — 24h volume $0, TVL $0, 2 swaps today
- H420 / S420 (1.00% fee) — 24h volume $0, TVL $0, 2 swaps today
- A8 / OMEGA (1.00% fee) — 24h volume $0, TVL $0, 2 swaps today
- BTJ / SHAGGY (1.00% fee) — 24h volume $0, TVL $0, 2 swaps today
- MUNCH / H420 (1.00% fee) — 24h volume $0, TVL $0, 1 swaps today
- ERIKX / ALXNDRIA (1.00% fee) — 24h volume $0, TVL $0, 1 swaps today