Christmas Dinner

First Flight #31
Beginner FriendlyFoundrySolidity
100 EXP
View results
Submission Details
Severity: high
Valid

ETH may be locked in the contract, fund may loss

[H-1] ETH may be locked in the contract, fund may loss

Description: The contract does not have a way to withdraw the funds after the deadline has passed. even the host cannot withdraw the Eth.
This means that the funds will be locked in the contract.

Impact:
Loss of Funds

Recommended Mitigation:
Add a function to let the host withdraw the funds after the deadline has passed.

event BeforeDeadline();
...
modifier afterDeadline() {
if(block.timestamp <= deadline) {
revert BeforeDeadline();
}
_;
}
...
function withdrawETH() external onlyHost afterDeadline {
require(address(this).balance > 0, "No funds to withdraw");
payable(host).transfer(address(this).balance);
}
Updates

Lead Judging Commences

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

withdraw function lacks functionality to send ether

Support

FAQs

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