Trick or Treat

First Flight #27
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: low
Invalid

Incorrect Comment References Non-Existent Function for Transaction Completion

01. Relevant GitHub Links

02. Summary

A misleading comment in the contract suggests that the function fellForTrick() should be called to finish a transaction, while in reality, the function to finalize the transaction is resolveTrick(). This incorrect comment could cause confusion for developers and users, leading to potential misuse or unintended behavior.

03. Vulnerability Details

The following comment incorrectly indicates that users should call fellForTrick() to complete the transaction. The actual function that performs this task is resolveTrick(). Incorrect documentation can lead to errors in function usage, especially for those not familiar with the contract’s full codebase.

// User needs to call fellForTrick() to finish the transaction

In cases where developers or users rely on the comment rather than the function definitions, this can cause unnecessary debugging and frustration.

03. Impact

  • Potential Misuse: Developers or users may attempt to call fellForTrick() to finish a transaction, which could lead to failure if they don’t realize resolveTrick() is the correct function.

  • Increased Debugging and Maintenance Time: Misleading comments can lead to confusion, increased debugging time, and potential misinterpretation of the contract’s intended functionality.

04. Proof of Concept

05. Tools Used

Manual Code Review and Foundry

06. Recommended Mitigation

  1. Update the Comment to Reference the Correct Function: Modify the comment to reference resolveTrick() instead of fellForTrick().

// User needs to call resolveTrick() to finish the transaction
Updates

Appeal created

bube Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

[invalid] Wrong comment

This is an informational issue.

Support

FAQs

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