The nonReentrant modifier in the ChristmasDinner contract uses a less conventional implementation where the locked state variable is always reset to false at the end of the modifier, regardless of the function execution's success or failure. While the implementation prevents re-entrancy under normal circumstances, it deviates from the standard pattern, potentially leading to confusion or unforeseen edge cases.
The nonReentrant modifier is implemented as follows:
-> Potential Lockouts: In an edge case where execution is interrupted or fails, the locked flag may not reset correctly, rendering parts of the contract unusable.
-> Inconsistent Behavior: Fails to guarantee locked is properly reset when exceptions occur inside the guarded function.
manual review
update the nonReentrant modifier to follow the conventional implementation:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.