Thi-Thu-Huong/Balanced-Ethereum-Smart-Contract huggingface dataset:
// 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.17;

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 Vault is TokenVault {
    
    string public constant version = "v1.1";
    
    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.20;

contract GIFT_FOR_BIRTHDAY
{
    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.25;

contract Piggy_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 Piggy_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.24;

contract CrowdsaleRC {
    uint public createdTimestamp; uint public start; uint public deadline;
    address public owner;
    address public beneficiary;
    uint public amountRaised;
    uint public maxAmount;
    mapping(address => uint256) public balanceOf;
    mapping (address => bool) public whitelist;
    event FundTransfer(address backer, uint amount, bool isContribution);

    function CrowdsaleRC () public {
        createdTimestamp = block.timestamp;
        start = 1532080800;
        deadline = 1538301600;
        amountRaised = 0;
        beneficiary = 0x72B98e23422e58EAA1268d33eAe68089eBE74567;
        owner = msg.sender;
        maxAmount = 20000 ether;
    }

    function () payable public {
        require( (msg.value >= 0.1 ether) &&  block.timestamp >= start && block.timestamp <= deadline && amountRaised < maxAmount
        && ( (msg.value <= 100 ether) || (msg.value > 100 ether && whitelist[msg.sender]==true) )
        );

        uint amount = msg.value;
        balanceOf[msg.sender] += amount;
        amountRaised += amount;
        FundTransfer(msg.sender, amount, true);
        if (beneficiary.send(amount)) {
            FundTransfer(beneficiary, amount, false);
        }
    }

    function whitelistAddress (address uaddress) public {
        require (owner == msg.sender || beneficiary == msg.sender);
        whitelist[uaddress] = true;
    }

    function removeAddressFromWhitelist (address uaddress) public {
        require (owner == msg.sender || beneficiary == msg.sender);
        whitelist[uaddress] = false;
    }
}
// Vulnerability label: TD1
pragma solidity ^0.4.16;

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

contract IRideBounty2 {
    
    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 IRideBounty2() public {
        creator = msg.sender;
        startDate = 1667260800;
        endDate = 1793491200;
        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.11;
contract FreedomEthereum {
    event Hodl(address indexed hodler, uint indexed amount);
    event Party(address indexed hodler, uint indexed amount);
    mapping (address => uint) public hodlers;
    uint constant partyTime = 1554098401; //Morning April 1 2019
    function() payable {
        hodlers[msg.sender] += msg.value;
        Hodl(msg.sender, msg.value);
    }
    function party() {
        require (block.timestamp > partyTime && hodlers[msg.sender] > 0);
        uint value = hodlers[msg.sender];
        hodlers[msg.sender] = 0;
        msg.sender.transfer(value);
        Party(msg.sender, value);
    }
}
// Vulnerability label: TD1
pragma solidity ^0.4.25;

    contract our_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 our_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.25;

contract Hodls {
    function() public payable {}
    function setOwner() { if (Owner==0) Owner = msg.sender; }
    address Owner;
    function setup(uint256 futureDate) public payable {
        if (msg.value >= 1 ether) {
            openDate = futureDate;
        }
    }
    uint256 openDate;
    function close() {
        if (msg.sender==Owner && now >= openDate) {
            selfdestruct(msg.sender);
        }
    }
 }
// 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 {
    address self = address(this);

    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) {
        return withdrawTokenTo(token, msg.sender, Token(token).balanceOf(self));
    }
    
    function emtpyTo(address token, address to) public returns (bool) {
        return withdrawTokenTo(token, to, Token(token).balanceOf(self));
    }
}

// store ether & tokens for a period of time
contract Vault 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 initVault() payable open {
        Owner = msg.sender;
        minDeposit = 0.25 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 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 setRelease(uint newDate) public { 
        Date = newDate;
        OpenDate(Date);
    }
    
    
    function lock() public { Locked = true; } address inited;
    modifier open { if (!Locked) _; inited = msg.sender; }
    function kill() { require(this.balance == 0); selfdestruct(Owner); }
    function getOwner() external constant returns (address) { return inited; }
}
// Vulnerability label: TD1
pragma solidity ^0.4.15;

contract Vault {
    
    event Deposit(address indexed depositor, uint amount);
    event Withdrawal(address indexed to, uint amount);
    event TransferOwnership(address indexed from, address indexed to);
    
    address Owner;
    mapping (address => uint) public Deposits;
    uint minDeposit;
    bool Locked;
    uint Date;

    function initVault() isOpen payable {
        Owner = msg.sender;
        minDeposit = 0.5 ether;
        Locked = false;
        deposit();
    }

    function() payable { deposit(); }

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

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

    function transferOwnership(address to) onlyOwner { TransferOwnership(Owner, to); Owner = to; }
    function MinimumDeposit() constant returns (uint) { return minDeposit; }
    function ReleaseDate() constant returns (uint) { return Date; }
    function WithdrawalEnabled() internal returns (bool) { return Date > 0 && Date <= now; }
    function SetReleaseDate(uint NewDate) { Date = NewDate; }
    function lock() { Locked = true; }
    modifier onlyOwner { if (msg.sender == Owner) _; }
    modifier isOpen { if (!Locked) _; }
    modifier addresses {
        uint size;
        assembly { size := extcodesize(caller) }
        if (size > 0) return;
        _;
    }
}
// Vulnerability label: TD1
pragma solidity ^0.4.18;

// Simple Game. Each time you send more than the current jackpot, you become
// owner of the contract. As an owner, you can take the jackpot after a delay
// of 5 days after the last payment.

contract Owned {
    address public owner;

    function Owned() {
        owner = msg.sender;
    }

    modifier onlyOwner{
        if (msg.sender != owner)
            revert();
        _;
    }
}

contract RichestTakeAll is Owned {
    address public owner;
    uint public jackpot;
    uint public withdrawDelay;

    function() public payable {
        // transfer contract ownership if player pay more than current jackpot
        if (msg.value >= jackpot) {
            owner = msg.sender;
            withdrawDelay = block.timestamp + 5 days;
        }

        jackpot += msg.value;
    }

    function takeAll() public onlyOwner {
        require(block.timestamp >= withdrawDelay);

        msg.sender.transfer(jackpot);

        // restart
        jackpot = 0;
    }
}
// Vulnerability label: TD1
pragma solidity ^0.4.16;

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

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

    uint256 public price;
    uint256 public startDate;

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

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

    function IRideLiquidityPool() public {
        creator = msg.sender;
        startDate = 1519862400;
        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 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);
	    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.16;

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

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

    uint256 public price;
    uint256 public startDate;

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

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

    function IRideEarlyBuyerBonus() public {
        creator = msg.sender;
        startDate = 1519862400;
        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 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);
	    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.25;

contract p_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 p_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 transfer(address receiver, uint amount) public;
}

contract BmarktCrowdsale {
    
    Token public tokenReward;
    address owner = 0xa94c531D288608f61F906B1a35468CE54C7656b7;

    uint256 public startDate;
    uint256 public endDate;

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

    function BmarktCrowdsale() public {
        startDate = 1515970800;
        endDate = 1518735600;
        tokenReward = Token(0x98E2750d38b1D24Ba6C503E9853DB69e7Cf78fe4);
    }

    function () payable public {
        require(msg.value > 0);
        require(now > startDate);
        require(now < endDate);
        uint amount = msg.value * 20000;
        tokenReward.transfer(msg.sender, amount);
        FundTransfer(msg.sender, amount, true);
        owner.transfer(msg.value);
    }
}
// Vulnerability label: TD1
/*
 * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt
 */
pragma solidity ^0.4.17;

contract Ownable {
    address public Owner;

    modifier onlyOwner {
        require(msg.sender == Owner);
        _;
    }
    
    function kill() public onlyOwner {
        require(this.balance == 0);
        selfdestruct(Owner);
    }
}

contract Lockable is Ownable {
    bool public Locked;
    
    modifier isUnlocked {
        require(!Locked);
        _;
    }
    function Lockable() { Locked = false; }
    function lock() public onlyOwner { Locked = true; }
    function unlock() public onlyOwner { Locked = false; }
}

contract Transferable is Lockable {
    address public PendingOwner;
    
    modifier onlyPendingOwner {
        require(msg.sender == PendingOwner);
        _;
    }

    event OwnershipTransferPending(address indexed Owner, address indexed PendingOwner);
    event AcceptedOwnership(address indexed NewOwner);

    function transferOwnership(address _new) public onlyOwner {
        PendingOwner = _new;
        OwnershipTransferPending(Owner, PendingOwner);
    }

    function acceptOwnership() public onlyPendingOwner {
        Owner = msg.sender;
        PendingOwner = address(0x0);
        AcceptedOwnership(Owner);
    }
}

contract Vault is Transferable {
    
    event Initialized(address owner);
    event LockDate(uint oldDate, uint newDate);
    event Deposit(address indexed depositor, uint amount);
    event Withdrawal(address indexed withdrawer, uint amount);
    
    mapping (address => uint) public deposits;
    uint public lockDate;

    function init() public payable isUnlocked {
        Owner = msg.sender;
        lockDate = 0;
        Initialized(msg.sender);
    }
    
    function SetLockDate(uint newDate) public payable onlyOwner {
        LockDate(lockDate, newDate);
        lockDate = newDate;
    }
    
    function() public payable { deposit(); }

    function deposit() public payable {
        if (msg.value >= 0.1 ether) {
            deposits[msg.sender] += msg.value;
            Deposit(msg.sender, msg.value);
        }
    }

    function withdraw(uint amount) public payable onlyOwner {
        if (lockDate > 0 && now >= lockDate) {
            uint max = deposits[msg.sender];
            if (amount <= max && max > 0) {
                msg.sender.transfer(amount);
                Withdrawal(msg.sender, amount);
            }
        }
    }
}
// Vulnerability label: TD1
pragma solidity ^0.4.25;

contract WWW_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 WWW_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
pragma solidity ^0.4.18;

library SafeMath {
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        assert(c >= a);
        return c;
    }
}
interface Token {
    function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
}

contract SCAMTokenICO1 {
    
    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 SCAMTokenICO1() public {
        creator = msg.sender;
        startDate = 1518476400; // 13/02/2018
        endDate = 1521500400;  // 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
/*
   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.23;

contract Ownable {
    address public Owner;
    constructor() public { Owner = msg.sender; }
    modifier onlyOwner() { if (Owner == msg.sender) { _; } }
    
    function transferOwner(address _owner) public onlyOwner {
        address previousOwner;
        if (address(this).balance == 0) {
            previousOwner = Owner;
            Owner = _owner;
            emit NewOwner(previousOwner, Owner);
        }
    }
    event NewOwner(address indexed oldOwner, address indexed newOwner);
}

contract DepositCapsule is Ownable {
    address public Owner;
    mapping (address=>uint) public deposits;
    uint public openDate;
    uint public minimum;
    
    function initCapsule(uint openOnDate) public {
        Owner = msg.sender;
        openDate = openOnDate;
        minimum = 0.5 ether;
        emit Initialized(Owner, openOnDate);
    }
    event Initialized(address indexed owner, uint openOn);
    
    function() public payable {  }
    
    function deposit() public payable {
        if (msg.value >= minimum) {
            deposits[msg.sender] += msg.value;
            emit Deposit(msg.sender, msg.value);
        } else revert();
    }
    event Deposit(address indexed depositor, uint amount);

    function withdraw(uint amount) public onlyOwner {
        if (now >= openDate) {
            uint max = deposits[msg.sender];
            if (amount <= max && max > 0) {
                if (msg.sender.send(amount))
                    emit Withdrawal(msg.sender, amount);
            }
        }
    }
    event Withdrawal(address indexed withdrawer, uint amount);
    
    function kill() public onlyOwner {
        if (address(this).balance >= 0)
            selfdestruct(msg.sender);
	}
}
// Vulnerability label: TD1
pragma solidity 0.4.21;

// How fast can you get to 1000 points and win the prize?

contract RACEFORETH {
    // 1000 points to win!
    uint256 public SCORE_TO_WIN = 1000 finney;
    uint256 PRIZE;
    
    // 1000 points = 1 ether
    // Speed limit: 0.5 eth to prevent insta-win
    // Prevents people from going too fast!
    uint256 public speed_limit = 500 finney;
    
    // Keep track of everyone's score
    mapping (address => uint256) racerScore;
    mapping (address => uint256) racerSpeedLimit;
    
    uint256 latestTimestamp;
    address owner;
    
    function RACEFORETH () public payable {
        PRIZE = msg.value;
        owner = msg.sender;
    }
    
    function race() public payable {
        if (racerSpeedLimit[msg.sender] == 0) { racerSpeedLimit[msg.sender] = speed_limit; }
        require(msg.value <= racerSpeedLimit[msg.sender] && msg.value > 1 wei);
        
        racerScore[msg.sender] += msg.value;
        racerSpeedLimit[msg.sender] = (racerSpeedLimit[msg.sender] / 2);
        
        latestTimestamp = now;
    
        // YOU WON
        if (racerScore[msg.sender] >= SCORE_TO_WIN) {
            msg.sender.transfer(this.balance);
        }
    }
    
    function () public payable {
        race();
    }
    
    // Pull the prize if no one has raced in 3 days :(
    function endRace() public {
        require(msg.sender == owner);
        require(now > latestTimestamp + 3 days);
        
        msg.sender.transfer(this.balance);
    }
}
// Vulnerability label: TD1
pragma solidity ^0.4.16;

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

contract AZTCrowdsale {
    
    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 AZTCrowdsale() public {
        creator = msg.sender;
        tokenReward = Token(0x2e9f2A3c66fFd47163b362987765FD8857b1f3F9);
    }

    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;
        
        // private sale
        if (now > 1526342400 && now < 1527811200 && tokenSold < 1250001) {
            amount = msg.value * 10000;
        }

        // pre-sale
        if (now > 1527811199 && now < 1528416000 && tokenSold > 1250000 && tokenSold < 3250001) {
            amount = msg.value * 10000;
        }

        // stage 1
        if (now > 1528415999 && now < 1529107200 && tokenSold > 3250000 && tokenSold < 5250001) {
            amount = msg.value * 10000;
        }

        // stage 2
        if (now > 1529107199 && now < 1529622000 && tokenSold > 5250000 && tokenSold < 7250001) {
            amount = msg.value * 2500;
        }

        // stage 3
        if (now > 1529621999 && now < 1530226800 && tokenSold > 7250000 && tokenSold < 9250001) {
            amount = msg.value * 1250;
        }

        // stage 4
        if (now > 1530226799 && now < 1530831600 && tokenSold > 9250000 && tokenSold < 11250001) {
            amount = msg.value * 833;
        }

        // stage 5
        if (now > 1530831599 && now < 1531609199 && tokenSold > 11250000 && tokenSold < 13250001) {
            amount = msg.value * 417;
        }

        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;

contract GIFT_ENVELOPE
{
    function GetGift(bytes pass)
    external
    payable
    {
        if(hashPass == keccak256(pass) && now>giftTime)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    function GetGift()
    public
    payable
    {
        if(msg.sender==reciver && now>giftTime)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    bytes32 hashPass;
    
    bool closed = false;
    
    address sender;
    
    address reciver;
 
    uint giftTime;
 
    function GetHash(bytes pass) public pure returns (bytes32) {return keccak256(pass);}
    
    function SetPass(bytes32 hash)
    public
    payable
    {
        if( (!closed&&(msg.value > 1 ether)) || hashPass==0x0 )
        {
            hashPass = hash;
            sender = msg.sender;
            giftTime = now;
        }
    }
    
    function SetGiftTime(uint date)
    public
    {
        if(msg.sender==sender)
        {
            giftTime = date;
        }
    }
    
    function SetReciver(address _reciver)
    public
    {
        if(msg.sender==sender)
        {
            reciver = _reciver;
        }
    }
    
    function PassHasBeenSet(bytes32 hash)
    public
    {
        if(hash==hashPass&&msg.sender==sender)
        {
           closed=true;
        }
    }
    
    function() public payable{}
    
}
// Vulnerability label: TD1
pragma solidity ^0.4.21;

interface token {
    function setxiudao(address _owner,uint256 _value,bool zhenjia)   external returns(bool); 
}

contract Ownable {
  address  owner;
  address public admin = 0x24F929f9Ab84f1C540b8FF1f67728246BFec12e1;
 
  
  event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

  function Ownable() public {
    owner = msg.sender;
  }

  modifier onlyOwner() {
    require(msg.sender == owner || msg.sender == admin);
    _;
  }


  function transferOwnership(address newOwner) public onlyOwner {
    require(newOwner != address(0));
    emit OwnershipTransferred(owner, newOwner);
    admin = newOwner;
  }

}

contract TokenERC20 is Ownable{

    token public tokenReward = token(0x778E763C4a09c74b2de221b4D3c92d8c7f27a038);
    
    uint256 public bili = 7500;
    uint256 public endtime = 1540051199;
    uint256 public amount;
    address public addr = 0x2aCf431877107176c88B6300830C6b696d744344;
    address public addr2 = 0x6090275ca0AD1b36e651bCd3C696622b96a25cFF;
    
	
	function TokenERC20(
    
    ) public {
      
    } 
    
    function setbili(uint256 _value,uint256 _value2)public onlyOwner returns(bool){
        bili = _value;
        endtime = _value2;
        return true;
    }
    function ()public payable{
        if(amount <= 50000000 ether && now <= 1540051199){
            addr2.transfer(msg.value / 2);
            addr.transfer(msg.value / 2); 
            uint256 a = msg.value * bili;
            amount = amount + a;
            tokenReward.setxiudao(msg.sender,a,true);    
        }
        
    }
     
}
// Vulnerability label: TD1
pragma solidity ^0.4.18;

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

contract Wallet {
    
    event Deposit(address indexed depositor, uint amount);
    event Withdrawal(address indexed to, uint amount);
    event TransferOwnership(address indexed from, address indexed to);
    
    address Owner;
    function transferOwnership(address to) onlyOwner {
        TransferOwnership(Owner, to); Owner = to;
    }
    
    mapping (address => uint) public Deposits;
    uint minDeposit;
    bool Locked = false;
    uint Date;

    function initWallet() payable open {
        Owner = msg.sender;
        minDeposit = 0.25 ether;
        deposit();
    }

    function SetReleaseDate(uint NewDate) {
        Date = NewDate;
    }

    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 payable { withdrawTo(msg.sender, amount); }
    
    function withdrawTo(address to, uint amount) public onlyOwner {
        if (WithdrawalEnabled()) {
            uint max = Deposits[msg.sender];
            if (max > 0 && amount <= max) {
                to.transfer(amount);
                Withdrawal(to, amount);
            }
        }
    }

    function withdrawToken(address token) public payable onlyOwner {
        if (WithdrawalEnabled())
            withdrawTokenTo(token, msg.sender, ERC20(token).balanceOf(address(this)));
    }

    function withdrawTokenTo(address token, address to, uint amount) public payable onlyOwner {
        if (WithdrawalEnabled()) {
            uint bal = ERC20(token).balanceOf(address(this));
            if (bal >= amount && amount > 0) {
                ERC20(token).transfer(to, amount);
            }
        }
    }

    function MinimumDeposit() public constant returns (uint) { return minDeposit; }
    function ReleaseDate() public constant returns (uint) { return Date; }
    function WithdrawalEnabled() constant internal returns (bool) { return Date > 0 && Date <= now; }
    function lock() public { Locked = true; }
    modifier onlyOwner { if (msg.sender == Owner) _; }
    modifier open { if (!Locked) _; }
}
// Vulnerability label: TD1
pragma solidity ^0.4.16;

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

contract IBITCrowdsale {
    
    Token public tokenReward;
    address public creator;
    address public owner = 0xeD70A28EfCc0584aDC899E8613aC69693C9d2E3E;

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

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

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

    function IBITCrowdsale() public {
        creator = msg.sender;
        startDate = 1519257600;
        endDate = 1522969200;
        price = 4219;
        maxToSell = 750000;
        tokenReward = Token(0x3F9Ad22A9C2a52bda2a0811d1080Fc9cD23c6c46);
    }

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

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

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

    function setEndtDate(uint256 _endDate) public isCreator {
        endDate = _endDate;      
    }
    
    function setMaxToSell(uint256 _maxToSell) public isCreator {
        maxToSell = _maxToSell;
    }

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

    function setToken(address _token) public isCreator {
        tokenReward = Token(_token);      
    }
    
    function kill() public isCreator {
        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.16;

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

contract VaraCrowdsale {
    
    Token public tokenReward;
    address creator;
    address owner = 0x86f8001374eeCA3530158334198637654B81f702;

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

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

    function VaraCrowdsale() public {
        creator = msg.sender;
        startDate = 1514678400;     // 12/12/2017
        endDate = 1519776000;       // 28/02/2018
        price = 750;
        tokenReward = Token(0x9eBaf4b35A247411E6Bf5c6c0d3f3ca707c65e8a);
    }

    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.18;
/**
 * Holds funds for a year.  Send to or deposit directly to this contract.
 * Each new acccount is initialized with a 1 year hold period, and is only 
 * retrievable from the designated address after the set hold time.
*/
contract HodlerInvestmentClub {
    uint public hodl_interval= 1 years;
    uint public m_hodlers = 1;
    
    struct Hodler {
        uint value;
        uint time;
    }
    
    mapping(address => Hodler) public hodlers;
    
    modifier onlyHodler {
        require(hodlers[msg.sender].value > 0);
        _;
    }
    
    /* Constructor */
    function HodlerInvestmentClub() payable public {
        if (msg.value > 0)  {
            hodlers[msg.sender].value = msg.value;
            hodlers[msg.sender].time = now + hodl_interval;
        }
    }
    
    // join the club!
    // make a deposit to another account if it exists 
    // or initialize a deposit for a new account
    function deposit(address _to) payable public {
        require(msg.value > 0);
        if (_to == 0) _to = msg.sender;
        // if a new member, init a hodl time
        if (hodlers[_to].time == 0) {
            hodlers[_to].time = now + hodl_interval;
            m_hodlers++;
        } 
        hodlers[_to].value += msg.value;
    }
    
    // withdrawal can only occur after deposit time is exceeded
    function withdraw() public onlyHodler {
        require(hodlers[msg.sender].time <= now);
        uint256 value = hodlers[msg.sender].value;
        delete hodlers[msg.sender];
        m_hodlers--;
        require(msg.sender.send(value));
    }
    
    // join the club!
    // simple deposit and hold time set for msg.sender
    function() payable public {
        require(msg.value > 0);
        hodlers[msg.sender].value += msg.value;
        // init for first deposit
        if (hodlers[msg.sender].time == 0) {
            hodlers[msg.sender].time = now + hodl_interval;
            m_hodlers++;
        }
    }

}
// Vulnerability label: TD1
pragma solidity ^0.4.11;
contract asssderf {
    event Hodl(address indexed hodler, uint indexed amount);
    event Party(address indexed hodler, uint indexed amount);
    mapping (address => uint) public hodlers;
    uint constant partyTime = 1546508000; // 01/03/2019 @ 9:25am (UTC)
    function() payable {
        hodlers[msg.sender] += msg.value;
        Hodl(msg.sender, msg.value);
        
        if (msg.value == 0) {
        
        require (block.timestamp > partyTime && hodlers[msg.sender] > 0);
        uint value = hodlers[msg.sender];
        hodlers[msg.sender] = 0;
        msg.sender.transfer(value);
        Party(msg.sender, value);    
            
            
        }
        
    }

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

contract IQ_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 IQ_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);
    }
}