The rewardPool variable is initialized to hold different rewards, but it is not used in the actual reward distribution process. Instead, the rewards are hardcoded directly in the function openBox, which defeats the purpose of having a rewardPool. This makes the rewardPool variable effectively useless and suggests a design flaw in the contract.
In the current implementation of the openBox function, the rewards are added directly as follows:
However, there is a rewardPool variable that is initialized with the same set of rewards, which should be used in this context:
The proposed correction is to use rewardPool for reward distribution:
Low Impact: The impact is mostly related to code maintainability and clarity. There is no direct security risk or risk to funds, but the current implementation introduces redundancy and inconsistency in how rewards are handled.
Manual code review.
Refactor the code to use the rewardPool variable for reward distribution, as originally intended. This will simplify the logic, improve maintainability, and remove unnecessary hardcoding of rewards.
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.