Skip to content
Request an audit

‹ All findings

Queue MapleWithdrawalManager may revert due to honest removeShares() or manual redeem calls

Low/InfoMaple Withdrawal Manager·Three Sigma · Institutional lending · 16th November, 20233S-MAPLE-L01

Description

The queue withdrawal manager limits the sharesToProcess in processRedemptions() to the totalShares.

This might make the call revert if non malicious users remove shares or do manual redeems.

Another concurrency issue is if the available liquidity is just enough to cover for a processRedemptions() call, but someone frontruns it and does a manual redeem.

Recommendation

Instead of reverting if the processedShares argument is bigger than totalShares, limit it:

solidity
function processRedemptions(uint256 sharesToProcess_) external override
whenProtocolNotPaused nonReentrant onlyRedeemer {
    ... uint256 cachedTotalShares_ = totalShares;
    if (sharesToProcess_ > cachedTotalShares_) sharesToProcess_ = cachedTotalShares_;
    ... }

It's trickier to solve the lack of liquidity concurrency issue, as it would require allowing partial redemptions.

Status

Addressed in #7dbcd37