FeeHook on Base
Uniswap v4 Hook Contract 0x0507140088aa5b266d6b44eef02ad55cf1fb40c0 on Base · Dynamic fee · Verified contract
- Volume (24h)
- $180
- Value locked (TVL)
- $36.91K
- All-time volume
- $234.36K
- Pools using this hook
- 1
- Swaps (24h)
- 2 (2 traders)
- Total swaps
- 970
What it does
A fee-only hook for the STBU/USDT pool on Base that charges each trader a fee between 0.10% and 1.00% based on an owner-set policy, and tracks per-wallet swap volume for seasonal campaigns.
How it works step by step
- beforeSwap sets a per-trader LP fee through an owner-replaceable fee policy, clamped to a 0.10% to 1.00% corridor
- Swaps via the trusted PortalSwapRouter carry the true trader in hookData, which is used to look up the fee
- Swaps via any other route, or with no policy set, pay the maximum 1.00% fee
- afterSwap accumulates each trader's USD-leg swap volume per season
- External (terminal) volume can be credited via cumulative EIP-712 vouchers signed by owner-approved signers
- The owner can bump the season to reset volume keying for a new campaign period
- Swap behaviour
- On every swap, beforeSwap computes the LP fee: trusted-router swaps use the owner's fee policy (clamped to 0.10% to 1.00%), others pay 1.00%. afterSwap adds the USD-leg volume of trusted-router swaps to the trader's season total. Swap amounts are not altered.
- Liquidity behaviour
- No liquidity callbacks.
- Fee behaviour
- Each swap's LP fee is set in beforeSwap: swaps routed through the trusted router get the fee returned by an owner-set fee policy, clamped to a corridor of 0.10% (MIN_FEE) to 1.00% (MAX_FEE). Without a policy, a policy revert, a policy exceeding POLICY_GAS (50,000 gas), or a malformed answer, the fee is MAX_FEE. Swaps from any other router pay MAX_FEE.
- Owner & admin controls
- Owner (Safe, via Ownable2Step) can set or remove the fee policy with setFeePolicy, add or remove voucher signers with setSigner, and start new volume seasons with bumpSeason. Ownership can be transferred or renounced. The fee always stays inside the hard-coded 0.10% to 1.00% corridor regardless of policy. No upgrade mechanism is present.
Enabled Uniswap v4 callbacks
beforeSwap, afterSwap
beforeSwap sets the dynamic LP fee per trader via the fee policy, clamped to the corridor. afterSwap records the swap's USD-leg volume into a per-season, per-wallet meter for trusted-router swaps. No return deltas are used, so the hook never takes or redirects swap amounts.
Security & trust assessment
Risk level: low (verified source, high confidence).
Who controls it: The owner can point the fee policy at any contract that answers within the corridor, so the effective fee for trusted-router traders can be anywhere from 0.10% to 1.00%, but never above 1.00%. The owner can also add voucher signers who can credit arbitrary external volume (cumulative, monotonic) to any wallet, which affects volume-based rewards. The owner can bump seasons, resetting how volume is counted going forward.
Risk to user funds: The hook never holds, moves or blocks pool funds: beforeSwap returns a zero delta and afterSwap returns zero, and swaps cannot be reverted by the fee policy. Exposure is limited to the fee charged, which is bounded between 0.10% and 1.00%.
Security findings
- [medium] Owner-controlled fee within corridor: The owner can set the fee policy to return the maximum allowed fee, making trader fees 1.00% on all trusted-router swaps. This is bounded by the constant corridor and cannot exceed MAX_FEE.
- [medium] Trusted voucher signers credit volume: Any address added via setSigner can sign VolumeVouchers that credit arbitrary cumulative external volume to any wallet, which can distort volume-based allocations. The signer set is controlled only by the owner.
- [info] Policy failure falls back safely: Fee policy calls are isolated with a 50,000 gas cap and a raw staticcall, so a malicious or buggy policy cannot make swaps revert; the fallback is MAX_FEE.
- [info] Trader identity gated on trusted router: Trader identity is taken from hookData only when the sender is the trusted router, which is fixed as an immutable at deployment. Swaps via other routes are charged MAX_FEE and not credited volume.
- [info] No custody or delta returns: The hook never takes custody of tokens and returns zero swap deltas, so user principal is not held or moved by the hook.
Contract details
- Verified source
- Yes (FeeHook)
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Bytecode size
- 9,119 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, ownable
Pools using FeeHook
- USDC / STBU (Dynamic fee) — 24h volume $180, TVL $36.91K, 2 swaps today