Christmas Dinner

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

ChristmasDinner:locked is never set, causing all non reentrancy checks to be disabled

Summary

The ChristmasDinner::nonReentrant modifier fails to set the ChristmasDinner:locked variable to true, resulting in the modifier having no effect other than consuming gas.

Impact

ChristmasDinner:refund is not protected against reentrancy attack.

Tools Used

Recommendations

Add the following line in the modifier:

modifier nonReentrant() {
require(!locked, "No re-entrancy");
+ locked = true;
_;
locked = false;
}
Updates

Lead Judging Commences

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

mutex lock incomplete

Support

FAQs

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