Trick or Treat

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

Absence of check for if treat already exists

Summary

The addTreat() function does not include check to verify treat existence.

Vulnerability Details

The addTreat() function defined in line 37 of the SpookySwap contract violates the Checks, Effects And Interactions pattern. This gives room for multiple treats with the same name or setting treat cost to zero without removing the treat.

Impact

Since the treat cost could be manipulated without removing the treat, treats could be swapped for zero cost. This harms the protocol and defeats its purpose

Tools Used

Manual Review

Recommendations

The addTreat() function should include a check to ensure treat existence before adding to the treat array.

Updates

Appeal created

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

[invalid] Duplicate treats

The function `addTreat` is called by the owner. The owner is trusted. There will be no duplicates.

Support

FAQs

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