The _finalizeWithdrawals function is responsible for finalizing the accounting of queued withdrawals in the system after withdrawals are processed. However, when sharesToWithdraw > sharesRemaining, as the queuedWithdrawals[i] struct is not updated to reflect the withdrawal of all remaining shares.
when sharesToWithdraw > sharesRemaining, the function processes a full withdrawal for the current entry in the queuedWithdrawals array and advances to the next withdrawal (indexOfNextWithdrawal = i + 1).
However, the queuedWithdrawals[i] struct is not updated to reflect that the remaining shares have been fully withdrawn. As a result:
The sharesRemaining in the queuedWithdrawals[i] struct is left unchanged, inaccurately indicating that some shares are still available for withdrawal.
The contract's internal state will not accurately reflect the actual number of shares left for withdrawal.
manual review
When sharesToWithdraw exceeds sharesRemaining, update the struct to set sharesRemaining to 0 and adjust partiallyWithdrawableAmount accordingly.
}
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.