The LiquidationPool::consolidatePendingStakes is deleting the elements of the array it is looping over.
The logic structure should be elegant and should avoid any potential conflicts on the data. in the consolidatePendingStakes, the logic is operating over the
storage variable and in this process, it is also deleting elements from the array.
The code structuring and processing is not gas efficient and ideally, as a general principle, it is not a good idea to delete elements from the data collection that is being operated upon. Instead, qualify the list of elements to be deleted can be kept in a memory variable. Once the processing is completed on the main data collection, using the memory variable, the qualified elements can be deleted.
Also, the logic is not gas efficient.
Gas inefficient and incorrect approach
Manual review
store the delectable elements in a separate set and delete them at the end.
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.