MyCut

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

Distribution calculations on pot closing are wrong

Summary

The calculations to distribute the remaining funds equally among the claimants split it by the total number of players and not the number of claimants.

Vulnerability Details

Pot.sol, line 57, closePot():

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

Rather than being divided by the length of the player array, it should be divided by the length of the claimants array.

Impact

It leaves rewards stuck in the contract permanently.

Tools Used

VSCode

Recommendations

Change i_players.lengthto claimants.length.

Updates

Lead Judging Commences

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