TwentyOne

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

There is not withdraw function

Summary

The goal for protocol is mimic the blackjack game.

But there is not possioble to withdraw the ethers to take the unspend eth.

Vulnerability Details

The dealer does not have the capability to withdraw Ether from the protocol, resulting in the funds being locked indefinitely.

Impact

The founds erned by dealers being locked indefinitely.

Tools Used

manual review

Recommendations

You can add withdrawfunction

function withdraw(uint256 amount) public {
require(msg.sender == owner, "Only the owner can withdraw funds");
require(address(this).balance >= amount, "Insufficient contract balance");
// Transfer the specified amount to the owner
(bool success, ) = owner.call{value: amount}("");
require(success, "Withdrawal failed");
emit Withdrawal(owner, amount);
}
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.