The function deleteHolder
deletes an address from the array holders
, but while deleting the function will replace the item with last item and then pop off the last element of array.
Here are 2 cases that are needed to be considered.
Case - 1:
If Holders are unique atleast according the functionality present in the code, then it is exhaustive to iterate through the loop if the array is long.
Case - 2:
If the holders are not meant to be unique, then there will be high chances of skipping the last item which will be swapped in place of the removing item.
Manual Review
Case - 1:
Holders are unique
Case - 2:
If Holders are not unique then, use the same logic of deletion as consolidatePendingStakes
function.
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.