
June 17, 2016. The DAO was a smart contract holding around 150 million dollars of other people's ether, and its withdrawal code checked the balance before sending the money but updated it afterwards. An attacker called back into it before the update landed, so the same balance kept authorising fresh payouts. About 3.6 million ether walked out, and Ethereum ended up splitting into two chains over how to answer it. Here is the same vault.
Repair this code
Pay out a list of withdrawal requests without ever handing over money the account does not have.
Steps
$ drain(100, {60,60}, 2)
60
$ drain(50, {10,50,40}, 3)
50
$ drain(100, {101}, 1)
0
Expected files
Allowed functions
None. Write every helper yourself.
Loading solutions...