Christmas Dinner

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

The contract lacks a mechanism to get the ETH out, resulting in a permanent loss of funds

Summary

The contract lacks a mechanism to handle the ETH deposits in the ChristmasDinner::withdraw function which results in a permanent loss of ETH.

Vulnerability Details

The ChristmasDinner::withdraw function is missing a mechanism to handle the ETH balance of the contract, which results in a permanent loss of ETH that was sent to the contract but not refunded before the deadline. The withdraw function only transfers token balances (WETH, WBTC, and USDC) to the host. It does not account for ETH sent directly to the contract. Since ETH is part of the supported currencies (as stated in the overview), this is a clear design flaw.

Impact

  1. Participants lose their ETH contributions to the protocol.

  2. The host cannot use these funds for the event, violating the core purpose of the contract.

Tools Used

Manual review

Recommendations

The ChristamsDinner::withdraw function should also include logic to transfer any ETH balance of the contract to the host.

Add an appropriate error to revert with as well.

+ error UnsuccessfulEthTransfer();
function withdraw() external onlyHost {
address _host = getHost();
i_WETH.safeTransfer(_host, i_WETH.balanceOf(address(this)));
i_WBTC.safeTransfer(_host, i_WBTC.balanceOf(address(this)));
i_USDC.safeTransfer(_host, i_USDC.balanceOf(address(this)));
uint256 ethBalance = address(this).balance;
+ if (ethBalance > 0) {
+ (bool success, ) = _host.call{value: ethBalance}("");
+ if (!success) {
+ revert UnsuccessfulEthTransfer();
+ }
+ }
}
Updates

Lead Judging Commences

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

withdraw function lacks functionality to send ether

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