ProbabilisticFeeCollector on World Chain
Uniswap v4 Hook Contract 0x38b084ac413abf0092e4e908f617aa6bc981c040 on World Chain · Fee sharing · Verified contract
- Volume (24h)
- $0
- Value locked (TVL)
- <$0.01
- All-time volume
- $3.35
- Pools using this hook
- 2
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 1
What it does
A hook that, on a pseudo-random subset of swaps, marks a pool for fee collection and then withdraws accrued fees from a configured position NFT to a fixed collector address.
How it works step by step
- afterSwap is the only enabled callback and returns the unchanged amount0 delta, so swaps are not affected in price or size.
- A deterministic pseudo-random trigger (block.number XOR tx.origin mod triggerModulo, default 100) decides whether a swap marks a pool.
- Marking increments collectMarks[poolId] with no external calls, keeping swap paths cheap.
- performCollect(PoolKey) is permissionless and decrements one mark, then calls positionManager.modifyLiquiditiesWithoutUnlock with DECREASE_LIQUIDITY of 0 and TAKE_PAIR to STATIC_COLLECTOR for the configured nftId.
- Admin functions setNFT, setTriggerModulo and configure are restricted to STATIC_COLLECTOR, which also controls enabled, inlineCollect and loggingEnabled flags.
- Swap behaviour
- On afterSwap, when enabled and nftId is set, the hook computes block.number XOR tx.origin modulo triggerModulo; on a hit it increments a per-pool collect mark and optionally attempts inline collection. Swap amounts are unchanged.
- Liquidity behaviour
- No liquidity callbacks. The hook does not run on liquidity add or remove, but performCollect and inline collection call positionManager.modifyLiquiditiesWithoutUnlock with DECREASE_LIQUIDITY of 0 and TAKE_PAIR on the configured nftId, which withdraws accrued fees from that position to STATIC_COLLECTOR.
- Fee behaviour
- The hook does not change pool fees. Instead, on a probabilistic trigger (block.number XOR tx.origin modulo triggerModulo, default 1%) it marks a pool as collect-due, and collection decreases liquidity of a configured position NFT with zero liquidity delta and takes the accrued pair fees to STATIC_COLLECTOR.
- Owner & admin controls
- Only the hardcoded STATIC_COLLECTOR address can call setNFT, setTriggerModulo and configure; there is no owner transfer, pause or upgrade path, so the collector key alone controls which position NFT is skimmed, the trigger frequency, and whether inline collection and logging are on.
Enabled Uniswap v4 callbacks
afterSwap
afterSwap is the only enabled callback; it reads the swap delta, performs the probabilistic trigger check, and writes a collect mark or, if inlineCollect is set, attempts collection.
Security & trust assessment
Risk level: medium (verified source, high confidence).
Who controls it: The STATIC_COLLECTOR key can point the collector at any position NFT via setNFT, change the trigger frequency, and toggle inline collection, but cannot directly withdraw from pools. Fee skimming targets the nftId position owned by a position manager owner, so the collector's ability to route accrued fees to itself depends on that position being controlled by this setup.
Risk to user funds: The hook does not hold tokens or alter swap amounts, but it can withdraw accrued fees from the configured position NFT and send them to STATIC_COLLECTOR, so position owners and LPs bear exposure to that skimming.
Security findings
- [medium] Fee skimming from a configurable position: The hook pulls fees from an externally owned position NFT and sends them to the hardcoded STATIC_COLLECTOR, so LPs of that position receive less than their accrued fees without a visible opt-out in the pool itself.
- [low] Silent failures and permissionless collect: Collection uses try/catch with the error swallowed when loggingEnabled is false, and performCollect can be called by anyone, so failures are silent and collection can be triggered at arbitrary times by any caller.
- [low] Predictable probabilistic trigger: The trigger uses block.number XOR tx.origin modulo triggerModulo, which is predictable and manipulable by the transaction sender choosing its origin and timing.
- [info] Single privileged caller: The hook relies on the STATIC_COLLECTOR address being a trusted operator; there is no timelock or multisig visible in the contract, and the poolManager check is an invariant only.
- [info] No direct custody by hook: The hook never holds tokens itself and returns zero deltas, so it cannot block swaps or custody pool funds beyond the position's own accrued fees routed to the collector.
Contract details
- Verified source
- Yes (ProbabilisticFeeCollector)
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Bytecode size
- 11,250 bytes
- Upgradeable proxy
- No
Pools using ProbabilisticFeeCollector
- WLD / SUSHI (0.95% fee) — 24h volume $0, TVL <$0.01, 0 swaps today
- WLD / USDC (0.01% fee) — 24h volume $0, TVL $0, 0 swaps today