The distribution logic to send unclaimed rewards to users who made claims is not calculating the distribution reward properly.
One of the resposibilities of the method Pot::closePot is to distribute remaning unclaimed rewards (after manager cut) to users who already claimed.
However, when calculating the variable claimantCut it's denominator uses the players that were registered instead of only the users who made the claim.
Rewards are miscalculated, funds remain locked in contract.
Manual Review, Foundry
Follow these steps to reproduce the issue:
Add the following member to TestMyCut:
Add the following method to TestMyCut:
Run the test via the following command: forge test --mt test_distributionMiscalculates
Make the following modification:
Add addional logic which handles the case where there no claimants (this would mean division by zero).
For example if there are no claimants - send all of the prizes to the manager.
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.