Security and common exploits · 1/3
Billions lost to bugs
Smart contract exploits have drained billions of dollars. The most famous, the 2016 DAO hack, used reentrancy: the attacker's contract called back into the victim contract before its balance was updated, withdrawing funds repeatedly.
The fix is the checks-effects-interactions pattern: validate inputs, update your own state, and only then call external contracts. Reentrancy guards add a lock so a function cannot be re-entered mid-execution.
