DatingDapp

AI First Flight #6
Beginner FriendlyFoundrySolidityNFT
EXP
View results
Submission Details
Impact: low
Likelihood: high
Invalid

Unused `Like` Struct in `LikeRegistry`

Unused Like Struct in LikeRegistry


Description

LikeRegistry defines a Like struct:

struct Like {
address liker;
address liked;
uint256 timestamp;
}

However, the contract never instantiates, stores, or returns this struct. The active like/match flow relies on likes mapping and matches arrays instead.

This leaves Like as unused code, which can mislead reviewers about expected storage design and increases code noise.


Risk

Likelihood: High

The unused declaration is always present in the current implementation.

Impact: Low

This is a maintainability and clarity issue, not a direct exploitable vulnerability.


Proof of Concept

Static usage check:

rg -n "struct Like|Like\b" src/LikeRegistry.sol

Expected output pattern shows only the declaration location and no operational usage.

10: struct Like {

Recommended Mitigation

Remove the unused struct if it is not part of near-term functionality:

- struct Like {
- address liker;
- address liked;
- uint256 timestamp;
- }

If historical like records are planned, implement full storage and retrieval paths that actually use this structure.

Updates

Lead Judging Commences

ai-first-flight-judge Lead Judge about 5 hours ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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

Give us feedback!