getBatchIds return the batchId for a given withdrawalId, but if a withdrawalId doesn't exist then it will return 0 batchId, as the codebase is not handling for those cases where withdrawalId doesn't exist
Inside the first loop we have a variable batchId and after the end of second loop we are setting batchIds[i] = batchId;. If withdrawalId doesn't exist then batchId value will be set and the default value is 0. So it will set 0.
Example:-
-> user passes the argument [2,5,20]
-> withdrawalId 2 is in the batch1
-> withdrawalId 5 is in the batch2
-> withdrawalId 20 doesn't exist but batchId will be 0
-> final return values will be [1,2,0]
It's returning the value 0 instead of reverting
Manual Review
revert when withdrawalId doesn't exist
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.