Mystery Box

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

Incorrect reward value in `openBox`

Summary

Incorrect reward value in openBox, wich could confuse users or lead to incorrect reward distribution.

Vulnerability Details

In the current openBox() function, the reward values seem inconsistent with the rewards pool. For example, "Silver Coin" is listed as 0.5 ether in openBox(), but it's listed as 0.25 ether in the constructor.

Impact

The reward values in openBox are inconsistent with the reward pool set in the constructor. This can cause unexpected or unintended financial outcomes when users open boxes, leading to overpayment or underpayment. For example, a user expects to receive a reward of 0.25 ether but receives 0.5 ether, leading to unintended loss of funds for the contract owner.

Tools Used

Manual review.

Recommendations

Ensure the reward values are consistent across the entire contract and are properly aligned with the rewardPool.

Updates

Appeal created

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

The rewards in constructor are different from the rewards in openBox

Support

FAQs

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

Give us feedback!