MyCut

First Flight #23
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: high
Valid

Reward Distribution to Unclaimed Participants

Summary

The contract incorrectly distributes rewards by dividing them among all players instead of just those who have claimed their rewards.

Vulnerability Details

The current implementation calculates the reward share based on the total number of players i_players.length, regardless of whether they have claimed their rewards. The code snippet :

uint256 claimantCut = (remainingRewards - managerCut) / i_players.length;

Impact

Players who haven't claimed their rewards are factored into the distribution, causing the actual claimants to receive a smaller portion of the rewards.

Tools Used

Manual Code Review: None, just read the contract couple of times.

Recommendations

Ensure that the reward distribution calculation only includes players who have claimed their rewards. Use the length of the claimants array for the division:

uint256 claimantCut = (remainingRewards - managerCut) / claimants.length;

Updates

Lead Judging Commences

equious Lead Judge about 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

Incorrect distribution in closePot()

Support

FAQs

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