Open a new terminal in order to start start ganache-cli
.
$ ganache-cli
install, compile and migrate the following contracts
$ npm install
$ npm run compile
$ npm run migrate
$ turffle test
Contract: AttackTransferEth
Test Reentrancy Attack of Bad Transfer Ether Contract
> Count: 1 Attacker Contract Balance: 500000000000000000
> Count: 2 Attacker Contract Balance: 1000000000000000000
> Count: 3 Attacker Contract Balance: 1500000000000000000
> Count: 4 Attacker Contract Balance: 2000000000000000000
> Count: 5 Attacker Contract Balance: 2500000000000000000
✓ Should able to attack the transfer ether contract (65ms)