Solidity Reentrancy: CEI Ordering and nonReentrant Guards for Payouts
Use CEI ordering and nonReentrant guards to prevent reentrancy in Solidity payout functions that send ETH to untrusted recipients.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Use CEI ordering and nonReentrant guards to prevent reentrancy in Solidity payout functions that send ETH to untrusted recipients.
A decision guide for using Vyper's @nonreentrant decorator vs manual mutex patterns, with version constraints, gas trade-offs, a concrete withdrawal example, and validation steps using Foundry and bytecode inspection.
Prevent reentrancy attacks in Solidity by implementing the Checks-Effects-Interactions pattern. Learn how to order state changes to secure funds and optimize gas.
Decide when to use Vyper's built-in @nonreentrant decorator versus a manual reentrancy guard, with trade-offs, constraints, and a concrete implementation checklist.
Vyper's @nonreentrant decorator adds a storage-backed lock to prevent reentrancy, but only for functions sharing the same key. Learn how to apply it correctly alongside checks-effects-interactions, what it costs, and how to verify it on a pinned compiler.
Learn how Vyper’s built‑in @nonreentrant decorator provides compile‑time reentrancy protection, see a concrete vault example, and understand its gas cost and scope limits.
Vyper's @nonreentrant decorator turns reentrancy from a code-review convention into a compiler-enforced guarantee. Here's how it works, a vault example, and where it falls short.
Reentrancy attacks can drain a contract’s funds. The Checks‑Effects‑Interactions (CEI) pattern is a tried‑and‑true way to stop them. This post walks through a concrete withdraw example, shows how CEI works, and explains its limits and when to add a mutex.
A concise architecture note that outlines requirements, minimal design, trust boundaries, operational checks, and failure modes for using the checks‑effects‑interactions pattern to prevent reentrancy in Solidity contracts.