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

Incorrect Match Number Handling in Predictions

Summary

The setPrediction function in the smart contract does not clearly indicate that match numbers are zero-indexed. As a result, users might mistakenly pass in 1 for the first match. This mismatch can cause the prediction to be recorded for the wrong match, leading to inaccurate results and potential losses for players.

Impact

Players could lose their prediction fees and potential winnings due to predictions being recorded for the wrong match.

Tools Used

Recommendations

Documentation: Clearly state in the document that match numbers start from 0.

Input Validation: Add validation to ensure users understand the zero-based index. For example, consider adding a check that explicitly informs the user if they attempt to use a one-based index.

Updates

Lead Judging Commences

NightHawK Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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