MyCut

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

Manager Cut Calculation Methodology in `Pot::ClaimCut`

Summary

The hardcoded manager cut calculation in Pot::ClaimCut is based on division by 10, which could lead to errors if the managerCutPercent changes.

Vulnerability Details

The manager's cut is currently hardcoded to be one-tenth of the remaining rewards in the Pot::ClaimCut function, which works because the managerCutPercent is set to 10. However, this could lead to errors if the percentage changes in the future.

Impact

If the percentage value changes, the current hardcoded calculation may result in incorrect rewards being allocated to the manager.

Tools Used

Manual code review.

Recommendations

Instead of using a hardcoded calculation, calculate the manager's cut based on a percentage:

uint256 managerCut = (remainingRewards * managerCutPercent) / 100;

This way, the calculation will remain correct even if the percentage value changes.

Updates

Lead Judging Commences

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

Erroneous ManagerCut calculation

Appeal created

equious Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

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