Mystery Box

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

[M-2] `transferReward` should follow CEI

Description: The** transferReward** should follow CEI.

Impact: Medium/Low

Proof of Concept:

Recommended Mitigation: transferReward could be more effective and less prone to reentrancy this way

function transferReward(address _to, uint256 _index) public {
require(_index < rewardsOwned[msg.sender].length, "Invalid index");
uint256 rewardsToBeTransferred = rewardsOwned[msg.sender][_index];
delete rewardsOwned[msg.sender][_index];
rewardsOwned[_to].push(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!