The addTreat
function does not check if the _rate
value is set to zero before adding a new Treat. As a result, a treat with a cost of zero can be created, allowing users to mint NFTs for free if selected in the trickOrTreat
function.
If _rate
is set to zero, any user may mint the treat NFT without paying, potentially leading to an unintended loss of NFT value or an exploitable contract design.
Manual Read, Foundry
Add the following check at the beginning of 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.