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

`ScoreBoard::isEligibleForReward` has a invalid verification that the user may lose the reward

Description

The function ScoreBoard::isEligibleForReward has a invalid verification that the user may lose the reward because verify if user has a more than one prediction fee (> 1), but in the docs the user could be at least one prediction fee (>=1), as we can se below:

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

Impact

If the player has only one prediction fee paid he will not win the rewards and loss the prize.

Recommended Mitigation

In the src/ScoreBoard.sol update the function check:

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.