Mystery Box

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

Discrepancy in Reward Values Between `openBox` Function and Constructor

Summary

The reward values in the openBox function differ from the default values initialized in the constructor (rewardPool), potentially leading to confusion or errors.

Vulnerability Details

In the constructor, the "Silver Coin" reward is initialized with a value of 0.25 ether, but in the openBox function, the same reward is assigned a value of 0.5 ether. This discrepancy could confuse users or create inconsistencies in the reward distribution.

Impact

Users might expect different rewards based on the information provided in the rewardPool array versus the actual logic in openBox. This inconsistency may reduce trust in the protocol and lead to user dissatisfaction.

Tools Used

Manual Code Review

Recommendations

Ensure that the reward values used in the openBox function align with the values set in the constructor. Alternatively, consider drawing rewards directly from the rewardPool to maintain consistency.

Updates

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

Support

FAQs

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