setTreatCost
function leads to uninvokable function after treat cost is set to zero.Description:
In setTreatCost
function, if cost is set to zero once, then the function cannot be called again as the require
statement check will always revert.
Impact:
If cost is set to zero once, it will lead to denial of service of the setTreatCost
function.
Proof of concept:
Add the following test case and run the forge test command.
Recommended Mitigation:
Replace the cost check with below statement.
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.