Dria

Swan
NFTHardhat
21,000 USDC
View results
Submission Details
Severity: low
Invalid

Documentation Mismatch: `getListingPrice` Function Description Incorrect

Summary

The getListingPrice function in the Swan contract is implemented to return the asset price of the specified listing. However, the documentation comments (NatSpec) incorrectly suggest that this function returns the asset's status, leading to potential misunderstandings for users.

Vulnerability Detail

The function is defined as follows:

  • Actual Functionality: The function returns the price of the asset associated with the given address.

  • Documentation Error: The NatSpec comments state that it returns the asset status, which is inaccurate and misleading.

This discrepancy can lead to confusion among developers and users who may assume they are querying the asset's status rather than its price, impacting their interaction with the contract.

Impact

This mismatch in documentation can result in:

  • Misleading Assumptions: Users may incorrectly believe they can determine the asset's status through this function, leading to reliance on an incorrect understanding of the contract's functionality.

  • Increased Complexity: Users may need to refer to additional documentation or functions to understand the actual status of an asset, complicating the user experience.

Tool used

Manual Code Review

Recommendation

It is recommended to update the NatSpec comments for the getListingPrice function to accurately reflect its purpose, specifying that it returns the price of the asset instead of its status. This will help ensure clarity and prevent potential misunderstandings for users interacting with the contract.

Updates

Lead Judging Commences

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