Mystery Box

First Flight #25
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: medium
Valid

The `rewardPool` isn't used, so adding rewards doesn't impact the rewards players can receive

Summary

When the owner adds new rewards using the MysteryBox::addReward function, the rewards available to players don’t change because the rewards are hardcoded in the MysteryBox::openBox function. Additionally, the hardcoded rewards in the MysteryBox::openBox function don’t match the rewards initialized in the rewardPool within the constructor (the same reward names have different values).

Impact

Players will receive the same rewards even if the owner adds new ones.

If a player calls the MysteryBox::getRewardPool function to check available rewards, they’ll see incorrect values.

Recommendations

Update the MysteryBox::openBox function to pull rewards from the rewardPool.

Updates

Lead Judging Commences

inallhonesty Lead Judge
11 months ago

Appeal created

inallhonesty Lead Judge 11 months ago
Submission Judgement Published
Validated
Assigned finding tags:

The rewards in constructor are different from the rewards in openBox

addReward won't have any effect on openBox

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.