The Pot::closePot
function distributes a cut of the remaining rewards to the manager. However, there is no function in place for the owner to withdraw these tokens, leading to the tokens being locked in the contract.
The closePot
function in the Pot
contract allows the owner to close the pot and distribute the remaining rewards. A portion of these rewards is allocated to the manager. However, the contract does not provide a mechanism for the owner to withdraw these tokens after they have been transferred to the contract. As a result, the manager's cut remains locked in the contract.
Proof Of Concept
After the pot has ended (90 days have passed), the owner can call the closePot function, which will distribute a cut of the remaining rewards to the manager. However, there is no way for the owner to withdraw these tokens from the contract.
Place the following test into TestMyCut.t.sol
If the closePot function is called, the manager's cut of the remaining rewards will be transferred to the contract, but there is no way for the owner to withdraw these tokens. This can lead to:
Tokens being locked in the contract indefinitely.
Inability for the manager to access their allocated rewards.
Solidity compiler
Manual code review
Foundry
To mitigate this vulnerability, implement a withdraw function that allows the owner to withdraw the amount of tokens from the contract. Here is an updated version of the Pot contract with the recommended changes
Place the following code in ContestManager.sol
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.