The ChristmasDinner::withdraw function does not transfer the ETH in the contract to the host. If ETH has been sent to the contract by participants, these funds are fully locked in the contract after the dealine has passed and partipants cannot issue any refunds anymore.
Based on the docs, the contract is supposed to accept ETH for sign ups. However, the ChristmasDinner::withdraw function does not transfer the ETH in the contract to the host. If ETH has been sent to the contract by participants, these funds cannot be withdrawn by the host. Users could still withdraw their funds using the refund function before the deadline but after the deadline the ETH is locked in the contract.
The following scenario leads to locked ETH funds:
User signs up for the Christmas dinner and sends ETH to the contract.
The deadline for sign ups passes and the host calls the withdraw function to withdraw the funds.
The host receives the WETH, WBTC and USDC but the ETH remains in the contract.
User cannot withdraw the ETH using the refund function because the deadline has passed.
ETH is locked in contract.
Code:
To demonstrate that the host does not receive deposited ETH funds, place following code into ChristmasDinnerTest.t.sol:
The impact of this issue is high as it prevents access to valuable funds needed for the event, essentially resulting in lost funds as they will be locked in the contract. Since the protocol states that signups with ETH are possible it is also highly likely that users will send ETH to the contract. If the host cannot withdraw these funds, the event might not be able to take place as planned.
Manual review, custom test
To allow the host to withdraw the ETH funds, the ChristmasDinner::withdraw function should transfer the ETH in the contract to the host. This will allow the host to access the funds and use them for the event. Alternatively, implement an additional withdraw function for ETH in the contract.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.