MyCut

First Flight #23
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: high
Valid

The manager's cut gets stuck in the `ContestManager` contract

Summary

When the manager creates a contest using the ContestManager::createContest function, the owner of the Pot contract is set to the ContestManager contract. The Pot::closePot function can only be called by the owner, which is the ContestManager contract. The manager's cut is transferred to msg.sender, which in this case is the ContestManager contract, and there is no function in the ContestManager contract to retrieve the tokens.

Impact

The manager's cut gets stuck in the ContestManager contract after closing the pot.

Recommendation

Add a function to the ContestManager contract to retrieve the tokens.

function getTokens(IERC20 token) external onlyOwner {
token.transfer(msg.sender, token.balanceOf(address(this)));
}
Updates

Lead Judging Commences

equious Lead Judge about 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

Owner's cut is stuck in ContestManager

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.