Christmas Dinner

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

Participants will lose the ability to request a refund if the host withdraws funds before the deadline

Summary

The host is allowed to withdraw the dinner funds before the deadline. Therefore participants will lose the ability to request a refund if the host withdraws the contract funds before the deadline.

Vulnerability Details

The host is allowed to withdraw the dinner funds before the deadline. Therefore participants will lose the ability to request a refund if the host withdraws the contract funds before the deadline.

Impact

Participants will be unable to withdraw funds if they change their mind about attending the dinner in time.

Tools Used

Recommendations

Add an ChristmasDinner::afterDeadline modifier to the ChristmasDinner::withdraw function:

+ modifier afterDeadline() {
+ require(block.timestamp > deadline);
+ _;
+ }
- function withdraw() external onlyHost {
+ function withdraw() external onlyHost afterDeadline {
Updates

Lead Judging Commences

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