The getBatchIds
function in the WithdrawalPool
contract incorrectly calculates batch IDs for withdrawal requests. This issue arises when withdrawal IDs from previous batches are provided, leading to incorrect batch ID assignments. This bug can cause incorrect data retrieval and potential misbehavior in other functions relying on this data.
Invoke getBatchIds
with Previous Batch IDs: Call the getBatchIds
function with withdrawal IDs that belong to batches before the current withdrawalBatchIdCutoff
.
Notice that the function assigns the current withdrawalBatchIdCutoff
as the batch ID for these withdrawal IDs, which is incorrect.
Expected Behavior:
The function should correctly identify and return the batch IDs corresponding to each withdrawal ID, even if they belong to batches before the current withdrawalBatchIdCutoff
.
Incorrect Data Retrieval: The function returns incorrect batch IDs, which can lead to incorrect data being displayed on the frontend.
Misbehavior in Dependent Functions: Other functions(getFinalizedWithdrawalIdsByOwner()
) that rely on the batch IDs returned by getBatchIds
may also misbehave, leading to potential errors in withdrawal processing or data presentation.
Manual review
Here's a potential fix for the issue:
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.