The cost of a treat cannot be updated if the initial cost of the Treat created with the constructor or with function addTreat(string, uint256, string)
is 0 ether.
This means that the users will never be able to mint NFT for this treat, because of the function trickOrTreat(string)
checks if the cost of the treat is > 0.
There is no check that the _rate(the cost) of the treat is > 0 in the function.
Add the following test to the class TestTrickOrTreat.t.sol (test class is not part of the project so you have to create it):
This makes the treat unusable.
foundry
In the function addTreat(string, unit256, string)
validate that the cost is > 0 before creating the treat
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.