The nonReentrant modifier is implemented incorrectly
The nonReentrant modifier is implemented incorrectly. It sets reentrantStatus back to Constants.NOT_ENTERED immediately after setting it to Constants.ENTERED, which doesn't prevent reentrant calls. It should be set back to Constants.NOT_ENTERED after the function execution.
Manual
The following is a revised version of your nonReentrant modifier:
modifier nonReentrant() {
require(s.reentrantStatus != Constants.ENTERED, "Detected a reentrant call");
s.reentrantStatus = Constants.ENTERED;
_;
s.reentrantStatus = Constants.NOT_ENTERED;
}
This modifier ensures that the associated function cannot be re-entered while it is still being executed. If a reentrant call is detected, the function execution will be halted. After the function execution, the status is reset to NOT_ENTERED to allow future calls.
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.