SetTreatCost and addTreat functions do not validate argument input _cost
Treat must cost something, but new cost is not validated thus i could set _cost to 0, which would result in TrickATreat to revert.
And the function checks on set cost, so calling the function again to set a cost from 0, would revert.
Additionally addTreat do not perform checks on cost, and i could input 0 as a _rate within the function.
Treat would be broken if cost is set to 0 initially or modified to 0, users could not call TrickOrTreat function, Owner could not modify cost after cost been set to 0.
Manual Review
Add more input validations on argument parameters in both AddTreat and SetTreatCost function.
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.