Christmas Dinner

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

Wrong nonReentrant modifier

Summary

nonReentrant modifier lacks an important assignment.

Vulnerability Details

With the current implementation the variable lockedstays always false and thus it will pass the require check leading to reentrancy.

Impact

All funcitons that has nonReentrant modifier will be vulnerable to reentrancy attacks

Tools Used

Recommendations

The modifier should set locked to true before the _ keyword.

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.