Christmas Dinner

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

nonReentrant modifier missing mutex lock

Summary

The nonReentrant modifier is missing the mutex lock. This means the state of locked isn't set to true before the execution of the function _ to then be set to false, thus fulfilling the purpose of the modifier.

Impact

refund() uses the nonReentrant modifier to prevent someone taking all the funds with a reentrancy, and by failing to do so, all the funds locked within the contract are at risk.

Recommendations

Set the locked modifier to true within the nonReentrant modifier as follows:

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

Lead Judging Commences

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

Give us feedback!