The setBoxPrice() function allows the owner to set the price of mystery boxes without any checks for minimum or maximum limits. While the owner is considered a trusted actor, there is still a risk that the price could be set too high or too low accidentally, leading to unintended consequences for the protocol and its users.
The setBoxPrice() function is implemented as follows:
This allows the owner to set the price to any value, including zero or an extremely high price. Although the owner is trusted, an accidental misconfiguration could make the boxes free or set them to an unreasonably high price, both of which can negatively impact the protocol.
An incorrect box price (e.g., accidentally set to 0) could result in users acquiring unlimited boxes for free, leading to depletion of rewards. On the other hand, an excessively high price could prevent users from purchasing boxes, diminishing user participation and harming the protocol’s viability.
Manual code review
Implement minimum and maximum constraints on the box price to safeguard against accidental misconfigurations:
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.