Owner cannot call the setTreatCost function, if the cost is 0. But he can add a treat with cost 0.
When the owner wants to call the setTreatCost function and set the cost, he needs to pass the check, but if the price was set to 0 he cannot.
cannot set the treat cost.
Manual review
The vulnerability occurs, because the owner can add a treat with price of 0. Remove the check in setTreatCost function completely, or add a check to addTreat function, that says the price must be more than 0.
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.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.