mirror of https://github.com/ConsenSys/mythril
parent
06209d66d9
commit
a2d98ec5ef
@ -1,22 +0,0 @@ |
||||
contract Reentrancy { |
||||
|
||||
mapping(address => uint) public balances; |
||||
|
||||
function donate(address _to) public payable { |
||||
balances[_to] += msg.value; |
||||
} |
||||
|
||||
function balanceOf(address _who) public constant returns (uint balance) { |
||||
return balances[_who]; |
||||
} |
||||
|
||||
function withdraw(uint _amount) public { |
||||
if(balances[msg.sender] >= _amount) { |
||||
if (msg.sender.call.value(_amount)()) { |
||||
balances[msg.sender] -= _amount; |
||||
} |
||||
} |
||||
} |
||||
|
||||
function() payable {} |
||||
} |
Loading…
Reference in new issue