The claimFees
caller attempting to claim all protocol fees is reverted
#345
Labels
bug
Something isn't working
duplicate-45
edited-by-warden
grade-b
Q-14
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
🤖_34_group
AI based duplicate group recommendation
satisfactory
satisfies C4 submission criteria; eligible for awards
Lines of code
https://github.com/code-423n4/2024-02-uniswap-foundation/blob/5298812a129f942555466ebaa6ea9a2af4be0ccc/src/V3FactoryOwner.sol#L193-L195
https://github.com/Uniswap/v3-core/blob/d8b1c635c275d2a9450bd6a78f3fa2484fef73eb/contracts/UniswapV3Pool.sol#L856-L865
Vulnerability details
Description
The
claimFees
function is tasked with claiming protocol fees by paying outPAYOUT_TOKEN
instead of fees collected by the pool. It includes validation to protect the caller from receiving less amount of tokens than what was requested.Due to the UniswapV3Pool collecting protocol fees, it transfers 1 wei less if the caller attempts to collect all protocol fees. At this point, this could potentially disrupt the
claimFees
function in V3FactoryOwner.Exmaple
collectProtocol
function in UniswapV3Pool returns 1000e6 - 1 USDC and 1000e6 - 1 USDT, and the transaction is reverted because the returned amount is less than the requested amount.Impact
Proof of Concept
POC setup
foundry.toml:
forge test --mt test_claimFeesRevertIfRequestedMaximumAmount
Tools Used
Manual Review
Foundry
Recommended Mitigation Steps
Assessed type
DoS
The text was updated successfully, but these errors were encountered: