smartbugs-curated/dataset/unchecked_low_level_calls/0xb11b2fed6c9354f7aa2f658d3...

42 lines
1.0 KiB
Solidity

/*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 14
*/
pragma solidity ^0.4.24;
contract Proxy {
modifier onlyOwner { if (msg.sender == Owner) _; } address Owner = msg.sender;
function transferOwner(address _owner) public onlyOwner { Owner = _owner; }
function proxy(address target, bytes data) public payable {
// <yes> <report> UNCHECKED_LL_CALLS
target.call.value(msg.value)(data);
}
}
contract DepositProxy is Proxy {
address public Owner;
mapping (address => uint256) public Deposits;
function () public payable { }
function Vault() public payable {
if (msg.sender == tx.origin) {
Owner = msg.sender;
deposit();
}
}
function deposit() public payable {
if (msg.value > 0.5 ether) {
Deposits[msg.sender] += msg.value;
}
}
function withdraw(uint256 amount) public onlyOwner {
if (amount>0 && Deposits[msg.sender]>=amount) {
msg.sender.transfer(amount);
}
}
}