The setPrediction
function incorrectly resets the predictionsCount
to 0 every time it's called, potentially leading to incorrect reward calculations.
In the setPrediction
function, the line playersPredictions[player].predictionsCount = 0;
resets the count of paid predictions to zero before recalculating it. This occurs every time a prediction is set, even if it's updating an existing prediction.
This bug leads to players losing their eligibility for rewards if they update their predictions, as their predictionsCount
might be reset to a lower number than it should be. It could also allow players to manipulate their prediction count by repeatedly setting predictions.
Manual code review
Remove the line playersPredictions[player].predictionsCount = 0;
from the setPrediction
function. Instead, only increment the count when a new prediction is made and paid for.
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.