Fee sharing hook on Ethereum

Uniswap v4 Hook Contract 0xe770d5cf96e39183327ff4158cf53cd43ec600cc on Ethereum · Fee sharing

Volume (24h)
$0
Value locked (TVL)
$0
All-time volume
$0
Pools using this hook
1
Swaps (24h)
2 (1 traders)
Total swaps
2

What it does

This hook takes a fee on swaps (sell fee set by sellBps and buy fee by buyBps, both capped), sends it toward a vault and buyback flow, and penalises liquidity removal during an early tax window, with the founder able to adjust rates.

How it works step by step

  • Charges a sell-side fee on swaps, with the fee rate set by sellBps and bounded by MAX_FEE_BPS, and routes the taken amount to a vault address
  • Applies a buy-side rate (buyBps) in beforeSwap and tracks a sell-time cycle with lastSellTimestamp and cycleSellEth
  • Accumulates a buyback budget and runs executeBuyback and executeBurn once a trigger threshold and a minimum interval are reached
  • Takes or settles the desk token and ETH through the pool manager's unlock callback when a buyback or burn is executed
  • Applies a penalty (PENALTY_BPS) on liquidity removal inside a tax window (TAX_DURATION) measured from the pool's initialization
  • Lets the founder address redirect fees via FlyWheel and set the fee rates via setBuyBps and setSellBps
Swap behaviour
beforeSwap and afterSwap are both enabled and both return deltas. Sells are charged a fee in the range set by sellBps (capped by MAX_FEE_BPS) and the taken amount is moved to the vault; buys use buyBps. The exact direction that pays more or less depends on the decoded logic and cannot be fully confirmed without source.
Liquidity behaviour
beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity and afterRemoveLiquidity are present. Removing liquidity during the tax window appears to incur a penalty of PENALTY_BPS, while adding liquidity is observed but not clearly restricted.
Fee behaviour
Sell and buy fees are set by sellBps and buyBps, adjustable by the founder through setSellBps and setSellBps, capped by MAX_FEE_BPS. Fees are taken through return deltas and sent toward the vault and buyback flow; the pool's static fee is not the sole fee.
Owner & admin controls
The founder address can call setBuyBps, setSellBps and FlyWheel(address). Access to executeBuyback and executeBurn is not confirmed to be restricted. The vault is set at deployment and the contract is not shown to be upgradeable.

Enabled Uniswap v4 callbacks

beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeSwap: sets the buy or sell fee and computes the swap delta. afterSwap: updates cycle accounting, sell tracking and buyback budget, and may return a delta. beforeSwapReturnDelta and afterSwapReturnDelta: allow the hook to take a portion of the swap amounts as fees. Liquidity callbacks: apply the removal penalty during the tax window.

Security & trust assessment

Risk level: high, estimated (decoded bytecode, low confidence).

Who controls it: The founder key can change buy and sell fee rates, redirect fees via FlyWheel, and therefore alter the economics for every trader and LP.

Risk to user funds: The hook can take tokens through return deltas on every swap and can levy a penalty on liquidity removal, and it can hold or move ETH and the desk token during buybacks and burns; user funds can therefore be reduced by fees or penalties.

Security findings

  • [high] Founder can change fee rates: setBuyBps and setSellBps accept arbitrary uint256 values; the decoded code references MAX_FEE_BPS but the bound on the setter is not confirmed, so the founder may be able to set fees up to the cap at any time.
  • [high] Founder can redirect fees: FlyWheel(address) is a nonpayable founder-gated function that appears to change the destination of taken fees, which could divert value from the vault.
  • [medium] Hook takes tokens via return deltas: beforeSwapReturnDelta and afterSwapReturnDelta are enabled, so the hook moves currency during swaps and liquidity changes that the pool would otherwise handle.
  • [medium] Removal penalty during tax window: Liquidity removal is penalised by PENALTY_BPS while the TAX_DURATION window is active, reducing LP withdrawals in that period.
  • [medium] Buyback and burn execution access unclear: executeBuyback and executeBurn move funds via the unlock callback; the access check was not confirmed from bytecode, so anyone triggering them may affect pool balances.

Contract details

Verified source
No
Bytecode size
9,499 bytes
Upgradeable proxy
No
Detected patterns
erc20, liquidity-management, moves-currency, return-delta, self-unlock, tax

Pools using Fee sharing hook