3 ms·
No, it was a reentrant attack. The contract was doing a state change after sending ETH, and since the recipient called back, it was able to get repeated ETH sen
by DennisP 9y ago
No, it was a reentrant attack. The contract was doing a state change after sending ETH, and since the recipient called back, it was able to get repeated ETH sends before the state updated.
- Animats 9y agoThat's an atomicity failure. That class of bug, incidentally, is a classic source of trouble in window/widget GUI systems.
- always_good 9y agoIt's a logic error. It's actually still atomic.
- always_good 9y agoTo clarify, reentrant errors are not atomicity errors. Fully serializable transactions can have reentrant errors and they often do, but that class of error is a case of the code not doing what you expect rather than an atomic violation. What I would instead wager is that it's too easy to introduce reentrant errors in Solidity. I've noticed since the DAO exploit, the ecosystem has been better about this though. For example, Solidity's docs has a section of reentrancy, and even the in-browser editor can warn you about reentrancy in some cases. Seems to be improving, though unfortunately after big expense.
- DennisP 9y agoLuckily, while it's easy to introduce reentrant errors, it's also easy to avoid them: just make sure that an ETH transfer or another call to an unknown contract is always the last thing you do in a transaction. It's sometimes easy to miss, but the ecosystem is also a lot better at insisting on public security audits.
- DennisP 9y agoHah, I used to run into a lot of those GUI issues, and hadn't made the connection until now.