The formula of calculating claimantCut in pot::closePot function is not correct which lead to lock of funds in the pot contract and claimants Recieve fewer rewards than expected
when the owner of the contest call pot::closePot function the remmaning rewards in the contract are divided two things happen
the owner recieve the ownerCut which is 10% of the remmainingRewards
the rest of the remmainingRewards after subtracting ownerCut is distributed Equally among climants.The issue occur when the contract calculate the claimantCut it calculate it based on players in the contest not the claimants therefore there is some tokens locked in the pot contract
Because when you try to call pot::closePot again which the only way to withdraw the remainingRewards it will revert since there no enough balance to deduct the ownerCut again and transfer rest to claimants
Use the following POC in TestMyCut.t.sol
Locking some tokens in pot contract
claimants will recieve fewer amount than excpected
Manual Review + foundry
implement the following formula in pot::closePot function to calculate claimantsCut
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.