Incomplete state update in function withdraw
The issue of incomplete state update occurs in the else
block of the main if
statement. Let's break it down:
When withdrawalId > batch.indexOfLastWithdrawal
, the function enters this else
block.
It adds withdrawal.partiallyWithdrawableAmount
to amountToWithdraw
.
It then sets queuedWithdrawals[withdrawalId].partiallyWithdrawableAmount
to 0.
However, it does not update queuedWithdrawals[withdrawalId].sharesRemaining
.
The function is withdrawing the partiallyWithdrawableAmount
, but not adjusting the sharesRemaining
. This leads to an inconsistent state where the withdrawn amount doesn't match the remaining shares.
If this function is called again for the same withdrawal, the partiallyWithdrawableAmount
will be 0, but the sharesRemaining
will still be non-zero. This could lead to incorrect calculations in future operations.
Manual Review
Update both partiallyWithdrawableAmount
and sharesRemaining
.
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.