I'm trying to simulate the DAO attack for a research project I'm working on. I have truffle and testrpc setup on my machine. I use the sample code given in this tutorial. I try calling the BankAttack and Bank contracts like this in my test:
Bank b = new Bank();
BankAttacker ba = new BankAttacker(b, true);
ba.deposit();
This results in the following error:
Error: VM Exception while processing transaction: invalid JUMP at a83375170c16ea0d52be723b5199aa8f0586bf83a8a5b199e86f1b3f0f2af1a6/f61c4b7d1e355565abdfd25e23438aa8d48c93e2:276
at Object.InvalidResponse (/usr/local/lib/node_modules/truffle/node_modules/truffle-contract/node_modules/web3/lib/web3/errors.js:38:16)
at /usr/local/lib/node_modules/truffle/node_modules/truffle-contract/node_modules/web3/lib/web3/requestmanager.js:86:36
at XMLHttpRequest.request.onreadystatechange (/usr/local/lib/node_modules/truffle/node_modules/web3/lib/web3/httpprovider.js:118:13)
at XMLHttpRequestEventTarget.dispatchEvent (/usr/local/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:64:18)
at XMLHttpRequest._setReadyState (/usr/local/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:354:12)
at XMLHttpRequest._onHttpResponseEnd (/usr/local/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:509:12)
at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:469:24)
at endReadableNT (_stream_readable.js:1054:12)
I've already spent hours trying to debug this. Any help would be appreciated.