Platform: Code4rena
Start Date: 23/02/2024
Pot Size: $92,000 USDC
Total HM: 0
Participants: 47
Period: 10 days
Judge: 0xTheC0der
Id: 336
League: ETH
Rank: 18/47
Findings: 1
Award: $694.30
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: CodeWasp
Also found by: 0xdice91, 0xlemon, Aamir, Al-Qa-qa, AlexCzm, BAHOZ, Bauchibred, Breeje, DadeKuma, Fassi_Security, PetarTolev, Shield, SpicyMeatball, Trust, ZanyBonzy, cheatc0d3, gesha17, haxatron, imare, jesjupyter, kutugu, lsaudit, marchev, merlinboii, nnez, osmanozdemir1, peanuts, radev_sw, twicek, visualbits
694.2987 USDC - $694.30
Fee claimers can get a suboptimal payout, or claims can be reverted
Users can call claimFees() on factory owner for a specific pool by passing the requested amounts and paying the payout amount.
Manually passing the requested token amounts may lead suboptimal results causing the fee claimer to get less then they should get or reverting the tx altogether if they ask for the actual maximum amount because of the gas savings on the pool contract.
protocolFees.token0 = 1e18 protocolFees.token1 = 2e18
Scenario 1: User calls claimFees with following params because of a calculation mistake _amount0Requested = 1e17 _amount1Requested = 2e17 User receives less than they should get and looses value
Scenario 2: User calls claimFees with max of the fee amount collected _amount0Requested = 1e18 _amount1Requested = 2e18 Because of the gas savings here: https://github.com/Uniswap/v3-core/blob/d8b1c635c275d2a9450bd6a78f3fa2484fef73eb/contracts/UniswapV3Pool.sol#L857 Although the call was valid, claim reverts with V3FactoryOwner__InsufficientFeesCollected
Scenario 3: User calls claimFees with max of the fee amount collected - 1 _amount0Requested = 1e18 - 1 _amount1Requested = 2e18 - 1 And if some large swap happens while the claim was in the mempool, the user will leave some fees in the pool
Manual review
feeAmounts - 1
Math
#0 - c4-judge
2024-03-07T12:42:39Z
MarioPoneder marked the issue as duplicate of #34
#1 - c4-judge
2024-03-14T01:38:37Z
MarioPoneder marked the issue as satisfactory
#2 - c4-judge
2024-03-26T23:00:07Z
MarioPoneder marked the issue as grade-b