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

Discrepancy Between Documentation and Code for `Result Enumeration

Summary

Bug Report for Smart Contract Audit

Description:

A discrepancy was found between the documentation and the code in the smart contract regarding the enumeration of match results.

Documentation:

The documentation states the following possible outcomes for each match:

  • First team win (prediction First)

  • Second team win (prediction Second)

  • A tie (prediction Draw)

Code:

The code defines the Result enum as
enum Result {pending, First, Draw, Second }

Vulnerability Details

The order of the outcomes in the code does not match the order described in the documentation. Specifically, the documentation lists the results as First, Second, and Draw, while the code lists them as First, Draw, and Second.

Impact

  • This inconsistency could lead to confusion and errors in understanding or utilizing the contract, especially when interpreting or predicting match results based on the provided documentation.

  • Users or other developers might assume the order in the code matches the documentation, leading to potential mispredictions or incorrect logic implementations.

Tools Used
Manual Review

Recommendations

  • Update the documentation to reflect the actual order of the Result enum in the code:

    • First team win (prediction First)

    • A tie (prediction Draw)

    • Second team win (prediction Second)

OR

  • Modify the code to match the documentation:

    solidity

    Copy code

    enum Result { Pending, First, Second, Draw }

Ensuring consistency between the documentation and the code is crucial for clarity and proper functionality of the smart contract.

Updates

Lead Judging Commences

NightHawK Lead Judge 11 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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