After closing the contest, the part of the reward that has not been distributed in the 90 days, should be distributed to the manager (10% cut), and to those who claimed their rewards on time. However, there is an issue with incorrect ownership management, leading to the loss of unclaimed rewards and improper distribution of the manager's cut.
The root cause of this vulnerability is that the Pot contract is owned by the ContestManager contract instead of the EOA (Externally Owned Account) that creates and manages the contests. This leads to the fact that the manager's cut (10% of unclaimed rewards) is sent to the ContestManager contract instead of the actual manager (EOA).
The critical lines could be found here:
Proof of Concept:
Place the following test into the ./test/TestMyCut.t.sol
:
Loss of Funds: The actual manager (EOA) does not receive their 10% cut of unclaimed rewards, as it's sent to the ContestManager contract instead:
Locked Funds: The manager's cut becomes locked in the ContestManager contract with no way to retrieve it, effectively losing these funds.
Manual review / Foundry tests
Transfer Pot Ownership: Modify the createContest
function in ContestManager to transfer ownership of the newly created Pot to the owner of the ContestManager (the EOA):
Modify Access Control: Replace the onlyOwner
modifier in the closePot
function of the Pot contract with a new onlyContestManager
modifier.
Add onlyOwner to ContestManager's closePot: Ensure that only the owner of ContestManager can close a contest.
Transfer tokens to the owner
By implementing these changes, the contracts will ensure proper ownership management, correct distribution of the manager's cut, and fair distribution of remaining rewards among timely claimants.
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.