MyCut

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

Change condition check in claimCut function (Pot.sol::Line 40)

Summary

reward will never be < 0. Change to == 0

Vulnerability Details

function claimCut() public {
address player = msg.sender;
uint256 reward = playersToRewards[player];
if (reward <= 0) {
revert Pot__RewardNotFound();
}
playersToRewards[player] = 0;
remainingRewards -= reward;//@audit underflow ever possible?
claimants.push(player);
_transferReward(player, reward);
}

Impact

Ineffecient gas use.

Tools Used

Manual Review

Recommendations

Change line 4 check to == instead of <=.

Updates

Lead Judging Commences

equious Lead Judge 12 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.