Trick or Treat

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

Incorrect Documentation Comment in `SpookySwap::trickOrTreat` Function Refers to Non-Existent Function

Relevant Github Link: https://github.com/Cyfrin/2024-10-trick-or-treat/blob/9cb3955058cad9dd28a24eb5162a96d759bfa842/src/TrickOrTreat.sol#L91

Description:
The SpookySwap::trickOrTreat function contains a misleading comment that refers to a non-existent function, SpookySwap::fellForTrick, which is not implemented in the contract. This incorrect reference can lead to confusion for developers or users reading the documentation.

Here is the problematic code snippet:

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

The correct function to finish the transaction is actually resolveTrick(uint256 tokenId), not fellForTrick(). This documentation error can result in misunderstanding of how to properly interact with the smart contract, potentially leading to failed attempts to complete transactions.

Impact: This misleading comment may cause developers or users to attempt calling a function that does not exist (fellForTrick()), leading to confusion, frustration, or unnecessary debugging efforts. If left uncorrected, this could also impact the contract's perceived reliability and developer experience.

**Recommended Mitigation:**Update the comment to reference the correct function, ensuring accurate documentation and preventing confusion:

- // User needs to call fellForTrick() to finish the transaction
+ // User needs to call resolveTrick(uint256 tokenId) to finish the transaction

By providing the correct function name (resolveTrick(uint256 tokenId)), the documentation will accurately reflect how the contract works, improving clarity and usability for developers and users interacting with it.

Updates

Appeal created

bube Lead Judge 8 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.