Mystery Box

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

Duplicate rewards can be added to the pool

Vulnerability Details

addReward does not check if a reward is aded before and just pushes inside the reward pool array leading to potential duplicate rewards

https://github.com/Cyfrin/2024-09-mystery-box/blob/main/src/MysteryBox.sol#L33-L36

function addReward(string memory _name, uint256 _value) public {
require(msg.sender == owner, "Only owner can add rewards");
rewardPool.push(Reward(_name, _value));
}

Impact

duplicate rewards addition

Tools Used

manual review

Recommendations

Include a check that reward is not added before

Updates

Appeal created

inallhonesty Lead Judge 11 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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