Root Cause: The sender parameter in the _beforeSwap function is the contract address calling the PoolManager (typically the router), not the actual user address that initiated the transaction.
Impact: All users transacting through the same router share the same limit and cooldown period, rendering the anti-bot protection completely ineffective.
Normal behavior: Hook should track each real user's trading activity, including trade volume and cooldown periods, to prevent bots from mass-snatching tokens during the early stages of a token launch.
Specific issue: In the Uniswap V4 architecture, users interact with PoolManager through a router contract. When PoolManager calls the Hook's _beforeSwap, the sender parameter passed in is the router address, not the actual user.
This causes:
addressSwappedAmount[sender] records the router's cumulative trading volume
addressLastSwapBlock[sender] records the router's last trading block
All users' limits are aggregated and calculated together
Likelihood:
100% of user transactions go through the router contract
This is the standard architecture of Uniswap V4 and cannot be avoided
Impact:
Anti-bot mechanism completely failed, unable to distinguish between different users
The protocol’s core functionality is lost
Early investors cannot receive the expected protection
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.
The contest is complete and the rewards are being distributed.