Trick or Treat

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

[EVMN] Lack Of Input Checks On Function `addTreat()`

Summary

There is no adequate input checks on function addTreat().

Vulnerability Details

The contract uses zero check to identify whether a treat exists or not. Therefore, inputting zero cost treat should be prevented. The function addTreat() should have an additional check to make sure _rate is a non-zero value.

This function also does not prevent an empty string on _name and metadataURI.

Impact

It is possible to have a zero cost treat. Although it is not possible to mint this zero cost treat.

Tools Used

Manual review.

Recommendations

Consider adding checks on function addTreat()

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.