Reverts in the claimAllRewards and claimSingleReward functions due to insufficient contract balance.
When the contract is deployed, the deployer sends a SEEDVALUE of 0.1 ether or more to the contract. The vulnerability arises when a user buys a mystery box using the buyBox function, paying 0.1 ether as the price for the box. Afterward, the user calls the openBox function, which determines the reward value of the purchased box. If the user wins a Gold Coin (worth 1 ether), and later tries to claim their reward by calling either the claimAllRewards or claimSingleReward function, the contract attempts to send 1 ether to the user. However, the contract only holds 0.2 ether (from the initial deployment deposit and the 0.1 ether from the user's purchase). Since the contract balance is insufficient to pay out the reward, the transaction reverts.
Users are unable to claim their rewards, particularly high-value rewards like the Gold Coin, due to the contract's insufficient balance. This leads to failed reward claims, undermining user trust and contract functionality.
Manual review
Ensure the contract is initialized with a balance sufficient to cover all potential reward payouts.
Implement a reserve fund mechanism to guarantee that rewards, particularly high-value ones, can always be paid out.
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.