TwentyOne

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

Ether is stuck in the contract forever

Summary

The current implementation of the smart contract lacks a crucial feature that would allow the owner to withdraw excess funds when needed.

Vulnerability Details

The inability to withdraw funds goes against standard economic practices where assets should be freely movable between entities. Accumulated funds that could be reinvested or distributed may remain locked within the contract.

Impact

Without a withdrawal mechanism, the owner cannot efficiently manage excess funds held by the contract.

Tools Used

Manual code review.

Recommendations

Add a withdrawal function: Include a function that allows the owner to withdraw excess funds from the contract and ensure that withdrawals are restricted to authorized addresses and include appropriate checks and balances.

function withdrawFunds(uint256 amount) public {
require(msg.sender == owner, "Only owner can withdraw");
(bool success,) = payable(msg.sender).call{value: amount}("");
require(success, "Transfer failed");
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 7 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.