The DAO Hack Drained 3.6 Million Ether Through a Reentrancy Bug
On June 17, 2016, an attacker drained roughly 3.6 million ether from The DAO, a decentralized venture fund running on Ethereum. At the time the haul was valued at about 60 million dollars, an enormous sum for a project that had been live for only a matter of weeks. The uncomfortable detail for anyone who writes code for a living is that nothing cryptographic failed. The attacker did not break a key, forge a signature, or find a flaw in the Ethereum virtual machine. They called a public function in the way the contract allowed, over and over, and the contract kept paying.
The DAO had raised more than 150 million dollars in a crowdsale during the spring of 2016, making it one of the largest crowdfunding events ever recorded at that point. Token holders could vote on proposals, and investors who disagreed with the direction of the fund could split off into a child DAO to recover their share. That split mechanism was the feature the attacker abused. It was designed to protect minorities, and it became the entry point for the largest theft in the short history of smart contracts.
The mechanics are worth understanding precisely, because the pattern recurs in codebases that have nothing to do with blockchains. When an investor requested a split, the contract calculated that investor's balance, sent the corresponding ether to the caller, and then updated its internal ledger to record that the balance had been withdrawn. The external call happened before the state change. The attacker deployed a contract whose fallback function called back into the split routine. On each reentrant call, the ledger still showed the original balance, because the update had not run yet. The contract sent funds again, and again, until the attacker stopped. This is reentrancy in its purest form: a function that hands control to untrusted code while its own invariants are temporarily false.
In 2016 the tooling offered few guardrails. Solidity's call primitive forwarded essentially all available gas, which gave the receiving contract plenty of room to do real work during the callback. The checks effects interactions pattern was known in other domains, but it was not yet a reflex in the Ethereum community, and there were no widely adopted reentrancy guards or static analyzers to flag the ordering. Modern Solidity practice treats that ordering as a rule rather than a preference. Validate inputs first, update your own state second, and only then interact with the outside world. Libraries such as OpenZeppelin's ReentrancyGuard add a mutex so that a second entry into a marked function reverts. Payment designs moved toward a pull model, where each recipient withdraws on their own terms instead of the contract looping over a list of addresses.
The aftermath reshaped Ethereum's governance as much as its code. Because the funds sat in a child DAO for a delay period, the community had time to debate a rescue. The eventual decision was a hard fork at block 1,920,000 on July 20, 2016, which moved the disputed ether into a recovery contract so investors could be made whole. A minority rejected the fork on principle, arguing that blockchains should not rewrite history to undo a valid transaction, and continued on the original chain as Ethereum Classic. Whatever side you take, the episode demonstrated that a protocol's social layer is part of its security model, and that a smart contract bug can escalate into a constitutional crisis for a whole network.
For working developers, the lasting value of The DAO is the checklist it produced. Treat every external call as hostile, because the callee can be a contract you have never seen. Ask what invariants hold during the callback, not just after the function returns. Write tests that deploy a malicious receiver and verify your contract survives it. Run static analysis in CI, and read its reentrancy findings even when they look noisy. If your contract holds other people's money, budget for an independent audit and build in pause and upgrade paths before launch, because deployed bytecode cannot be patched.
The bug itself was a few lines in the wrong order. That is what makes it a permanent case study. Most serious production incidents are not exotic; they are ordinary sequencing mistakes made in a system where the blast radius is enormous and the fix cannot be deployed. Reentrancy is now a standard interview topic precisely because the cost of learning it the hard way was measured in tens of millions of dollars.