Christmas Dinner

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

No function to withdraw ETH for owner, results in ETH locked in contract

Summary

While users/funders can deposit ETH, there are no function to withdraw it for the owner, resulting in loss of funds.

Vulnerability Details

Users can deposit ether by calling the receive function :

receive() external payable {
etherBalance[msg.sender] += msg.value;
emit NewSignup(msg.sender, msg.value, true);
}

And can withdraw their funds from the function refund, which calls _refundETH :

function _refundETH(address payable _to) internal {
uint256 refundValue = etherBalance[_to];
_to.transfer(refundValue);
etherBalance[_to] = 0;
}

But there are no function for the owner to withdraw the eth when the deadline passes, resulting in loss of funds.

Impact

Loss of funds, as the owner cannot withdraw the ether.

Recommendations

Add a function to withdraw the ether, accessible only from the owner, and after the deadline.

Updates

Lead Judging Commences

0xtimefliez Lead Judge about 1 year 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.

Give us feedback!