Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: low
Invalid

Lack of function to update predictions as specified on project's documentation

Description:

Documentation states that "No second prediction fee is due if any Player desires to change an already paid prediction". However, there's no way to change a prediction, only to make a new one. If that's the case, it shouldn't charge for a predictionFee twice.

Impact:

Players can't update their predictions without having to pay again the fee for the prediction.

Recommended Mitigation:

Implement the following changes to ThePredicter::makePrediction:

function makePrediction(uint256 matchNumber, ScoreBoard.Result prediction) public payable {
+ // Check if the player has already paid for this prediction
+ if (!scoreBoard.playersPredictions(msg.sender).isPaid[matchNumber]) {
+ if (msg.value != predictionFee) {
+ revert ThePredicter__IncorrectPredictionFee();
+ }
+
+ // Mark the prediction as paid in the ScoreBoard contract
+ scoreBoard.confirmPredictionPayment(msg.sender, matchNumber);
+ } else {
+ require(msg.value == 0, "No fee required for changing an already paid prediction");
}
if (block.timestamp > START_TIME + matchNumber * 68400 - 68400) {
revert ThePredicter__PredictionsAreClosed();
}
- scoreBoard.confirmPredictionPayment(msg.sender, matchNumber);
scoreBoard.setPrediction(msg.sender, matchNumber, prediction);
}
Updates

Lead Judging Commences

NightHawK Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Appeal created

lulox Submitter
about 1 year ago
NightHawK Lead Judge
about 1 year ago
NightHawK Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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