In the claimSingleReward(uint256 _index) function, the delete operation is used to remove a reward from the rewardsOwned array. This operation zeroes out the element but does not shrink the array, which leads to the creation of gaps. Over time, this can result in a sparse array that causes inefficiencies, especially when iterating over or accessing elements.
Gaps in the array can cause incorrect or inefficient behavior when accessing rewards.
Over time, this may also lead to higher gas costs or unexpected contract behavior.
This can expose the contract to potential reentrancy attacks if an attacker manipulates the array’s state before it’s fully settled.
manual
Replace the delete operation with a safe array removal pattern, such as swapping the element to be deleted with the last element and then using .pop() to remove it. This ensures the array remains contiguous and properly managed.
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.