FeeRaffleHook on Base

Uniswap v4 Hook Contract 0x4abf468d9e0cc43a0cb68346a8eeecae794860cc on Base · Fee sharing · Verified contract

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

What it does

A Uniswap v4 hook for FRAFF pools that charges ETH fees on buys and sells, with an early anti-sniper fee and supply-based fee tiers, and forwards the collected ETH to the FRAFF contract for its raffle.

How it works step by step

  • Records each pool's initialization timestamp in beforeInitialize to time the anti-sniper window.
  • Charges a buy fee starting at 95% for 90 minutes, decaying 1% every 5 minutes down to 10%.
  • Charges supply-based buy and sell fees using remaining token supply tiers from the fee schedule.
  • Takes the fee in ETH with poolManager.take and forwards it to the FRAFF contract through depositFees.
  • Toggles a midSwap flag on the FRAFF contract around each swap.
Swap behaviour
On swaps in pools containing the FRAFF token, buys (ETH to FRAFF) are charged a fee in ETH in beforeSwap, and sells (FRAFF to ETH) are charged a fee from the ETH output in afterSwap. Other pools pass through with no fee.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
Fees are taken in ETH on pools that contain the FRAFF token: buys are charged in beforeSwap on the specified ETH input, sells are charged in afterSwap on the ETH output. Fees start at 95% buy during a 90-minute anti-sniper window that decays 1% per 5 minutes to 10%, then follow supply-based tiers from 10% buy and 10% sell down to 0% buy and 20% sell as remaining supply falls. Collected ETH is forwarded to the FRAFF contract via depositFees.
Owner & admin controls
No owner or pause controls in the hook; fraffContract is immutable and fee schedules are fixed in the constructor. The only privileged actor is the FRAFF token contract, which can call setMidSwap on it.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize records the pool deployment timestamp for anti-sniper timing. beforeSwap takes buy fees in ETH and forwards them to the FRAFF contract, returning a specified delta. afterSwap takes sell fees from the ETH output and returns an unspecified delta. beforeSwapReturnDelta and afterSwapReturnDelta allow the hook to take currency from swaps.

Security & trust assessment

Risk level: medium (verified source, high confidence).

Who controls it: No privileged key on the hook itself. The FRAFF token contract is the only caller of setMidSwap, and its behaviour is outside this hook's source, so trust in fraffContract is required.

Risk to user funds: The hook takes ETH from swaps on FRAFF pools via poolManager.take and forwards it to the FRAFF contract. It does not hold user funds long-term, but if depositFees or setMidSwap reverts, FRAFF pool swaps will fail.

Security findings

  • [info] Very high early buy fee by design: The anti-sniper window sets buy fees up to 95% of swap input for the first 90 minutes after pool initialization, which can make early buys extremely expensive.
  • [medium] External midSwap flag dependency: The hook calls setMidSwap(true) on the FRAFF contract in beforeSwap and setMidSwap(false) in afterSwap, and the afterSwap early-return paths can be reached without a matching reset in every branch. Correct behaviour depends entirely on the external FRAFF contract's midSwap handling.
  • [info] Immutable fee logic: Fee tiers and the anti-sniper parameters are hardcoded and the hook has no upgrade or admin path, so fee logic cannot be changed after deployment.
  • [low] Swaps depend on FRAFF contract liveness: Fees forwarded via depositFees use an external call that sends ETH to fraffContract; a reverting or malicious FRAFF contract would block swaps on FRAFF pools.

Contract details

Verified source
Yes (FeeRaffleHook)
Compiler
solc 0.8.30+commit.73712a01
Bytecode size
5,627 bytes
Upgradeable proxy
No
Detected patterns
erc20, mev-protection, moves-currency, return-delta, rewards

Pools using FeeRaffleHook