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

Player with only one correct paid prediction is not eligible for a reward

Relevant GitHub Links

https://github.com/Cyfrin/2024-07-the-predicter/blob/main/src/ScoreBoard.sol#L97

Summary

One condition in ScoreBoard::isEligibleForReward function is that player need to make more then one prediction to be eligable for reward. In project description (README.md) there is description that player with one correct paid prediction should be eligable for reward: who paid at least one prediction fee.

One condition in the ScoreBoard::isEligibleForReward function is that a player needs to make more than one prediction to be eligible for a reward. In the project description (README.md), it states that a player with one correct paid prediction should be eligible for a reward: prize fund, which after the end of the tournament is distributed among all Players who paid at least one prediction fee.

Impact

A player with one correct paid prediction can't withdraw their reward because they are not eligible.

Recommendations

To fix this, we should change the condition in ScoreBoard::isEligibleForReward to include players with predictionsCount greater than or equal to 1.

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.