Christmas Dinner

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

The host can withdraw all the funds without waiting for the deadline. In this case, users will not be able to withdraw their funds if they no longer wish to participate.

Description: At function refund(), participant can refund before deadline. But the host can withdraw all the funds without waiting for the deadline. Therefore, after the host withdraws the funds, users will no longer be able to refund their money, leading to a loss of funds for the users.

Impact: User may loss of funds after host withdraw all funds before deadline/

Recommended Mitigation: Add check deadline before host withdraw

function withdraw() external onlyHost { // q Do the host needs to wait for the deadline?
+ require(block.timestamp > deadline, "Cannot withdraw before deadline");
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)));
}
Updates

Lead Judging Commences

0xtimefliez Lead Judge about 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

withdraw is callable before deadline ends

Support

FAQs

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

Give us feedback!