The owner can successfully add rewards by calling addReward, but even though this new reward will be added to the rewardPool this does not update the probabilities associated with each reward as described in MysteryBox::openBox.
While the owner can add new rewards to rewardPool, these newly created rewards will not be winnable by users.
owner adds a new reward addReward("Diamond Coin", 2 ether);.
this reward is added to the list of rewards rewardPool.push(Reward(_name, _value));
still, without openBox being updated to reflect the new reward, the user still has a 75% chance of coal, 20% bronze, 4% silver, and 1% gold (and 0% diamond).
One solution could be to expand the Reward struct to include the probablities of each reward, and then to add a function to allow for the removal or editing of existing.
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.