<!-- canonical: https://0xsimao.com/findings/mitosis-redeem-revert-filled-indexes -->

# BasicVault::getRedeemRequestOf() will revert as the redeem requests are filled with the wrong indexes

Low/Info · Three Sigma · Cross-chain liquidity layer 1 · 25th June, 2024

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

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

---

### Description

In BasicVault::getRedeemRequestOf(), redeemRequests is filled with the requests from
the queue from the IndexByRequestor struct offset, which stores the last non resolved
request. In the loop where redeemRequests is assigned, it does redeemRequests[i] = ...,
but i starts at from, which may not be 0 and revert in this case.

### Recommendation

Replace the code to redeemRequests[i - from] = ....

### Status

Addressed in [#99fee9a](https://github.com/mitosis-org/evm/pull/205/commits/99fee9ad8a1a1c4cf99f21eb96d120392b7fbb5a).

---

Related findings:

- [`createCommonProjectIDAndDeploymentRequest()` hardcodes request id index to 0, leading to lost requests for users](https://0xsimao.com/findings/crestal-network-common-project-hardcodes-index): Crestal Network
- [`SyrupBitcoinRouter::requestRedeem()` could also check if the asset picked to redeem has liquidity](https://0xsimao.com/findings/maple-finance-iii-syrup-bitcoin-redeem-picked): Maple Withdrawal Queue
- [Slippage protection could be added to LoopedVault::requestWithdraw() in case of black swan event](https://0xsimao.com/findings/yieldoor-iii-slippage-withdraw-black-swan): Yieldoor LoopedVault Update
- [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
