QuantAMM

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

Incorrect Revert Error in `removeLiquidityProportional` Function

Summary

The removeLiquidityProportional function in the contract contains a logic flaw where the wrong revert error (WithdrawalByNonOwner) is used when checking if the caller has no deposit records for a specific pool. This issue can mislead developers analyzing the function’s logs, as the error message implies ownership issues rather than the absence of deposit history. Correct revert error handling is crucial for clarity, debugging, and overall contract reliability.

Vulnerability Details

uint depositLength = poolsFeeData[pool][msg.sender].length;
if (depositLength == 0) {
revert WithdrawalByNonOwner(msg.sender, pool, bptAmountIn);
}

The issue lies in using the WithdrawalByNonOwner error for a condition unrelated to ownership.

Impact

Misleading error messages complicate debugging and understanding contract behavior.

Tools Used

Manual Review

Recommendations

Introduce a more appropriate revert error

Updates

Lead Judging Commences

n0kto Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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

Give us feedback!