TwentyOne

First Flight #29
Beginner FriendlyGameFiFoundrySolidity
100 EXP
View results
Submission Details
Severity: high
Valid

Missing Owner Withdrawal Mechanism

Summary

The contract lacks both ownership functionality and withdrawal mechanisms. There is no way to withdraw accumulated funds from the contract, and no designated owner who could manage the contract's operations.

Impact

  • ETH can become permanently locked in the contract, no function exists to withdraw these funds

  • No ownership control

Recommendations

  • Add ownership mechanism like openzeppelin or use modifier

constructor() payable {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner, "Not the owner");
_;
}
  • Add withdraw function

function withdrawFees(uint256 amount) external onlyOwner {
require(amount <= address(this).balance, "Insufficient balance");
(bool success, ) = payable(owner).call{value: amount}("");
require(success, "Transfer failed");
emit FeeWithdrawn(owner, amount);
}

but while withdrawing also need to check that at least 2 ETH will be on contract for next games

Updates

Lead Judging Commences

inallhonesty Lead Judge 11 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Owner has no method to withdraw

Support

FAQs

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