August 2018
Intermediate to advanced
404 pages
11h 19m
English
pragma solidity^0.4.24;contract Victim { // Mapping to keep tract of user deposits mapping (address => uint) private balances; // Function to withdraw the contract balance function withdraw() public { uint amount = balances[msg.sender]; msg.sender.call.value(amount)(); balances[msg.sender] = 0; } // Function to deposit ether function deposit() public payable { balances[msg.sender] += msg.value; }}