Potential erroneous calculation of the Manager's cut in Pot::closePot
, causing the manager to lose some funds
The calculation of the manager's cut in closePot
is as follows:
Now , managerCutPercent
is intended to be 'how much pecent of the remaining rewards should the manager get' . This value is hardcoded to be 10
in the Pot
contract. Now see , 10% means 1/10 so remainingRewards/10
gives the cut of the manager. But if the developers decide to change this fee percentage to, say 15
, then this formula will not work.
The owner will expect (15 * remainingRewards)/100
as his cut , but he will get remainingRewards/15
~ 6.67% of the remainingRewards.
Clearly the owner will lose out on his cut and get way less (or way more , depending on value of managerCutPercent
) than expected
Proof of Concepts
(Change managerCutPercent
to 15
for this test)
Owner creates and funds the pool
Player 1 claims
Deadline passes
Owner calls closePot
Owner expects 15 % of remainingRewards
Owner gets 6.67% of remainingRewards
Change managerCutPercent
to 15
for this test
Place this into TestMyCut.t.sol
Owner will get less cut in some cases (managerCutPercent
> 10)
Manual Review , Foundry
Change the formula as follows
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.