Reentrancy Guard

Vulnerability

A reentrancy guard is a security mechanism implemented in smart contracts to prevent reentrancy attacks, a critical vulnerability where an external call allows an attacker to repeatedly invoke a function before the initial execution completes. This exploit leverages the call stack to drain funds by bypassing state updates that occur after the external call. The guard ensures that a function cannot be called again while it is still in the process of executing.