Definition

What is Reentrancy?

Reentrancy is a vulnerability where an external call lets an attacker's contract call back into your function before its state updates finish, often draining funds.

The classic case is sending ETH before setting a balance to zero; the recipient's fallback re-enters withdraw and repeats. The fix is the checks-effects-interactions pattern (update state before making external calls) or a reentrancy guard such as OpenZeppelin's ReentrancyGuard.

Go deeper

Related terms

Definition by , founder of Monsmith.

See it in practice

Open Monsmith, paste a contract, and watch the audit and profiler explain it.

Open the studio