Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: high
Valid

Incorrect comparision in `ScoreBoard::isEligibleForReward` function , making players with 1 prediction not eligible for reward

Summary

Incorrect comparision in `ScoreBoard::isEligibleForReward` function , making players with 1 prediction not eligible for reward

Vulnerability Details

The following line of code requires a player to have more than 1 prediction to be not eligible for reward , however the documentation states that a player with one or more than one prediction should be eligible for rewards.
```javascript
function isEligibleForReward(address player) public view returns (bool) {
return
results[NUM_MATCHES - 1] != Result.Pending &&
=> playersPredictions[player].predictionsCount > 1;
}
```

Impact

The player who has made only 1 prediction in all the matches will not be eligible for rewards.

Tools Used

Manual Auditing , Slither , Aderyn

Recommendations

Make the following changes in the inequality

function isEligibleForReward(address player) public view returns (bool) {
return
results[NUM_MATCHES - 1] != Result.Pending &&
- playersPredictions[player].predictionsCount > 1;
+ playersPredictions[player].predictionsCount >= 1;
}
Updates

Lead Judging Commences

NightHawK Lead Judge 11 months ago
Submission Judgement Published
Validated
Assigned finding tags:

The eligibility criteria is wrong

Players with only one prediction cannot withdraw.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.