FusingFeeHook on Ethereum
Uniswap v4 Hook Contract 0xf067c780c18e230958fb35c2455cee381864e0c0 on Ethereum · Dynamic fee · Verified contract
- Volume (24h)
- $0
- Value locked (TVL)
- $348
- All-time volume
- $28.89K
- Pools using this hook
- 20
- Swaps (24h)
- 6 (5 traders)
- Total swaps
- 1,071
What it does
A fee hook for fusi.ng launch pools that charges each swap a fee set by launch-time terms: a resting fee plus a time-decaying premium and an optional anti-sniper surcharge in the first blocks, with the premiums tracked for the launch locker to split.
How it works step by step
- Stores per-pool fee terms (resting fee, start premium, decay seconds, sniper premium, sniper blocks, launch time and block, dev-buy exemption) once, written only by the immutable factory via setTerms.
- Computes the swap fee at execution time: resting fee plus a sniper premium during the launch block window, otherwise a straight-line decaying schedule premium from launchedAt to launchedAt plus decaySeconds.
- Returns the computed fee to the PoolManager with the OVERRIDE_FEE flag in beforeSwap, so the pool's LP fee is set dynamically per swap.
- Records the fee in transient storage in beforeSwap and in afterSwap computes the premium portion (input amount times fee above resting fee) and adds it to premium0 or premium1 counters.
- Lets a whitelisted wallet, identified via the fusi.ng forwarder's hookData, skip the sniper premium; a one-time dev-buy exemption can skip the first swap of the launch block.
- Refuses to let any pool initialise under this hook unless terms were previously set by the factory, and a whitelist can be set only once per pool.
- Swap behaviour
- beforeSwap computes and returns a per-swap LP fee with the override flag, possibly consuming the one-time dev-buy exemption or checking the whitelist for trades routed through the launch forwarder. afterSwap only does bookkeeping: it adds the above-resting-fee portion of the input amount to premium0 or premium1 for the pool. No balance deltas are returned, so the hook does not take or move tokens.
- Liquidity behaviour
- No liquidity callbacks.
- Fee behaviour
- The LP fee per swap is resting fee plus either the sniper premium (in the sniper blocks) or the decaying start premium (after the launch time), capped at MAX_TOTAL_FEE of 95%. The premium above resting is accrued in premium0/premium1 and consumed by the locker via consumePremium, which the locker splits between protocol and creator. Accrued premiums are bookkeeping counters and are not held by the hook.
- Owner & admin controls
- No owner or upgrade mechanism is visible in the source. The factory address is immutable and is the only caller allowed to set terms and whitelists. The locker, read from the factory via launchForwarder and locker view functions, is the only caller allowed to consume premiums. Terms and whitelists are permanent once written. No pause function is present. The factory and forwarder addresses are external dependencies whose behaviour is not included in this input.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeSwap, afterSwap
beforeInitialize: rejects initialization of pools without terms set by the factory. beforeSwap: returns the dynamic per-swap fee with the override flag and applies the exemption logic. afterSwap: records the premium fee portion for later collection by the locker.
Security & trust assessment
Risk level: low (verified source, high confidence).
Who controls it: No owner key can change fees or terms after launch. The factory is the sole writer of terms and whitelists, and the locker is the sole consumer of premiums. A compromised factory could set terms and whitelists for new pools only; it cannot alter existing pools' stored terms.
Risk to user funds: The hook does not hold, move or block pool or user funds: it returns no balance deltas and only overrides the LP fee and updates counters. Fee revenue flows through the pool's LP position, so the exposure lies in the fee level charged to traders rather than custody of their tokens.
Security findings
- [info] Fee cap enforced on write and read: setTerms rejects peaks above MAX_TOTAL_FEE (95%) and _feeAt clamps the result, so the swap fee cannot exceed 95% through this hook.
- [medium] Trust in factory and forwarder for identity and exemptions: The whitelist exemption trusts hookData only when msg.sender equals factory.launchForwarder(); the hook relies on that external forwarder to encode the true trader, and a compromised or misbehaving forwarder could grant the sniper exemption to arbitrary wallets. The factory's launchForwarder and locker return values are read dynamically on each swap.
- [low] Premium accounting is bookkeeping only and depends on locker: premium0 and premium1 are plain counters that the locker resets via consumePremium; the premium value is computed as input times fee difference, so it does not reflect actual fee transfers if the pool's accounting diverges, and the hook trusts the locker to pay out the counted premiums.
- [info] Transient-storage handoff keyed by pool id: The fee is stored in transient storage at a slot equal to the pool id and cleared in afterSwap; this is safe within a single transaction but relies on the pool manager calling beforeSwap and afterSwap in pairs for each swap.
- [info] Permanent immutable configuration: Terms and whitelists cannot be changed after being set, so any mistake in launch parameters is irreversible, though this is by design and no privileged key can alter live fees.
Contract details
- Verified source
- Yes (FusingFeeHook)
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Bytecode size
- 6,338 bytes
- Upgradeable proxy
- No
- Detected patterns
- access-control, mev-protection
Pools using FusingFeeHook
- BTE / TSLAon (Dynamic fee) — 24h volume $0, TVL $0, 6 swaps today
- FSHIBA / SHIB (Dynamic fee) — 24h volume $0, TVL $241, 0 swaps today
- FUSE / FUSECAT (Dynamic fee) — 24h volume $0, TVL $27, 0 swaps today
- WBTC / BTRM (Dynamic fee) — 24h volume $0, TVL $8.23, 0 swaps today
- FUSE / FUSECAT (Dynamic fee) — 24h volume $0, TVL $1.04, 0 swaps today
- MARIE / SPX (Dynamic fee) — 24h volume $0, TVL $2.13, 0 swaps today
- FUSE / ESUF (Dynamic fee) — 24h volume $0, TVL <$0.01, 0 swaps today
- FUSE / FUSECAT (Dynamic fee) — 24h volume $0, TVL <$0.01, 0 swaps today
- ETH / ETHCAT (Dynamic fee) — 24h volume $0, TVL $3.53, 0 swaps today
- ETH / ICON (Dynamic fee) — 24h volume $0, TVL $1.04, 0 swaps today
- ETH / BOMB (Dynamic fee) — 24h volume $0, TVL $36, 0 swaps today
- ETH / FUSEPENGU (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today
- ETH / FALPHA (Dynamic fee) — 24h volume $0, TVL $16, 0 swaps today
- PEPE / pepe (Dynamic fee) — 24h volume $0, TVL <$0.01, 0 swaps today
- 1INCH / 1INCHPENIS (Dynamic fee) — 24h volume $0, TVL $4.73, 0 swaps today
- ETH / MCAT (Dynamic fee) — 24h volume $0, TVL $1.11, 0 swaps today
- ETH / CLARITY (Dynamic fee) — 24h volume $0, TVL $1.11, 0 swaps today
- WBTC / DOGE (Dynamic fee) — 24h volume $0, TVL $1.06, 0 swaps today
- ETH / FWIN (Dynamic fee) — 24h volume $0, TVL $4.85, 0 swaps today
- ETH / PSI (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today