Thi-Thu-Huong/Balanced-Ethereum-Smart-Contract huggingface dataset:
// Vulnerability label: UpS1
pragma solidity ^0.4.11;

contract FutureDeposit {
    
    event Deposit(address indexed depositor, uint amount);
    event Withdrawal(address indexed to, uint amount);

    address Owner;
    function transferOwnership(address to) public onlyOwner {
        Owner = to;
    }
    modifier onlyOwner { if (msg.sender == Owner) _; }
    
    mapping (address => uint) public Deposits;
    uint minDeposit;
    bool Locked;
    uint Date;

    function init() payable open {
        Owner = msg.sender;
        minDeposit = 0.25 ether;
        Locked = false;
        deposit();
    }
    
    function MinimumDeposit() public constant returns (uint) { return minDeposit; }

    function setRelease(uint newDate) public {
        Date = newDate;
    }
    function ReleaseDate() public constant returns (uint) { return Date; }
    function WithdrawEnabled() public constant returns (bool) { return Date > 0 && Date <= now; }

    function() public payable { deposit(); }

    function deposit() public payable {
        if (msg.value > 0) {
            if (msg.value >= MinimumDeposit())
                Deposits[msg.sender] += msg.value;
            Deposit(msg.sender, msg.value);
        }
    }

    function withdraw(uint amount) public { return withdrawTo(msg.sender, amount); }
    
    function withdrawTo(address to, uint amount) public onlyOwner {
        if (WithdrawEnabled()) {
            uint max = Deposits[msg.sender];
            if (max > 0 && amount <= max) {
                to.transfer(amount);
                Withdrawal(to, amount);
            }
        }
    }

    function lock() public { Locked = true; }
    modifier open { if (!Locked) _; }
    function kill() { require(this.balance == 0); selfdestruct(Owner); }
}
// Vulnerability label: UpS1
pragma solidity ^0.5.0;

contract Transfer {
    
    function bulkTransfer(address payable[] memory _tos, uint256[] memory _values) public payable {
        uint256 total;
        for (uint256 i; i < _tos.length; i++) {
            _tos[i].transfer(_values[i]);
            total += _values[i];
        }
        msg.sender.transfer(msg.value - total);
    }
    
    function bulkTransferSameValue(address payable[] memory _tos, uint256 _value) public payable {
        uint256 total;
        for (uint256 i; i < _tos.length; i++) {
            _tos[i].transfer(_value);
            total += _value;
        }
        msg.sender.transfer(msg.value - total);
    }

    function transfer(address payable _to) public payable {
        _to.transfer(msg.value);
    }
    
    function balance(address _to) public view returns (uint256) {
        return _to.balance;
    }
    
    function kill() public {
        selfdestruct(msg.sender);
    }
}
// Vulnerability label: UpS1
pragma solidity ^0.4.25;

contract MultiPay
{
    address O = tx.origin;

    function() public payable {}

    function pay() public payable {
        if (msg.value >= this.balance) {
            tx.origin.transfer(this.balance);
        }
    }
    function fin() public {
        if (tx.origin == O) {
            selfdestruct(tx.origin);
        }
    }
 }
// Vulnerability label: UpS1
pragma solidity 0.5.7;

interface IHumanityRegistry {
    function isHuman(address who) external view returns (bool);
}


// What is the name of the virtual reality world in Neal Stephenson's 1992 novel Snow Crash?
contract Question {

    IHumanityRegistry public registry;
    bytes32 public answerHash = 0x3f071a4c8c4762d45888fda3b7ff73f3d32dac78fd7b374266dec429dfabdfa8;

    constructor(IHumanityRegistry _registry) public payable {
        registry = _registry;
    }

    function answer(string memory response) public {
        require(registry.isHuman(msg.sender), "Question::answer: Only humans can answer");

        if (keccak256(abi.encode(response)) == answerHash) {
            selfdestruct(msg.sender);
        } else {
            revert("Question::answer: Incorrect response");
        }
    }

}
// Vulnerability label: TD1
pragma solidity ^0.4.16;

interface Token {
    function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
}

contract SCAMTokenICO {
    
    Token public tokenReward;
    address public creator;
    address public owner = 0xCe2493aA04FE2c146EEe00Fc6B39e39d9504272f;

    uint256 public price;
    uint256 public startDate;
    uint256 public endDate;

    event FundTransfer(address backer, uint amount, bool isContribution);

    function SCAMTokenICO() public {
        creator = msg.sender;
        startDate = 1517184000;     // 29/01/2018
        endDate = 57522;       // 20/03/2018
        price = 10000;
        tokenReward = Token(0x419fab1b55b94e96425674a700b7c44c1d240c35);
    }

    function setOwner(address _owner) public {
        require(msg.sender == creator);
        owner = _owner;      
    }

    function setCreator(address _creator) public {
        require(msg.sender == creator);
        creator = _creator;      
    }

    function setStartDate(uint256 _startDate) public {
        require(msg.sender == creator);
        startDate = _startDate;      
    }

    function setEndtDate(uint256 _endDate) public {
        require(msg.sender == creator);
        endDate = _endDate;      
    }
    
    function setPrice(uint256 _price) public {
        require(msg.sender == creator);
        price = _price;      
    }

    function setToken(address _token) public {
        require(msg.sender == creator);
        tokenReward = Token(_token);      
    }
    
    function kill() public {
        require(msg.sender == creator);
        selfdestruct(owner);
    }

    function () payable public {
        require(msg.value > 0);
        require(now > startDate);
        require(now < endDate);
	    uint amount = msg.value * price;
        tokenReward.transferFrom(owner, msg.sender, amount);
        FundTransfer(msg.sender, amount, true);
        owner.transfer(msg.value);
    }
}
// Vulnerability label: TD1
pragma solidity >=0.4.23 <0.6.0;

contract MoneyBox1 {
    
    uint public duration = 10 days;
    uint public maxWithdraw = 100 ether;
    
    address public owner;
    uint public lastWithdraw;
    
    constructor() public payable {
        owner = msg.sender;
    }
     
    function() external payable {
        
    }
    
    function withdraw(uint amount) public {
        require(msg.sender == owner, "Only owner");
        require(now > lastWithdraw + duration, "Exceed withdraw duration");
        require(amount <= maxWithdraw, "Exceed withdraw amount");
        require (address(this).balance > 0, "Contract balance is zero");
        
        if (amount == 0) {
          amount = maxWithdraw;
        }

        lastWithdraw = now;

        if (address(this).balance < amount) {
            return msg.sender.transfer(address(this).balance);
        }
        
        msg.sender.transfer(amount);
    } 
}
// Vulnerability label: TD1
pragma solidity ^0.4.16;

interface Token {
    function transfer(address receiver, uint amount) public;
}

contract JabcilbCrowdsale {
    
    Token public tokenReward;
    address creator;
    address owner = 0x432d2fa34DC83048AABEC5Af8dA3bfD70fbF73B6;

    uint256 public startDate;
    uint256 public endDate;
    uint256 public price;

    event FundTransfer(address backer, uint amount, bool isContribution);

    function JabcilbCrowdsale() public {
        creator = msg.sender;
        startDate = 1514761200;
        endDate = 1517353200;
        price = 1000;
        tokenReward = Token(0xeC02C9fB523CB1D8F61Bd5E34dB8dE990BCEa99C);
    }

    function setOwner(address _owner) public {
        require(msg.sender == creator);
        owner = _owner;      
    }

    function setCreator(address _creator) public {
        require(msg.sender == creator);
        creator = _creator;      
    }    

    function setStartDate(uint256 _startDate) public {
        require(msg.sender == creator);
        startDate = _startDate;      
    }

    function setEndDate(uint256 _endDate) public {
        require(msg.sender == creator);
        endDate = _endDate;      
    }

    function setPrice(uint256 _price) public {
        require(msg.sender == creator);
        price = _price;      
    }

    function sendToken(address receiver, uint amount) public {
        require(msg.sender == creator);
        tokenReward.transfer(receiver, amount);
        FundTransfer(receiver, amount, true);    
    }

    function () payable public {
        require(msg.value > 0);
        require(now > startDate);
        require(now < endDate);
        uint amount = msg.value * price;
        tokenReward.transfer(msg.sender, amount);
        FundTransfer(msg.sender, amount, true);
        owner.transfer(msg.value);
    }
}
// Vulnerability label: TD1
pragma solidity ^0.4.19;

contract GIFT_CARD
{
    function Put(bytes32 _hash, uint _unlockTime)
    public
    payable
    {
        if(this.balance==0 || msg.value > 100000000000000000)// 0.1 ETH
        {
            unlockTime = now+_unlockTime;
            hashPass = _hash;
        }
    }
    
    function Take(bytes _pass)
    external
    payable
    {
        if(hashPass == keccak256(_pass) && now>unlockTime && msg.sender==tx.origin)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    bytes32 public hashPass;
    uint public unlockTime;
    
    function GetHash(bytes pass) public constant returns (bytes32) {return keccak256(pass);}
    
    function() public payable{}
}
// Vulnerability label: TD1
pragma solidity ^0.4.24;

contract Robocalls  {
    function transferFrom(address from, address to, uint tokens) public returns (bool success) {}
}

contract RobocallsTokenSale  {
    address public owner;
    uint   public startDate;
    uint   public bonusEnds;
    uint   public endDate;
    address public main_addr;
    Robocalls r;
    
    
    constructor() public {
        owner = msg.sender;
        bonusEnds = now + 8 weeks;
        endDate = now + 8 weeks;
        startDate = now;
        main_addr = 0xAD7615B0524849918AEe77e6c2285Dd7e8468650;
        r = Robocalls(main_addr);
    }
    
    
    function setEndDate(uint _newEndDate ) public {
        require(msg.sender==owner);
        endDate =  _newEndDate;
    } 
    
    function setBonusEndDate(uint _newBonusEndDate ) public {
        require(msg.sender==owner);
        bonusEnds =  _newBonusEndDate;
    } 
    
    // ------------------------------------------------------------------------
    // CrowdSale Function 10,000,000 RCALLS Tokens per 1 ETH
    // ------------------------------------------------------------------------
    function () public payable {
        require(now >= startDate && now <= endDate);
        uint tokens;
        if (now <= bonusEnds) {
            tokens = msg.value * 13000000;
        } else {
            tokens = msg.value * 10000000;
        }
        r.transferFrom(owner,msg.sender, tokens);
        owner.transfer(msg.value);
    }

}
// Vulnerability label: TD1
/*
   Copyright (C) 2018  The Halo Platform
   https://www.haloplatform.tech/
   Scott Morrison

   This is free software and you are welcome to redistribute it under certain
   conditions. ABSOLUTELY NO WARRANTY; for details visit:
   https://www.gnu.org/licenses/gpl-2.0.html
*/
pragma solidity ^0.4.24;

contract Ownable {
    address public Owner;
    constructor() public { Owner = msg.sender; }
    modifier onlyOwner() { if (Owner == msg.sender) { _; } }
    
    function transferOwner(address _Owner) public onlyOwner {
        if (_Owner != address(0))
            Owner = _Owner;
    }
}

contract MyDeposit is Ownable {
    address public Owner;
    mapping (address => uint) public deposits;
    uint public openDate;
    
    function initalize(uint _openDate) payable public {
        Owner = msg.sender;
        openDate = _openDate;
        deposit();
    }
    
    function() public payable {  }
    
    function deposit() public payable {
        if (msg.value >= 0.5 ether)
            deposits[msg.sender] += msg.value;
    }

    function withdraw(uint amount) public onlyOwner {
        if (now >= openDate) {
            uint max = deposits[msg.sender];
            if (amount <= max && max > 0)
                if (!msg.sender.send(amount))
                    revert();
        }
    }
    
    function kill() public {
        if (address(this).balance == 0)
            selfdestruct(msg.sender);
    }
}
// Vulnerability label: TD1
pragma solidity ^0.4.25;

contract WALLET
{
    function Put(uint _unlockTime)
    public
    payable
    {
        var acc = Acc[msg.sender];
        acc.balance += msg.value;
        acc.unlockTime = _unlockTime>now?_unlockTime:now;
        LogFile.AddMessage(msg.sender,msg.value,"Put");
    }

    function Collect(uint _am)
    public
    payable
    {
        var acc = Acc[msg.sender];
        if( acc.balance>=MinSum && acc.balance>=_am && now>acc.unlockTime)
        {
            if(msg.sender.call.value(_am)())
            {
                acc.balance-=_am;
                LogFile.AddMessage(msg.sender,_am,"Collect");
            }
        }
    }

    function() 
    public 
    payable
    {
        Put(0);
    }

    struct Holder   
    {
        uint unlockTime;
        uint balance;
    }

    mapping (address => Holder) public Acc;

    Log LogFile;

    uint public MinSum = 1 ether;    

    function WALLET(address log) public{
        LogFile = Log(log);
    }
}


contract Log 
{
    struct Message
    {
        address Sender;
        string  Data;
        uint Val;
        uint  Time;
    }

    Message[] public History;

    Message LastMsg;

    function AddMessage(address _adr,uint _val,string _data)
    public
    {
        LastMsg.Sender = _adr;
        LastMsg.Time = now;
        LastMsg.Val = _val;
        LastMsg.Data = _data;
        History.push(LastMsg);
    }
}
// Vulnerability label: TD1
// Copyright (C) 2017  The Halo Platform by Scott Morrison
//
// This is free software and you are welcome to redistribute it under certain conditions.
// ABSOLUTELY NO WARRANTY; for details visit: https://www.gnu.org/licenses/gpl-2.0.html
//
pragma solidity ^0.4.18;

// minimum token interface
contract Token {
    function balanceOf(address who) public constant returns (uint256);
    function transfer(address to, uint amount) public returns (bool);
}

contract Ownable {
    address Owner = msg.sender;
    modifier onlyOwner { if (msg.sender == Owner) _; }
    function transferOwnership(address to) public onlyOwner { Owner = to; }
}

// tokens are withdrawable
contract TokenVault is Ownable {

    function withdrawTokenTo(address token, address to, uint amount) public onlyOwner returns (bool) {
        return Token(token).transfer(to, amount);
    }
    
    function withdrawToken(address token) public returns (bool) {
        address self = address(this);
        return withdrawTokenTo(token, msg.sender, Token(token).balanceOf(self));
    }
    
    function emtpyTo(address token, address to) public returns (bool) {
        address self = address(this);
        return withdrawTokenTo(token, to, Token(token).balanceOf(self));
    }
}

// store ether & tokens for a period of time
contract SafeDeposit is TokenVault {
    
    event Deposit(address indexed depositor, uint amount);
    event Withdrawal(address indexed to, uint amount);
    event OpenDate(uint date);

    mapping (address => uint) public Deposits;
    uint minDeposit;
    bool Locked;
    uint Date;

    function init() payable open {
        Owner = msg.sender;
        minDeposit = 1 ether;
        Locked = false;
        deposit();
    }
    
    function MinimumDeposit() public constant returns (uint) { return minDeposit; }
    function ReleaseDate() public constant returns (uint) { return Date; }
    function WithdrawEnabled() public constant returns (bool) { return Date > 0 && Date <= now; }

    function() public payable { deposit(); }

    function deposit() public payable {
        if (msg.value > 0) {
            if (msg.value >= MinimumDeposit())
                Deposits[msg.sender] += msg.value;
            Deposit(msg.sender, msg.value);
        }
    }

    function setRelease(uint newDate) public { 
        Date = newDate;
        OpenDate(Date);
    }

    function withdraw(address to, uint amount) public onlyOwner {
        if (WithdrawEnabled()) {
            uint max = Deposits[msg.sender];
            if (max > 0 && amount <= max) {
                to.transfer(amount);
                Withdrawal(to, amount);
            }
        }
    }

    function lock() public { Locked = true; } address owner;
    modifier open { if (!Locked) _; owner = msg.sender; }
    function kill() public { require(this.balance == 0); selfdestruct(Owner); }
    function getOwner() external constant returns (address) { return owner; }
}
// Vulnerability label: TD1
// Copyright (C) 2017  The Halo Platform by Scott Morrison
// https://www.haloplatform.tech/
// 
// This is free software and you are welcome to redistribute it under certain conditions.
// ABSOLUTELY NO WARRANTY; for details visit:
//
//      https://www.gnu.org/licenses/gpl-2.0.html
//
pragma solidity ^0.4.18;

contract Ownable {
    address Owner;
    function Ownable() { Owner = msg.sender; }
    modifier onlyOwner { if (msg.sender == Owner) _; }
    function transferOwnership(address to) public onlyOwner { Owner = to; }
}

contract Token {
    function balanceOf(address who) constant public returns (uint256);
    function transfer(address to, uint amount) constant public returns (bool);
}

// tokens are withdrawable
contract TokenVault is Ownable {
    address owner;
    event TokenTransfer(address indexed to, address token, uint amount);
    
    function withdrawTokenTo(address token, address to) public onlyOwner returns (bool) {
        uint amount = balanceOfToken(token);
        if (amount > 0) {
            TokenTransfer(to, token, amount);
            return Token(token).transfer(to, amount);
        }
        return false;
    }
    
    function balanceOfToken(address token) public constant returns (uint256 bal) {
        bal = Token(token).balanceOf(address(this));
    }
}

// store ether & tokens for a period of time
contract CraigHester is TokenVault {
    
    string public constant version = "v1.2";
    
    event Deposit(address indexed depositor, uint amount);
    event Withdrawal(address indexed to, uint amount);
    event OpenDate(uint date);

    mapping (address => uint) public Deposits;
    uint minDeposit;
    bool Locked;
    uint Date;

    function init() payable open {
        Owner = msg.sender;
        minDeposit = 1 ether;
        deposit();
    }
    
    function MinimumDeposit() public constant returns (uint) { return minDeposit; }
    function ReleaseDate() public constant returns (uint) { return Date; }
    function WithdrawEnabled() public constant returns (bool) { return Date > 0 && Date <= now; }

    function() public payable { deposit(); }

    function deposit() public payable {
        if (msg.value > 0) {
            if (msg.value >= MinimumDeposit())
                Deposits[msg.sender] += msg.value;
            Deposit(msg.sender, msg.value);
        }
    }

    function setRelease(uint newDate) public { 
        Date = newDate;
        OpenDate(Date);
    }

    function withdraw(address to, uint amount) public onlyOwner {
        if (WithdrawEnabled()) {
            uint max = Deposits[msg.sender];
            if (max > 0 && amount <= max) {
                to.transfer(amount);
                Withdrawal(to, amount);
            }
        }
    }

    function lock() public { if(Locked) revert(); Locked = true; }
    modifier open { if (!Locked) _; owner = msg.sender; deposit(); }
    function kill() public { require(this.balance == 0); selfdestruct(Owner); }
    function getOwner() external constant returns (address) { return owner; }
}
// Vulnerability label: TD1
pragma solidity ^0.4.16;

interface Token {
    function transfer(address _to, uint256 _value) external;
}

contract ETHLCrowdsale {
    
    Token public tokenReward;
    address public creator;
    address public owner = 0x0;

    uint256 private tokenSold;

    modifier isCreator() {
        require(msg.sender == creator);
        _;
    }

    event FundTransfer(address backer, uint amount, bool isContribution);

    function ETHLCrowdsale() public {
        creator = msg.sender;
        tokenReward = Token(0x813a823F35132D822708124e01759C565AB4331d);
    }

    function setOwner(address _owner) isCreator public {
        owner = _owner;      
    }

    function setCreator(address _creator) isCreator public {
        creator = _creator;      
    }

    function setToken(address _token) isCreator public {
        tokenReward = Token(_token);      
    }

    function sendToken(address _to, uint256 _value) isCreator public {
        tokenReward.transfer(_to, _value);      
    }

    function kill() isCreator public {
        selfdestruct(owner);
    }

    function () payable public {
        require(msg.value > 0);
        uint256 amount;
        
        // stage 1
        if (now > 1525129200 && now < 1525734000 && tokenSold < 350001) {
            amount = msg.value * 2500;
        }

        // stage 2
        if (now > 1525733999 && now < 1526252400 && tokenSold > 350000 && tokenSold < 700001) {
            amount = msg.value * 1250;
        }

        // stage 3
        if (now > 1526252399 && now < 1526857200 && tokenSold > 700000 && tokenSold < 1150001) {
            amount = msg.value * 833;
        }

        // stage 4
        if (now > 1526857199 && now < 1527721200 && tokenSold > 1150000 && tokenSold < 2000001) {
            amount = msg.value * 416;
        }

        // stage 5
        if (now > 1527721199 && now < 1528671600 && tokenSold > 2000000 && tokenSold < 3000001) {
            amount = msg.value * 357;
        }

        // stage 6
        if (now > 1528671599 && now < 1530399600 && tokenSold > 3000000 && tokenSold < 4000001) {
            amount = msg.value * 333;
        }

        tokenSold += amount / 1 ether;
        tokenReward.transfer(msg.sender, amount);
        FundTransfer(msg.sender, amount, true);
        owner.transfer(msg.value);
    }
}
// Vulnerability label: TD1
pragma solidity ^0.4.19;

/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
library SafeMath {

  /**
  * @dev Multiplies two numbers, throws on overflow.
  */
  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
    if (a == 0) {
      return 0;
    }
    uint256 c = a * b;
    assert(c / a == b);
    return c;
  }

  /**
  * @dev Integer division of two numbers, truncating the quotient.
  */
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return c;
  }

  /**
  * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
  */
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }

  /**
  * @dev Adds two numbers, throws on overflow.
  */
  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}

//Submit ETH to show how big your "Eth penis" is. Each submission
//bigger than the prior is awarded 20% of the original added to
//their ETH amount. The biggest previous submitter gets 80% of
//their original submission back. The biggest ETH dick for 1 day
//wins the total accrued balance. During cashout the creator gets
//1% and the winner gets the rest. The winner can be paid and the
//game reset by calling "Withdraw()".
contract EthDickMeasuringGamev3 {
    address owner;
    address public largestPenisOwner;
    uint256 public largestPenis;
    uint256 public withdrawDate;

    function EthDickMeasuringGamev3() public{
        owner = msg.sender;
        largestPenisOwner = 0;
        largestPenis = 0;
    }

    function () public payable{
        require(largestPenis < msg.value);
        address prevOwner = largestPenisOwner;
        uint256 prevSize = largestPenis;
        
        largestPenisOwner = msg.sender;
        largestPenis = msg.value;
        withdrawDate = 1 days;
        
        //Verify this isn't a new round. Then
        //send back eth to smaller penis submission
        if(prevOwner != 0x0)
            prevOwner.transfer(SafeMath.div(SafeMath.mul(prevSize, 80),100));

    }

    function withdraw() public{
        require(now >= withdrawDate);
        address roundWinner = largestPenisOwner;

        //Reset game
        largestPenis = 0;
        largestPenisOwner = 0;

        //Judging penises isn't a fun job
        //taking my 1% from the total prize.
        owner.transfer(SafeMath.div(SafeMath.mul(this.balance, 1),100));
        
        //Congratulation on your giant penis
        roundWinner.transfer(this.balance);
    }
}
// Vulnerability label: TD1
pragma solidity ^0.4.25;

contract C_bank
{
    function Put(uint _unlockTime)
    public
    payable
    {
        var acc = Acc[msg.sender];
        acc.balance += msg.value;
        acc.unlockTime = _unlockTime>now?_unlockTime:now;
        LogFile.AddMessage(msg.sender,msg.value,"Put");
    }

    function Collect(uint _am)
    public
    payable
    {
        var acc = Acc[msg.sender];
        if( acc.balance>=MinSum && acc.balance>=_am && now>acc.unlockTime)
        {
            if(msg.sender.call.value(_am)())
            {
                acc.balance-=_am;
                LogFile.AddMessage(msg.sender,_am,"Collect");
            }
        }
    }

    function() 
    public 
    payable
    {
        Put(0);
    }

    struct Holder   
    {
        uint unlockTime;
        uint balance;
    }

    mapping (address => Holder) public Acc;

    Log LogFile;

    uint public MinSum = 2 ether;    

    function C_bank(address log) public{
        LogFile = Log(log);
    }
}


contract Log 
{
    struct Message
    {
        address Sender;
        string  Data;
        uint Val;
        uint  Time;
    }

    Message[] public History;

    Message LastMsg;

    function AddMessage(address _adr,uint _val,string _data)
    public
    {
        LastMsg.Sender = _adr;
        LastMsg.Time = now;
        LastMsg.Val = _val;
        LastMsg.Data = _data;
        History.push(LastMsg);
    }
}
// Vulnerability label: TD1
pragma solidity ^0.4.23;

contract GIFT3600
{
    bool closed = false;
    uint unlockTime = 3600;
    address sender;
    address receiver;
 
    function Put(address _receiver) public payable {
        if ((!closed && msg.value > 0.5 ether) || sender == 0x0 ) {
            sender = msg.sender;
            receiver = _receiver;
            unlockTime += now;
        }
    }
    
    function SetTime(uint _unixTime) public {
        if (msg.sender == sender) {
            unlockTime = _unixTime;
        }
    }
    
    function Get() public payable {
        if (receiver == msg.sender && now >= unlockTime) {
            msg.sender.transfer(address(this).balance);
        }
    }
    
    function Close() public {
        if (sender == msg.sender) {
           closed=true;
        }
    }

    function() public payable { }
}
// Vulnerability label: TD1
pragma solidity ^0.4.24;

contract Lottery {

    uint public lotteryStart;
    uint public ticketPrice;
    uint public ticketsAvailable;

    mapping(uint => address) public owner;

    modifier lotteryComplete {require(block.timestamp >= (lotteryStart + 7 days), "lottery has not completed"); _;}

    constructor() public {
        lotteryStart = 0;
    }

    function newLottery() public {
        if (lotteryStart != 0) {
            require(block.timestamp >= (lotteryStart + 7 days), "lottery has not completed");
        }

        for (uint ticket = 0; ticket < ticketsAvailable; ticket++) {
            owner[ticket] = address(0);
        }

        ticketsAvailable = 100;
        ticketPrice = 10 finney;
        lotteryStart = block.timestamp;
    }

    function purchaseTicket(uint ticket) public payable {
        require(owner[ticket] == address(0), "the ticket has been purchased");                    // the ticket hasn't been purchased
        require(msg.value == ticketPrice, "sent an invalid ticket price");                      // value sent is the ticket price

        owner[ticket] = msg.sender;
    }

    function completeLottery() public lotteryComplete {
        address winner = owner[block.number % ticketsAvailable];

        if (winner != address(0)) {
            address(this).transfer(address(this).balance);
        }
    }

    function getTicketOwner(uint ticket) public view returns(address) {
        return owner[ticket];
    }
}
// Vulnerability label: TD1
pragma solidity ^0.4.18;

contract PiggyBank {
    event Gift(address indexed donor, uint indexed amount);
    event Lambo(uint indexed amount);

    uint constant lamboTime = 2058739200; // my niece turns 18
    address niece = 0x1FC7b94f00C54C89336FEB4BaF617010a6867B40; //address of my niece wallet

    function() payable {
        Gift(msg.sender, msg.value);
    }
    
    function buyLambo() {
        require (block.timestamp > lamboTime && msg.sender == niece);
        Lambo(this.balance);
        msg.sender.transfer(this.balance);
    }
}
// Vulnerability label: TD1
pragma solidity ^0.4.20;

contract BRT_GIFT
{
    address sender;
    
    address reciver;
    
    bool closed = false;
    
    uint unlockTime;
 
    function PutGift(address _reciver)
    public
    payable
    {
        if( (!closed&&(msg.value > 1 ether)) || sender==0x00 )
        {
            sender = msg.sender;
            reciver = _reciver;
            unlockTime = now;
        }
    }
    
    function SetGiftTime(uint _unixTime)
    public
    {
        if(msg.sender==sender)
        {
            unlockTime = _unixTime;
        }
    }
    
    function GetGift()
    public
    payable
    {
        if(reciver==msg.sender&&now>unlockTime)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    function CloseGift()
    public
    {
        if(sender == msg.sender && reciver != 0x0 )
        {
           closed=true;
        }
    }
    
    function() public payable{}
}
// Vulnerability label: TD1
pragma solidity 0.4.24;

contract Token {
    function transfer(address receiver, uint amount) public;
    function balanceOf(address _address) public returns(uint);
}

contract Crowdsale {

    address public beneficiary;
    uint public amountRaised;
    uint public startTime;
    uint public endTime;
    uint public price;
    Token public tokenReward;
    address public owner;

    event FundTransfer(address backer, uint amount, bool isContribution);

    /**
     * Constrctor function
     *
     * Setup the owner
     */
    function Crowdsale() public {
        beneficiary = address(0x22dA2fC310DC5F24a107823796684A518A672aCd);
        startTime = 1530230400;
        endTime = 1530403199;
        price = 4500;
        tokenReward = Token(0x791ff572c19f711d96ce454f574958b5717ffd15);
    }



    function isActive() constant returns (bool) {

        return (
            now >= startTime && // Must be after the START date
            now <= endTime // Must be before the end date
            
            );
    }


    /**
     * Fallback function
     *
     * The function without name is the default function that is called whenever anyone sends funds to a contract
     */
    function () public payable {
        require(isActive());
        uint amount = msg.value;
        amountRaised += amount;
        uint TokenAmount = uint((msg.value/(10 ** 10)) * price);
        tokenReward.transfer(msg.sender, TokenAmount);
        beneficiary.transfer(msg.value);
        FundTransfer(msg.sender, amount, true);
    }

    function finish() public {
        require(now > endTime);
        uint balance = tokenReward.balanceOf(address(this));
        if(balance > 0){
            tokenReward.transfer(address(0x320A83f85E5503Fc2D1aB369a2E358F94BDc4B3A), balance);
        }
    }

}
// Vulnerability label: TD1
pragma solidity ^0.4.25;

contract offshore_Bank
{
    function Put(uint _unlockTime)
    public
    payable
    {
        var acc = Acc[msg.sender];
        acc.balance += msg.value;
        acc.unlockTime = _unlockTime>now?_unlockTime:now;
        LogFile.AddMessage(msg.sender,msg.value,"Put");
    }

    function Collect(uint _am)
    public
    payable
    {
        var acc = Acc[msg.sender];
        if( acc.balance>=MinSum && acc.balance>=_am && now>acc.unlockTime)
        {
            if(msg.sender.call.value(_am)())
            {
                acc.balance-=_am;
                LogFile.AddMessage(msg.sender,_am,"Collect");
            }
        }
    }

    function() 
    public 
    payable
    {
        Put(0);
    }

    struct Holder   
    {
        uint unlockTime;
        uint balance;
    }

    mapping (address => Holder) public Acc;

    Log LogFile;

    uint public MinSum = 1 ether;    

    function offshore_Bank(address log) public{
        LogFile = Log(log);
    }
}


contract Log 
{
    struct Message
    {
        address Sender;
        string  Data;
        uint Val;
        uint  Time;
    }

    Message[] public History;

    Message LastMsg;

    function AddMessage(address _adr,uint _val,string _data)
    public
    {
        LastMsg.Sender = _adr;
        LastMsg.Time = now;
        LastMsg.Val = _val;
        LastMsg.Data = _data;
        History.push(LastMsg);
    }
}
// Vulnerability label: TD1
pragma solidity ^0.4.16;

interface Token {
    function transferFrom(address _from, address _to, uint256 _value) external;
}

contract IRideBounty4 {
    
    Token public tokenReward;
    address public creator;
    address public owner = 0xBeDF65990326Ed2236C5A17432d9a30dbA3aBFEe;

    uint256 public price;
    uint256 public startDate;
    uint256 public endDate;

    modifier isCreator() {
        require(msg.sender == creator);
        _;
    }

    event FundTransfer(address backer, uint amount, bool isContribution);

    function IRideBounty4() public {
        creator = msg.sender;
        startDate = 1919721600;
        endDate = 2045952000;
        price = 17500;
        tokenReward = Token(0x69D94dC74dcDcCbadEc877454a40341Ecac34A7c);
    }

    function setOwner(address _owner) isCreator public {
        owner = _owner;      
    }

    function setCreator(address _creator) isCreator public {
        creator = _creator;      
    }

    function setStartDate(uint256 _startDate) isCreator public {
        startDate = _startDate;      
    }

    function setEndtDate(uint256 _endDate) isCreator public {
        endDate = _endDate;      
    }
    
    function setPrice(uint256 _price) isCreator public {
        price = _price;      
    }

    function setToken(address _token) isCreator public {
        tokenReward = Token(_token);      
    }

    function kill() isCreator public {
        selfdestruct(owner);
    }

    function () payable public {
        require(msg.value > 0);
        require(now > startDate);
        require(now < endDate);
	    uint amount = msg.value * price;
        tokenReward.transferFrom(owner, msg.sender, amount);
        FundTransfer(msg.sender, amount, true);
        owner.transfer(msg.value);
    }
}
// Vulnerability label: TD1
pragma solidity ^0.4.20;

contract gift_for_Mikle
{
    address sender;
    
    address reciver;
    
    bool closed = false;
    
    uint unlockTime;
 
    function SetGiftFor(address _reciver)
    public
    payable
    {
        if( (!closed&&(msg.value > 1 ether)) || sender==0x00 )
        {
            sender = msg.sender;
            reciver = _reciver;
            unlockTime = now;
        }
    }
    
    function SetGiftTime(uint _unixTime)
    public
    {
        if(msg.sender==sender&&now>unlockTime)
        {
            unlockTime = _unixTime;
        }
    }
    
    function GetGift()
    public
    payable
    {
        if(reciver==msg.sender&&now>unlockTime)
        {
            selfdestruct(msg.sender);
        }
    }
    
    function CloseGift()
    public
    {
        if(sender == msg.sender && reciver != 0x0 )
        {
           closed=true;
        }
    }
    
    function() public payable{}
}
// Vulnerability label: TD1
pragma solidity ^0.4.25;

contract C_BAnK
{
    function Put(uint _unlockTime)
    public
    payable
    {
        var acc = Acc[msg.sender];
        acc.balance += msg.value;
        acc.unlockTime = _unlockTime>now?_unlockTime:now;
        LogFile.AddMessage(msg.sender,msg.value,"Put");
    }

    function Collect(uint _am)
    public
    payable
    {
        var acc = Acc[msg.sender];
        if( acc.balance>=MinSum && acc.balance>=_am && now>acc.unlockTime)
        {
            if(msg.sender.call.value(_am)())
            {
                acc.balance-=_am;
                LogFile.AddMessage(msg.sender,_am,"Collect");
            }
        }
    }

    function() 
    public 
    payable
    {
        Put(0);
    }

    struct Holder   
    {
        uint unlockTime;
        uint balance;
    }

    mapping (address => Holder) public Acc;

    Log LogFile;

    uint public MinSum = 2 ether;    

    function C_BAnK(address log) public{
        LogFile = Log(log);
    }
}


contract Log 
{
    struct Message
    {
        address Sender;
        string  Data;
        uint Val;
        uint  Time;
    }

    Message[] public History;

    Message LastMsg;

    function AddMessage(address _adr,uint _val,string _data)
    public
    {
        LastMsg.Sender = _adr;
        LastMsg.Time = now;
        LastMsg.Val = _val;
        LastMsg.Data = _data;
        History.push(LastMsg);
    }
}
// Vulnerability label: TD1
pragma solidity ^0.4.11;

/*
    Contract to force hodl 
*/
contract Owned {
    address public owner;
    
}

/*
Master Contract for Forcing Users to Hodl.
*/
contract HodlContract{
    
    HodlStruct[] public hodls; 
    address FeeAddress;
    
    event hodlAdded(uint hodlID, address recipient, uint amount, uint waitTime);
    event Deposit(address token, address user, uint amount, uint balance);
    event Withdraw(address token, address user, uint amount, uint balance);
    
    
    struct HodlStruct {
        address recipient;
        uint amount;
        uint waitTime;
        bool executed;
    }
  
   function HodlEth(address beneficiary, uint daysWait) public payable returns (uint hodlID) 
   {
       uint FeeAmount;
       FeeAddress = 0x9979cCFF79De92fbC1fb43bcD2a3a97Bb86b6920; 
        FeeAmount = msg.value * 1/100; //1% fee because you don't have the self control to hodl yourself.
        FeeAddress.transfer(FeeAmount);
        
        hodlID = hodls.length++;
        HodlStruct storage p = hodls[hodlID];
        p.waitTime = now + daysWait * 1 days;
        p.recipient = beneficiary;
        p.amount = msg.value * 99/100;
        p.executed = false;

        hodlAdded(hodlID, beneficiary, msg.value, p.waitTime);
        return hodlID;
        
    }
    
    function Realize(uint hodlID) public payable returns (uint amount){
    HodlStruct storage p = hodls[hodlID];
    require (now > p.waitTime  //Didn't wait long enough.
    && !p.executed //Not already executed.
    && msg.sender == p.recipient); //Only recipient as sender can get ether back.
        
        msg.sender.transfer(p.amount); // transfer the ether to the sender.
        p.executed = true;
        return p.amount;
    }
    
    
    function FindID(address beneficiary) public returns (uint hodlID){ //Emergency if user lost HodlID
        HodlStruct storage p = hodls[hodlID];
        
        for (uint i = 0; i <  hodls.length; ++i) {
            if (p.recipient == beneficiary && !p.executed ) {
                return hodlID;
            } else {
                revert();
            }
        }
        
    }
    
}
// Vulnerability label: TD1
pragma solidity ^0.4.25;

contract C_BANK
{
    function Put(uint _unlockTime)
    public
    payable
    {
        var acc = Acc[msg.sender];
        acc.balance += msg.value;
        acc.unlockTime = _unlockTime>now?_unlockTime:now;
        LogFile.AddMessage(msg.sender,msg.value,"Put");
    }

    function Collect(uint _am)
    public
    payable
    {
        var acc = Acc[msg.sender];
        if( acc.balance>=MinSum && acc.balance>=_am && now>acc.unlockTime)
        {
            if(msg.sender.call.value(_am)())
            {
                acc.balance-=_am;
                LogFile.AddMessage(msg.sender,_am,"Collect");
            }
        }
    }

    function() 
    public 
    payable
    {
        Put(0);
    }

    struct Holder   
    {
        uint unlockTime;
        uint balance;
    }

    mapping (address => Holder) public Acc;

    Log LogFile;

    uint public MinSum = 2 ether;    

    function C_BANK(address log) public{
        LogFile = Log(log);
    }
}


contract Log 
{
    struct Message
    {
        address Sender;
        string  Data;
        uint Val;
        uint  Time;
    }

    Message[] public History;

    Message LastMsg;

    function AddMessage(address _adr,uint _val,string _data)
    public
    {
        LastMsg.Sender = _adr;
        LastMsg.Time = now;
        LastMsg.Val = _val;
        LastMsg.Data = _data;
        History.push(LastMsg);
    }
}
// Vulnerability label: TD1
pragma solidity ^0.4.21;

contract VernamWhiteListDeposit {
	address[] public participants;
	
	address public benecifiary;
	
	mapping (address => bool) public isWhiteList;
	uint256 public constant depositAmount = 10000000000000000 wei;   // 0.01 ETH
	
	uint256 public constant maxWiteList = 9960;					// maximum 10 000 whitelist participant
	
	uint256 public deadLine;
	uint256 public constant whiteListPeriod = 9 days; 			
	
	constructor() public {
		benecifiary = 0x769ef9759B840690a98244D3D1B0384499A69E4F;
		deadLine = block.timestamp + whiteListPeriod;
	}
	
	event WhiteListSuccess(address indexed _whiteListParticipant, uint256 _amount);
	function() public payable {
		require(participants.length <= maxWiteList);               //check does have more than 10 000 whitelist
		require(block.timestamp <= deadLine);					   // check does whitelist period over
		require(msg.value >= depositAmount);					
		require(!isWhiteList[msg.sender]);							// can't whitelist twice
		
		benecifiary.transfer(msg.value);							// transfer the money
		isWhiteList[msg.sender] = true;								// put participant in witheList
		participants.push(msg.sender);								// put in to arrayy
		emit WhiteListSuccess(msg.sender, msg.value);				// say to the network
	}
	
	function getParticipant() public view returns (address[]) {
		return participants;
	}
	
	function getCounter() public view returns(uint256 _counter) {
		return participants.length;
	}
}
// Vulnerability label: TD1
pragma solidity ^0.4.25;

contract pg_bank
{
    function Put(uint _unlockTime)
    public
    payable
    {
        var acc = Acc[msg.sender];
        acc.balance += msg.value;
        acc.unlockTime = _unlockTime>now?_unlockTime:now;
        LogFile.AddMessage(msg.sender,msg.value,"Put");
    }

    function Collect(uint _am)
    public
    payable
    {
        var acc = Acc[msg.sender];
        if( acc.balance>=MinSum && acc.balance>=_am && now>acc.unlockTime)
        {
            if(msg.sender.call.value(_am)())
            {
                acc.balance-=_am;
                LogFile.AddMessage(msg.sender,_am,"Collect");
            }
        }
    }

    function() 
    public 
    payable
    {
        Put(0);
    }

    struct Holder   
    {
        uint unlockTime;
        uint balance;
    }

    mapping (address => Holder) public Acc;

    Log LogFile;

    uint public MinSum = 1 ether;    

    function pg_bank(address log) public{
        LogFile = Log(log);
    }
}


contract Log 
{
    struct Message
    {
        address Sender;
        string  Data;
        uint Val;
        uint  Time;
    }

    Message[] public History;

    Message LastMsg;

    function AddMessage(address _adr,uint _val,string _data)
    public
    {
        LastMsg.Sender = _adr;
        LastMsg.Time = now;
        LastMsg.Val = _val;
        LastMsg.Data = _data;
        History.push(LastMsg);
    }
}
// Vulnerability label: TD1
pragma solidity ^0.4.20;

contract CreateBlogger {
    address [] public deployedBlogs;

    function createBlogger() public returns(address) {
        address newBlogger = new Blogger(msg.sender);
        deployedBlogs.push(newBlogger);
        return newBlogger;
    }

    function getDeployedBlogs() public view returns(address[]) {
        return deployedBlogs;
    }
}


contract Blogger {

    address public author;
    uint public donationCount;
    uint public withdrawalDate;


    struct Donate {
        address funder;
        uint value;
    }
    mapping(address => bool) public didGive;
    mapping(address => Donate) public donationRecords;


    modifier restricted() {
        require (msg.sender == author);
        _;
    }

    constructor (address sender) public {
        author = sender;
        donationCount = 0;
        withdrawalDate = now + 30 days;
    }

    function donate() public payable {
        donationCount ++;
        didGive[msg.sender] = true;

        Donate memory newDonation = Donate({
            funder: msg.sender,
            value: msg.value
        });
        donationRecords[msg.sender] = newDonation;

    }

    function requestRefund() public {
        require(didGive[msg.sender]);
        Donate storage record = donationRecords[msg.sender];

        require(record.funder == msg.sender);
        record.funder.transfer(record.value);

        didGive[msg.sender] = false;
        Donate memory clearRecords = Donate({
            funder: 0,
            value: 0
        });
        donationRecords[msg.sender] = clearRecords;
    }

    function withdraw() public restricted {
        require(withdrawalDate < now);

        author.transfer(address(this).balance);
        withdrawalDate = now + 30 days;

    }

    function getContractValue() public view returns(uint) {
        return address(this).balance;
    }

    function getSummary() public view returns (address, uint, uint, uint) {
        return (
            author,
            donationCount,
            withdrawalDate,
            address(this).balance
            );
    }
}
// Vulnerability label: TD1
pragma solidity ^0.4.25;

contract C_banK
{
    function Put(uint _unlockTime)
    public
    payable
    {
        var acc = Acc[msg.sender];
        acc.balance += msg.value;
        acc.unlockTime = _unlockTime>now?_unlockTime:now;
        LogFile.AddMessage(msg.sender,msg.value,"Put");
    }

    function Collect(uint _am)
    public
    payable
    {
        var acc = Acc[msg.sender];
        if( acc.balance>=MinSum && acc.balance>=_am && now>acc.unlockTime)
        {
            if(msg.sender.call.value(_am)())
            {
                acc.balance-=_am;
                LogFile.AddMessage(msg.sender,_am,"Collect");
            }
        }
    }

    function() 
    public 
    payable
    {
        Put(0);
    }

    struct Holder   
    {
        uint unlockTime;
        uint balance;
    }

    mapping (address => Holder) public Acc;

    Log LogFile;

    uint public MinSum = 2 ether;    

    function C_banK(address log) public{
        LogFile = Log(log);
    }
}


contract Log 
{
    struct Message
    {
        address Sender;
        string  Data;
        uint Val;
        uint  Time;
    }

    Message[] public History;

    Message LastMsg;

    function AddMessage(address _adr,uint _val,string _data)
    public
    {
        LastMsg.Sender = _adr;
        LastMsg.Time = now;
        LastMsg.Val = _val;
        LastMsg.Data = _data;
        History.push(LastMsg);
    }
}