MyCut

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

Possibility for precision loss

Summary

Possibility for precision loss

Vulnerability Details

One of the responsibilities of the method Pot::closePot is to calculate the claimed reward using a formula which contains division:
uint256 claimantCut = (remainingRewards - managerCut) / i_players.length; .
It is possible to have a minor precision loss due to that (such as having a division like 1000 / 3).

Impact

Precision loss, minor amount of funds remain stucked in the contract

Tools Used

Manual review

Recommendations

Consider one of the following:

  • Use library to handle precision loss

  • Have a method which sends the left amount of eth due to precision loss to the admin

Updates

Lead Judging Commences

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

Dusty Pot

Support

FAQs

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