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
The admin can add a treat with a zero price, but the user will not be able to mint it.
Manual code analysis
Add a check for the zero _rate
in the addTreat
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.