DatingDapp

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

Unused Like Struct in LikeRegistry Contract

Summary

The contract defines a Like struct intended to store details of likes (e.g., liker, liked, and timestamp), but this struct is never used within the contract. Instead, the contract utilizes a mapping to track likes, making the struct redundant.

Vulnerability Details

  • Redundant Code: The Like struct is defined but not referenced anywhere in the contract's logic.

  • Potential for Confusion: Future developers might assume that the struct is used to capture additional metadata, leading to misunderstandings about the contract's functionality.

  • Maintenance Overhead: Unused code can increase the complexity of the contract, potentially complicating future audits and upgrades.

Impact

  • No Direct Security Risk: The presence of the unused struct does not introduce a direct security vulnerability.

  • Increased Complexity: It unnecessarily increases the contract's codebase, which can hinder code clarity and maintenance.

  • Misleading Assumptions: Developers may incorrectly assume that the contract is tracking additional metadata (like timestamps) for likes, leading to potential errors in future feature implementations or audits.

Tools Used

Manual code review

Recommendations

  • Remove Unused Struct: Eliminate the Like struct if there is no intention to track additional metadata, thus simplifying the codebase.

  • Integrate if Needed: If tracking metadata is desired, refactor the contract to incorporate the Like struct into the relevant logic.

  • Code Cleanup: Regularly review and remove any redundant or unused code to maintain clarity and reduce potential maintenance issues.

Updates

Appeal created

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

Informational or Gas

Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelyhood 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.