Mystery Box

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

Inefficient Reward Claim Process in `claimAllRewards`

Summary

The claimAllRewards function loops through all rewards owned by the user, summing the values and then deleting all rewards at once. If a user has many rewards, this loop could become gas-intensive and lead to transaction failures due to block gas limits.

Vulnerability Details

MysterBox.sol/Line

Impact

Users with many rewards may be unable to claim them due to high gas costs or out-of-gas errors.

Tools Used

Foundry

Recommendations

Consider breaking up the claim process to allow users to claim rewards in batches or individually. This reduces gas usage and makes it more flexible for users.

Updates

Appeal created

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

Gas Limit Exhaustion in `claimAllRewards` Function

Support

FAQs

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

Give us feedback!