<!-- canonical: https://0xsimao.com/findings/mitosis-redeem-queue-resolve-range -->

# RedeemQueue::getAvailableResolveRange() incorrectly returns false if from == count - 1

Medium · Three Sigma · Cross-chain liquidity layer 1 · 25th June, 2024

Finding 3S-Mitosis-M04 of the Mitosis security review.

- Protocol: https://mitosis.org/
- Report: /reports/mitosis
- Source: https://cdn.sanity.io/files/qoqld077/production/b6b3bd7bb47407d99e76abb7c6dc615c1db5018e.pdf

---

### Description

RedeemQueue::getAvailableResolveRange() returns the indices to resolve a requestor,
but returns nothing if from == count - 1. For example, this would return when from == 0
and count == 1 (there's 1 element), when it should not. This could be problematic if a user
only has 1 request and the redeem queue is disabled, it would never be able to claim until
the redeem queue is enabled again.

### Recommendation

Return if from == count. The check if (count == 0) return (0, 0, false); is also not
required, as it is covered by the other check.

### Status

Addressed in [#87756b8](https://github.com/mitosis-org/evm/pull/184/commits/87756b806a0e6b46457fc6fefac3d2e2b0781780).

---

Related findings:

- [Queue MapleWithdrawalManager may revert due to honest removeShares() or manual redeem calls](https://0xsimao.com/findings/maple-finance-ii-queue-withdrawal-shares-redeem): Maple Withdrawal Manager
