The openBox function does not account for dynamically added rewards by the owner. It only distributes predefined rewards (Gold, Silver, Bronze, and Coal), ignoring any additional rewards added to the rewardPool by the owner.
The function currently uses a hardcoded probability distribution to assign predefined rewards to users when they open a box. This implementation does not consider any rewards that the owner may have added to the rewardPool after the contract deployment.
Users will not receive any of the dynamically added rewards, which limits the functionality and flexibility of the contract.
Users may feel misled if they are not able to receive the newly added rewards, leading to a loss of trust in the contract.
The owner's efforts to add new rewards to the rewardPool will be in vain as these rewards will never be distributed.
Using Remix IDE:
Deployed the MysteryBox contract.
Added a new reward to the rewardPool using the addReward function.
Called the openBox function and observed that the new reward is never distributed.
Manual Review
Remix IDE
This approach allows for dynamic probability adjustment for existing and new 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.