updateWithdrawalBatchIdCutoff:::WithdrawalPool allows the withdrawalBatchIdCutoff to be set one batch earlier than intended.
In the updateWithdrawalBatchIdCutoff function, the loop that updates the newWithdrawalBatchIdCutoff:
The issue heres that newWithdrawalBatchIdCutoff is set to i instead of i + 1. This causes the cutoff to be set to the batch just before the last batch where all withdrawals have no funds remaining rather than the intended last batch.
-- assume there are 5 withdrawal batches (indexed 0 to 4).
-- Batches 0, 1, and 2 have all withdrawals fully processed (no funds remaining).
-- Batch 3 is the first batch with remaining funds.
-- the correct newWithdrawalBatchIdCutoff should be 3.
-- but due to ths bug, it will be set to 2.
This results in the withdrawalBatchIdCutoff being set one batch earlier than intended.
Manual review
Update updateWithdrawalBatchIdCutoff to correctly set the newWithdrawalBatchIdCutoff:
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.