The contract allows for extremely small values to be used as treat costs, which could lead to precision issues and potential price manipulation.
Location: src/TrickOrTreat.sol:setTreatCost()
Proof of Concept:
Using very small values (like 3 wei) could lead to rounding issues and unexpected behavior in price calculations, especially in the half-price scenario.
Forge
Implement a minimum treat cost value (e.g., 1 finney or 1e15 wei) to prevent potential issues with extremely small values.
In case of treat, if the cost of the treat is very small, the user can get NFT for zero `requiredCost` due to rounding. Also, if the cost is small and odd, the user may get a given NFT at a lower price than intended.
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.