QuantAMM

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

Deposit are done in FILO not FIFO

Summary

The UpliftOnlyExample contract implements LIFO (Last In First Out) withdrawal order instead of the intended FIFO (First In First Out) design (specified in QuantAMM team example audit objective doc), forcing users to withdraw their most recent deposits first.

Vulnerability Details

The onAfterRemoveLiquidity function processes withdrawals starting from the most recent deposit by iterating from the end of the array:

for (uint256 i = localData.feeDataArrayLength - 1; i >= 0; --i) {

This contradicts the documented FIFO design and prevents users from accessing their earlier deposits that may have more favorable fee conditions until all later deposits are withdrawn first.

Impact

  • Users cannot selectively withdraw older deposits with potentially lower fees

  • Active LPs are forced to withdraw recent deposits first even if they prefer to maintain those positions

Tools Used

Manual review

Recommendations

1- Modify the withdrawal loop to process deposits in FIFO order:

for (uint256 i = 0; i < localData.feeDataArrayLength; i++) {

2- Update the data structure to maintain FIFO order during deposits and withdrawals

3- Alternatively, if LIFO is actually intended, update the documentation to accurately reflect the implementation

Updates

Lead Judging Commences

n0kto Lead Judge 11 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!