The Like struct in LikeRegistry.sol contract is defined but never used. Instead of storing Like objects, the contract only keeps a likes mapping.
Additionally, the timestamp field is included in the struct but is never utilized. This results in unused storage definitions without functional benefits.
The struct is never instantiated or stored in the LikeRegistry::likeUser function or elsewhere. Instead, the contract uses a mapping:
Increased contract size due to unused code.
Unnecessary complexity in the contract structure.
Missed opportunity to store valuable data (e.g., timestamps for tracking likes).
Manual code review
Remove the Unused Struct
If Like is not required, remove it entirely to reduce contract size and improve readability.
Implement the Struct Properly (If Needed)
If tracking likes with timestamps is useful, modify likeUser to store Like objects:
3.Use timestamp for Feature Enhancements
If timestamps are needed, implement logic for time-based actions.
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.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.