Inside both functions: setTreatCost
& trickOrTreat
.
There are check of treat's cost should greater than 0.
If the owner accidently setting a 0 cost when deploy contract or adding treat by addTreat
function.
It will led some function can't run.
Here is a test of adding a treat with 0 cost.
Then setTreatCost will revert !
POC
We can see that inside setTreatCost
& trickOrTreat
.
require(treat.cost > 0)
If one treat's cost is 0, then these two function will useless.
Because it can not change cost, also can not do trickOrTreat
function at all.
It means this cost 0 treat, will never be claimed by anyone.
The likelihood might be low/medium, it only happen when owner accidently add treat's cost wrong since only onwer can add a treat.
Impact should be high, because if it really happen, that treat will never be claimed.
Manually
add check before create any treat. In constructor
and in addTreat
as following:
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.