Mystery Box

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

[L-03] Missing Zero Address check in MysteryBox::transferReward, rewards can be burnt by players

Summary

There is no check that the address the player is transferring the reward to is not the the zero address. Therefore, this reward can be burnt by the player.

Impact

Player's rewards can be sent to the zero address, meaning they can never be redeemed. This will lead to a bad user experience if a player accidentally does this.

Tools Used

Manual review

Recommended Mitigation

Add check for the _to address to ensure it is not the zero address.

function transferReward(address _to, uint256 _index) public {
+ require(_to != address(0), "attempted to burn reward");
require(_index < rewardsOwned[msg.sender].length, "Invalid index");
rewardsOwned[_to].push(rewardsOwned[msg.sender][_index]);
delete rewardsOwned[msg.sender][_index];
}
Updates

Appeal created

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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

Give us feedback!