QuantAMM

QuantAMM
49,600 OP
View results
Submission Details
Severity: low
Invalid

Off-by-One Error in Deposit Restriction for `addLiquidityProportional`

Summary

The addLiquidityProportional() function aims to restrict users to 100 deposits to prevent potential DoS or resource exhaustion issues. However, due to an off-by-one error, users can still add liquidity even after making 100 deposits.

if (poolsFeeData[pool][msg.sender].length > 100) {
revert TooManyDeposits(pool, msg.sender);
}

This condition fails to block users when they have exactly 100 deposits, contradicting the intended restriction.

Vulnerability Details

  • The off-by-one error allows users to bypass the limit of 100 deposits by making a 101st deposit.

  • The issue arises because the condition uses > instead of >= to enforce the deposit limit.

Impact

Tools Used

Manual Review

Recommendations

Fix the condition

if (poolsFeeData[pool][msg.sender].length >= 100) {
revert TooManyDeposits(pool, msg.sender);
}
Updates

Lead Judging Commences

n0kto Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

invalid_Uplift_101_deposit_strict_equal

Only 1 more NFT won’t have any impact. Informational.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!