Trick or Treat

First Flight #27
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: medium
Invalid

Lack of Event Emissions for Critical State Changes

Summary

Several critical state changes lack event emissions, making it difficult to track contract activity off-chain.

Vulnerability Details

Location:

  • src/TrickOrTreat.sol:setTreatCost()

  • src/TrickOrTreat.sol:addTreat()

  • src/TrickOrTreat.sol:mintTreat()

Impact

This makes it difficult for users and interfaces to track important contract changes and could lead to poor UX and missed state updates.

Tools Used

Forge

Recommendations

Add events for all critical state changes:

event TreatAdded(string indexed name, uint256 cost, string metadataURI);
event TreatCostChanged(string indexed name, uint256 oldCost, uint256 newCost);
event TreatMinted(address indexed to, uint256 indexed tokenId, string treatName);
Updates

Appeal created

bube Lead Judge 9 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.