ProbabilisticFeeCollector on World Chain
Uniswap v4 Hook Contract 0x2da1f76d0c1dfbba4dd3f83568453346f5578040 on World Chain · Fee sharing · Verified contract
- Volume (24h)
- $0
- Value locked (TVL)
- $0
- All-time volume
- $9.61
- Pools using this hook
- 1
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 6
What it does
After roughly 1 in 100 swaps, this hook tries to collect accrued fees from a designated Uniswap v4 position and send them to a fixed collector address.
How it works step by step
- Gates collection on nftId being non-zero so it stays inactive until configured.
- Uses block.prevrandao % triggerModulo (100) to randomly trigger collection on about 1% of swaps.
- Calls PositionManager.modifyLiquiditiesWithoutUnlock with DECREASE_LIQUIDITY (zero amount) and TAKE_PAIR to pull accrued fees.
- Sends collected currencies to the hardcoded STATIC_COLLECTOR address.
- Allows only STATIC_COLLECTOR to update the tracked NFT id via setNFT.
- Wraps the collection call in try/catch so failures do not revert the swap.
- Swap behaviour
- On each swap, if nftId is set and a pseudo-random check on block.prevrandao hits (1 in 100), it attempts a fee collection; the swap itself is unaffected and no fees are altered.
- Liquidity behaviour
- No liquidity callbacks. The hook does not add or remove liquidity itself; it only triggers a fee-collection call through PositionManager for the position identified by nftId.
- Fee behaviour
- The hook never sets or changes swap fees. On roughly 1 in 100 swaps (block.prevrandao % 100 == 0, after nftId is set), it calls the PositionManager to decrease liquidity on a configured position with a zero liquidity amount and then take the pair of currencies to STATIC_COLLECTOR, which collects accrued fees from that position.
- Owner & admin controls
- No owner or pause role. Only STATIC_COLLECTOR (hardcoded address) can call setNFT to point the hook at a position NFT id; nftId and triggerModulo are otherwise fixed by code (triggerModulo is a public state variable with no setter in the ABI, so it stays at 100).
Enabled Uniswap v4 callbacks
afterSwap
afterSwap is the only enabled callback; it is used to probabilistically trigger a fee collection from a designated position after swaps occur in the pool.
Security & trust assessment
Risk level: low (verified source, high confidence).
Who controls it: The only privileged actor is the hardcoded STATIC_COLLECTOR address, which can set any nftId via setNFT. It could point the hook at a position it does not control or at an id that yields no fees, but it cannot directly move user funds through the hook. Its collected fees go to itself via the take call.
Risk to user funds: The hook returns a zero-delta-style afterSwap result (returns delta.amount0 as int128 but no return-delta permission is enabled, so it does not affect balances). It does not hold tokens. Collected fees flow from the configured position to STATIC_COLLECTOR, not to the pool or traders, so user funds in the pool are not directly taken by the hook, but LPs of the targeted position lose accrued fees to the collector.
Security findings
- [low] Weak randomness for trigger: block.prevrandao is a validator-influenced value, so the 1% trigger is predictable and can be targeted by proposers who can see or influence it, though the only effect is timing of fee collection.
- [info] Silent failure on collection: The try/catch silently swallows any failure of modifyLiquiditiesWithoutUnlock, so collection failures go unnoticed and no events are emitted.
- [info] No event emission or input validation in setNFT: Pool initialization and swap callbacks are not gated beyond the PoolManager check in BaseHook, and setNFT has no event or zero-address validation; setNFT(0) disables the hook.
Contract details
- Verified source
- Yes (ProbabilisticFeeCollector)
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Bytecode size
- 7,608 bytes
- Upgradeable proxy
- No
Pools using ProbabilisticFeeCollector
- WLD / SUSHI (0.95% fee) — 24h volume $0, TVL $0, 0 swaps today