DatingDapp

First Flight #33
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Severity: low
Invalid

Function Parameter Shadowing ERC721 name() Causes Potential Misuse

Summary

The mintProfile function in the smart contract has a variable shadowing issue where the name parameter conflicts with the name() function inherited from ERC721. This can cause unintended behavior and make the contract difficult to maintain.

Vulnerability Details

  • The ERC721 contract has a function name() that returns the token collection's name.

  • The mintProfile function introduces a parameter called name, which shadows the inherited name() function.

  • Because of this, any reference to name within mintProfile will point to the function parameter instead of the intended ERC721.name() function.

Impact

  1. Potential Misuse of name()

    • Any calls to name() within mintProfile or related functions may not behave as expected.

  2. Confusion in Code Maintenance

    • Developers might expect name to refer to ERC721.name(), leading to debugging challenges and potential errors.

  3. Unintended Behavior in Inheritance

    • If other functions rely on ERC721.name(), they might not work correctly due to the shadowing.

Tools Used

Solidity Visual Developer

Recommendations

Rename the name to _name parameter in mintProfile to avoid conflicts.

Updates

Appeal created

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

Suppositions

You have to point a real root-cause leading to a bug. "If, may, could, unexpected behavior, incoherent" are not describing a real concrete bug. Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.

Support

FAQs

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