The check-effect-interaction pattern is utilized when a function involves the transfer of ether. This pattern is employed to mitigate reentrancy attacks by prioritizing the update of state changes before proceeding with any external calls. This sequential approach safeguards the function from the risk of repeatedly re-entering itself.
The Non-Reentrant modifier serves the purpose of preventing reentrancy attacks by imposing a restriction on the function's execution. It ensures that the function cannot be invoked again until the ongoing execution has been completed
Withdrawal of funds or unexpected behavior.
An attacker could potentially call back into your contract's before the initial call has completed, leading to unexpected behavior or fund drains.
Use:
modifier nonReentrant {
require(!locked, "Reentrant call");
locked = ture;
_;
locked = false;
}
function withdraw(uint amount) internal nonReentrant {
}
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.