Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var VictimContract = eth.contract([
- {
- "constant": false,
- "inputs": [],
- "name": "withdraw",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [],
- "name": "deposit",
- "outputs": [],
- "payable": true,
- "stateMutability": "payable",
- "type": "function"
- }
- ]);
- var Victim = VictimContract.at('0xed1f0ae556562f41e4f689fae1abeefd9426fc34');
- var AttackerContract = eth.contract([
- {
- "constant": true,
- "inputs": [],
- "name": "count",
- "outputs": [
- {
- "name": "",
- "type": "uint256"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "inputs": [
- {
- "name": "victim",
- "type": "address"
- }
- ],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "constructor"
- },
- {
- "payable": true,
- "stateMutability": "payable",
- "type": "fallback"
- },
- {
- "anonymous": false,
- "inputs": [
- {
- "indexed": false,
- "name": "c",
- "type": "uint256"
- },
- {
- "indexed": false,
- "name": "balance",
- "type": "uint256"
- }
- ],
- "name": "LogFallback",
- "type": "event"
- },
- {
- "constant": false,
- "inputs": [],
- "name": "attack",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- }
- ]);
- var Attacker = AttackerContract.at('0xbf3615b919cc305f2a69fb874148d0804dfdc087');
- getBalance = eth.getBalance;
- function balanceInEth(address) {
- return web3.fromWei(getBalance(address).toString());
- }
Add Comment
Please, Sign In to add comment