Trick or Treat

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

Owner cannot set the treat cost.

Summary:

Owner cannot call the setTreatCost function, when setting it for the first time.

Vulnerability Details:

When the owner wants to call the setTreatCost function and set the cost, he needs to pass this check:

require(treatList[_treatName].cost > 0, "Treat must cost something.");

But, the cost defaults to 0, which means, the owner cannot set the cost, because it doesn't pass this check.

Impact:

Destroys whole contract's functionality.

Tools Used:

Manual review

Recommendations:

Remove the check completely, or create another function, that allows the owner to set the cost to 1. Then he can call setTreatCost function.

Updates

Appeal created

bube Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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