Crypto / Evergreen
Reentrancy exploits control returning before assumptions are settled
Reentrancy occurs when an external call allows another contract to call back into vulnerable logic before the first operation has safely completed its intended state updates.
Reentrancy protection concerns safe state transitions across callbacks, not merely recognizing a familiar attack label.
The distinction that matters
Reentrancy occurs when an external call allows another contract to call back into vulnerable logic before the first operation has safely completed its intended state updates. Smart-contract security combines software correctness, authorization, and economic assumptions. A program can follow its written code perfectly while producing an outcome its designers did not intend. Attackers can choose inputs, arrange transactions, interact through other contracts, and exploit the precise order in which state changes and external calls occur.
How the mechanism works
The risk depends on which state is visible during the callback and which functions can be entered again under that intermediate condition. Public code makes behavior inspectable, but inspection requires attention to all reachable paths and dependencies. Security reviews, formal methods, tests, and monitoring provide different kinds of evidence. None is a universal certificate covering every later upgrade, configuration change, or interaction with external systems. A review's scope, version, and unresolved findings matter, and a deployed contract can differ from the reviewed artifact.
A worked situation
Consider this hypothetical situation: A hypothetical withdrawal sends assets to a recipient before reducing the recipient's recorded claim, allowing the recipient contract to request another withdrawal during the callback. The repeated request can observe the old claim unless the contract's ordering or guards prevent that path.
Where interpretation can fail
A reentrancy guard on one function may not cover another function that shares the same vulnerable state or an interacting contract. Inspect external-call boundaries and the state invariants that must hold before control leaves the contract. Reentrancy protection concerns safe state transitions across callbacks, not merely recognizing a familiar attack label.
The wider technical implication
The checks-effects-interactions pattern aims to establish the necessary state changes before calling an external party, reducing the opportunity to observe an inconsistent intermediate state. Guards can add another restriction, but neither technique should be applied mechanically without understanding shared invariants. Cross-function reentrancy can enter a different function that relies on the same unsettled accounting. Read-only reentrancy can also affect another system that queries a temporarily misleading value. The broader principle is to keep externally observable state coherent whenever control or information crosses a contract boundary.
A global perspective
A technical exploit, contractual breach, and regulatory violation are different classifications. Remedies and reporting duties depend on jurisdiction and the actual facts.
Sources & further reading
Ethereum.org — Smart contract security ↗OpenZeppelin Contracts — Access control ↗Sources checked Oct 27, 2026. Educational examples. Historical observations are attributed to their sources. No affiliation with cited organizations.
Make the idea stick.
Mark complete when you are ready. Reaching the end alone does not mark a lesson complete.
What assumption in this guide would change the result in a different situation? Revisit the example and explain that change in your own words.
Explore crypto →