Trick or Treat

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

Lack of zero rate check

Summary

Description: In the addTreat function the admin can add a new treat to the smart contract. The admin can set the price of the treat to zero.
However, the smart contract does not check the price of the treat. So, it will be impossible to setTreatCost and trickOrTreat in future.

Line of code: TrickOrTreat.sol#L38

Impact

The admin can add a treat with a zero price, but the user will not be able to mint it.

Tools Used

  • Manual code analysis

Recommendations

Add a check for the zero _rate in the addTreat function.

Updates

Appeal created

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

[invalid] Zero treat cost

The cost of the treat is set only by the owner (in the constructor, in addTreat and in setTreatCost). That means the cost of the treat will always be greater than zero.

Support

FAQs

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