Add SB Curated (copied from the smartbugs repository).
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* @source: etherscan.io
|
||||
* @author: -
|
||||
* @vulnerable_at_lines: 14
|
||||
*/
|
||||
|
||||
pragma solidity ^0.4.23;
|
||||
|
||||
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 VaultProxy 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.25 ether) {
|
||||
Deposits[msg.sender] += msg.value;
|
||||
}
|
||||
}
|
||||
|
||||
function withdraw(uint256 amount) public onlyOwner {
|
||||
if (amount>0 && Deposits[msg.sender]>=amount) {
|
||||
msg.sender.transfer(amount);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user