The nonReentrant modifier is intended to prevent reentrancy attacks by using a locked variable. However, in the ChristmasDinner contract, the locked variable is not set to true before executing the function body (_;). As a result, the modifier fails to block reentrant calls effectively, leaving the contract vulnerable to attacks.
Here is the vulnerable code:
The incorrect implementation of the nonReentrant modifier undermines its intended protection, leaving the contract potentially vulnerable to reentrancy attacks if its logic is modified in the future.
To fix this issue, consider the below nonReentrant modifier.
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.