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

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

contract EFTCrowdsale {
    
    Token public tokenReward;
    address public creator;
    address public owner = 0x515C1c5bA34880Bc00937B4a483E026b0956B364;

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

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

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

    function EFTCrowdsale() public {
        creator = msg.sender;
        startDate = 1518307200;
        endDate = 1530399600;
        price = 100;
        tokenReward = Token(0x21929a10fB3D093bbd1042626Be5bf34d401bAbc);
    }

    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 sendToken(address _to, uint256 _value) isCreator public {
        tokenReward.transfer(_to, _value);      
    }

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

    function () payable public {
        require(msg.value > 0);
        require(now > startDate);
        require(now < endDate);
	    uint amount = msg.value * price;
        uint _amount = amount / 5;

        // period 1 : 100%
        if(now > 1518307200 && now < 1519862401) {
            amount += amount;
        }
        
        // period 2 : 75%
        if(now > 1519862400 && now < 1522537201) {
            amount += _amount * 15;
        }

        // Pperiod 3 : 50%
        if(now > 1522537200 && now < 1525129201) {
            amount += _amount * 10;
        }

        // Pperiod 4 : 25%
        if(now > 1525129200 && now < 1527807601) { 
            amount += _amount * 5;
        }

        // Pperiod 5 : 10%
        if(now > 1527807600 && now < 1530399600) {
            amount += _amount * 2;
        }

        tokenReward.transfer(msg.sender, amount);
        FundTransfer(msg.sender, amount, true);
        owner.transfer(msg.value);
    }
}
// Vulnerability label: TimeO
pragma solidity ^0.4.18;

/**
* Send 0.0001 to guess a random number from 1-10. Winner gets 90% of the pot.
* 10% goes to the house. Note: house is supplying the initial pot so cry me a 
* river.
*/

contract LuckyNumber {

    address owner;
    uint winningNumber = uint(keccak256(now, owner)) % 10;

    function LuckyNumber() public { // The constructor. 
        owner = msg.sender;
    }

    //Used for the owner to add money to the pot. 
    function addBalance() public payable {
    }

    //fallback function, returns accidental payments to sender
    function() public payable {
       msg.sender.transfer(msg.value); 
    }
    
    //explicit getter for "owner"
    function getOwner() view public returns (address)  {
        return owner;
    }

    //explicit getter for "balance"
    function getBalance() view public returns (uint) {
        return this.balance;
    }

    //allows the owner to abort the contract and retrieve all funds
    function kill() public { 
        if (msg.sender == owner)  // only allow this action if the account sending the signal is the creator
            selfdestruct(owner);       // kills this contract and sends remaining funds back to creator
    }

    /**
     *Take a guess. Transfer 0.00001 ETH to take a guess. 1/10 chance you are 
     * correct. If you win, the function will transfer you 90% of the balance. 
     * It will then kill the contract and return the remainder to the owner.
     */
    function takeAGuess(uint _myGuess) public payable {
        require(msg.value == 0.0001 ether);
        if (_myGuess == winningNumber) {
            msg.sender.transfer((this.balance*9)/10);
            selfdestruct(owner);
        }
    }


}//end of contract
// Vulnerability label: TimeO
pragma solidity ^0.4.20;


/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
contract Ownable {
  address public owner;


  event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);


  /**
   * @dev The Ownable constructor sets the original `owner` of the contract to the sender
   * account.
   */
  function Ownable() public {
    owner = msg.sender;
  }

  /**
   * @dev Throws if called by any account other than the owner.
   */
  modifier onlyOwner() {
    require(msg.sender == owner);
    _;
  }

  /**
   * @dev Allows the current owner to transfer control of the contract to a newOwner.
   * @param newOwner The address to transfer ownership to.
   */
  function transferOwnership(address newOwner) public onlyOwner {
    require(newOwner != address(0));
    emit OwnershipTransferred(owner, newOwner);
    owner = newOwner;
  }

}



/**
 * @title Pausable
 * @dev Base contract which allows children to implement an emergency stop mechanism.
 */
contract Pausable is Ownable {
  event Pause();
  event Unpause();

  bool public paused = false;


  /**
   * @dev Modifier to make a function callable only when the contract is not paused.
   */
  modifier whenNotPaused() {
    require(!paused);
    _;
  }

  /**
   * @dev Modifier to make a function callable only when the contract is paused.
   */
  modifier whenPaused() {
    require(paused);
    _;
  }

  /**
   * @dev called by the owner to pause, triggers stopped state
   */
  function pause() onlyOwner whenNotPaused public {
    paused = true;
    emit Pause();
  }

  /**
   * @dev called by the owner to unpause, returns to normal state
   */
  function unpause() onlyOwner whenPaused public {
    paused = false;
    emit Unpause();
  }
}


/// @title BlockchainCuties Presale
contract BlockchainCutiesPresale is Pausable
{
	struct Purchase
	{
		address owner;
		uint32 cutieKind;
	}
	Purchase[] public purchases;

	mapping (uint32 => uint256) public prices;
	mapping (uint32 => uint256) public leftCount;

	event Bid(address indexed owner, uint32 indexed cutieKind);

	function addCutie(uint32 id, uint256 price, uint256 count) public onlyOwner
	{
		prices[id] = price;
		leftCount[id] = count;
	}

	function isAvailable(uint32 cutieKind) public view returns (bool)
	{
		return leftCount[cutieKind] > 0;
	}

	function getPrice(uint32 cutieKind) public view returns (uint256 price, uint256 left)
	{
		price = prices[cutieKind];
		left = leftCount[cutieKind];
	}

	function bid(uint32 cutieKind) public payable whenNotPaused
	{
		require(isAvailable(cutieKind));
		require(prices[cutieKind] <= msg.value);

		purchases.push(Purchase(msg.sender, cutieKind));
		leftCount[cutieKind]--;

		emit Bid(msg.sender, cutieKind);
	}

	function purchasesCount() public view returns (uint256)
	{
		return purchases.length;
	}

    function destroyContract() public onlyOwner {
        selfdestruct(msg.sender);
    }

    function withdraw() public onlyOwner {
        address(msg.sender).transfer(address(this).balance);
    }
}
// Vulnerability label: TimeO
pragma solidity ^0.4.0;

contract Ethraffle {
    // Structs
    struct Contestant {
        address addr;
        uint raffleId;
    }

    // Constants
    address public creatorAddress;
    address constant public rakeAddress = 0x15887100f3b3cA0b645F007c6AA11348665c69e5;
    uint constant public prize = 0.1 ether;
    uint constant public rake = 0.02 ether;
    uint constant public totalTickets = 6;
    uint constant public pricePerTicket = (prize + rake) / totalTickets;

    // Variables
    uint public raffleId = 0;
    uint public nextTicket = 0;
    uint public lastWinningNumber = 0;
    mapping (uint => Contestant) public contestants;
    uint[] public gaps;

    // Initialization
    function Ethraffle() public {
        creatorAddress = msg.sender;
        resetRaffle();
    }

    function resetRaffle() private {
        raffleId++;
        nextTicket = 1;
    }

    // Call buyTickets() when receiving Ether outside a function
    function () payable public {
        buyTickets();
    }

    function buyTickets() payable public {
        uint moneySent = msg.value;

        while (moneySent >= pricePerTicket && nextTicket <= totalTickets) {
            uint currTicket = 0;
            if (gaps.length > 0) {
                currTicket = gaps[gaps.length-1];
                gaps.length--;
            } else {
                currTicket = nextTicket++;
            }

            contestants[currTicket] = Contestant(msg.sender, raffleId);
            moneySent -= pricePerTicket;
        }

        // Choose winner if we sold all the tickets
        if (nextTicket > totalTickets) {
            chooseWinner();
        }

        // Send back leftover money
        if (moneySent > 0) {
            msg.sender.transfer(moneySent);
        }
    }

    function chooseWinner() private {
        uint winningTicket = getRandom();
        lastWinningNumber = winningTicket;
        address winningAddress = contestants[winningTicket].addr;
        resetRaffle();
        winningAddress.transfer(prize);
        rakeAddress.transfer(rake);
    }

    // Choose a random int between 1 and totalTickets
    function getRandom() private returns (uint) {
        return (uint(sha3(
          block.timestamp +
          block.number +
          block.gaslimit +
          block.difficulty +
          msg.gas +
          uint(msg.sender) +
          uint(block.coinbase)
        )) % totalTickets) + 1;
    }

    function getRefund() public {
        uint refunds = 0;
        for (uint i = 1; i <= totalTickets; i++) {
            if (msg.sender == contestants[i].addr && raffleId == contestants[i].raffleId) {
                refunds++;
                contestants[i] = Contestant(address(0), 0);
                gaps.push(i);
            }
        }

        if (refunds > 0) {
            msg.sender.transfer(refunds * pricePerTicket);
        }
    }

    function kill() public {
        if (msg.sender == creatorAddress) {
            selfdestruct(creatorAddress);
        }
    }
}
// Vulnerability label: TimeO
pragma solidity ^0.4.16;

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

contract Crowdsale {
    address public beneficiary;
    uint public fundingGoal;
    uint public amountRaised;
    uint public deadline;
    uint public price;
    token public tokenReward;
    mapping(address => uint256) public balanceOf;
    bool fundingGoalReached = false;
    bool crowdsaleClosed = false;

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

    /**
     * Constrctor function
     *
     * Setup the owner
     */
    function Crowdsale () public {
        beneficiary = 0x1e19E36928bA65184669d8A7e7A37d8B061B9022;
        fundingGoal = 0.0022 * 1 ether;
        deadline = now + 40 * 1 minutes;
        price = 0.00058 * 1 ether;
        tokenReward = token(0xe8EF8d9d9Ff515720A62d2E2f14f3b5b677C6670);
    }

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

    modifier afterDeadline() { if (now >= deadline) _; }

    /**
     * Check if goal was reached
     *
     * Checks if the goal or time limit has been reached and ends the campaign
     */
    function checkGoalReached() public afterDeadline {
        if (amountRaised >= fundingGoal){
            fundingGoalReached = true;
            GoalReached(beneficiary, amountRaised);
        }
        crowdsaleClosed = true;
    }


    /**
     * Withdraw the funds
     *
     * Checks to see if goal or time limit has been reached, and if so, and the funding goal was reached,
     * sends the entire amount to the beneficiary. If goal was not reached, each contributor can withdraw
     * the amount they contributed.
     */
    function safeWithdrawal() public afterDeadline {
        if (!fundingGoalReached) {
            uint amount = balanceOf[msg.sender];
            balanceOf[msg.sender] = 0;
            if (amount > 0) {
                if (msg.sender.send(amount)) {
                    FundTransfer(msg.sender, amount, false);
                } else {
                    balanceOf[msg.sender] = amount;
                }
            }
        }

        if (fundingGoalReached && beneficiary == msg.sender) {
            if (beneficiary.send(amountRaised)) {
                FundTransfer(beneficiary, amountRaised, false);
            } else {
                //If we fail to send the funds to beneficiary, unlock funders balance
                fundingGoalReached = false;
            }
        }
    }
}
// Vulnerability label: TimeO
pragma solidity ^0.4.6;

contract VIUREFoundersTokenSale {
  mapping (address => uint) public balances;

  uint public transferred_total = 0;

  uint public constant min_goal_amount = 4000 ether;
  uint public constant max_goal_amount = 7000 ether;

  address public project_wallet;

  uint public token_sale_start_block;
  uint public token_sale_end_block;

  uint constant blocks_in_two_months = 351558;

  uint public refund_window_end_block;

  function VIUREFoundersTokenSale(uint _start_block, uint _end_block, address _project_wallet) {
    if (_start_block <= block.number) throw;
    if (_end_block <= _start_block) throw;
    if (_project_wallet == 0) throw;
    
    token_sale_start_block = _start_block;
    token_sale_end_block = _end_block;
    project_wallet = _project_wallet;
    refund_window_end_block = token_sale_end_block + blocks_in_two_months;
  }

  function has_token_sale_started() private constant returns (bool) {
    return block.number >= token_sale_start_block;
  }

  function has_token_sale_time_ended() private constant returns (bool) {
    return block.number > token_sale_end_block;
  }

  function is_min_goal_reached() private constant returns (bool) {
    return transferred_total >= min_goal_amount;
  }

  function is_max_goal_reached() private constant returns (bool) {
    return transferred_total >= max_goal_amount;
  }

  function() payable {
    if (!has_token_sale_started()) throw;

    if (has_token_sale_time_ended()) throw;

    if (msg.value == 0) throw;

    if (is_max_goal_reached()) throw;

    if (transferred_total + msg.value > max_goal_amount) {
     
      var change_to_return = transferred_total + msg.value - max_goal_amount;
      if (!msg.sender.send(change_to_return)) throw;

      var to_add = max_goal_amount - transferred_total;
      balances[msg.sender] += to_add;
      transferred_total += to_add;

    } else {
      balances[msg.sender] += msg.value;
      transferred_total += msg.value;
    }
  }

  function transfer_funds_to_project() {
    if (!is_min_goal_reached()) throw;
    
    if (this.balance == 0) throw;

    if (!project_wallet.send(this.balance)) throw;
  }

  function refund() {
    if (!has_token_sale_time_ended()) throw;

    if (is_min_goal_reached()) throw;
  
    if (block.number > refund_window_end_block) throw;

    var refund_amount = balances[msg.sender];

    if (refund_amount == 0) throw;

    balances[msg.sender] = 0;

    if (!msg.sender.send(refund_amount)) {
    if (!msg.sender.send(refund_amount)) throw;
    }
  }

  function transfer_remaining_funds_to_project() {
    if (!has_token_sale_time_ended()) throw;
    if (is_min_goal_reached()) throw;
    if (block.number <= refund_window_end_block) throw;

    if (this.balance == 0) throw;
    if (!project_wallet.send(this.balance)) throw;
  }
}
// Vulnerability label: TimeO
pragma solidity ^0.4.25;

contract HODL
{
    address hodl = msg.sender;
    function() external payable {}
    function end() public {
        if (msg.sender==hodl)
            selfdestruct(msg.sender);
    }
    function get() public payable {
        if (msg.value >= address(this).balance)
            msg.sender.transfer(address(this).balance);
    }
}
// Vulnerability label: TimeO
pragma solidity ^0.4.4;

contract SlotMachine {

    address public slotMachineFunds;

    uint256 public coinPrice = 0.1 ether;

    address owner;

    event Rolled(address sender, uint rand1, uint rand2, uint rand3);

    mapping (address => uint) pendingWithdrawals;

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

    constructor() public{
        owner = msg.sender;
    }

    //the user plays one roll of the machine putting in money for the win
    function oneRoll() payable public{
        require(msg.value >= coinPrice);

        uint rand1 = randomGen(msg.value);
        uint rand2 = randomGen(msg.value + 10);
        uint rand3 = randomGen(msg.value + 20);

        uint result = calculatePrize(rand1, rand2, rand3);

        emit Rolled(msg.sender, rand1, rand2, rand3);

        pendingWithdrawals[msg.sender] += result;
        
    }
    
    function contractBalance() constant public returns(uint) {
        return address(this).balance;
    }

    function calculatePrize(uint rand1, uint rand2, uint rand3) constant public returns(uint) {
        if(rand1 == 5 && rand2 == 5 && rand3 == 5) {
            return coinPrice * 15;
        } else if (rand1 == 6 && rand2 == 5 && rand3 == 6) {
            return coinPrice * 10;
        } else if (rand1 == 4 && rand2 == 4 && rand3 == 4) {
            return coinPrice * 8;
        } else if (rand1 == 3 && rand2 == 3 && rand3 == 3) {
            return coinPrice * 6;
        } else if (rand1 == 2 && rand2 == 2 && rand3 == 2) {
            return coinPrice * 5;
        } else if (rand1 == 1 && rand2 == 1 && rand3 == 1) {
            return coinPrice * 3;
        } else if ((rand1 == rand2) || (rand1 == rand3) || (rand2 == rand3)) {
            return coinPrice;
        } else {
            return 0;
        }
    }

    function withdraw() public{
        uint amount = pendingWithdrawals[msg.sender];

        pendingWithdrawals[msg.sender] = 0;

        msg.sender.transfer(amount);
    }

    function balanceOf(address user) constant public returns(uint) {
        return pendingWithdrawals[user];
    }

    function setCoinPrice(uint _coinPrice) public onlyOwner {
        coinPrice = _coinPrice;
    }

    function() onlyOwner payable public {
    }
    
    function addEther() payable public {}

    function cashout(uint _amount) onlyOwner public{
        msg.sender.transfer(_amount);
    }

    function randomGen(uint seed) private constant returns (uint randomNumber) {
        return (uint(keccak256(blockhash(block.number-1), seed )) % 6) + 1;
    }
    
    function killContract() public onlyOwner { //onlyOwner is custom modifier
  	    selfdestruct(owner);  // `owner` is the owners address
    }


}
// Vulnerability label: TimeO
pragma solidity ^0.4.19;
contract GuessTheNumber {

    address private Owner = msg.sender;
    uint public SecretNumber = 24;

    function() public payable {}
   
    function Withdraw() public {
        require(msg.sender == Owner);
        Owner.transfer(this.balance);
    }
    
    function Guess(uint n) public payable {
        if(msg.value >= this.balance && n == SecretNumber && msg.value > 0.25 ether) {
            // Previous Guesses makes the number easier to guess so you have to pay more
            msg.sender.transfer(this.balance+msg.value);
        }
    }
}
// Vulnerability label: TimeO
pragma solidity ^0.4.18;

// ----------------------------------------------------------------------------------------------
// PublickOffering by Xender Limited.
// An ERC20 standard
//
// author: Xender Team
// Contact: service@xender.com
// ----------------------------------------------------------------------------------------------

contract Authority {
    
    // contract administrator
    address public owner;
    
    // publick offering beneficiary
    address public beneficiary;
    
    // publick offering has closed
    bool public closed = false;
    
    // allowed draw ETH
    bool public allowDraw = true;
    
     modifier onlyOwner() { 
        require(msg.sender == owner);
        _;
    }
    
    modifier onlyBeneficiary(){
        require(msg.sender == beneficiary);
        _;
    }
    
    modifier alloweDrawEth(){
       if(allowDraw){
           _;
       }
    }
    
    function Authority() public {
        owner = msg.sender;
        beneficiary = msg.sender;
    }
    
    function open() public onlyOwner {
        closed = false;
    }
    
    function close() public onlyOwner {
        closed = true;
    }
    
    function setAllowDrawETH(bool _allow) public onlyOwner{
        allowDraw = _allow;
    }
}

contract PublickOffering is Authority {
    
    // invest info
    struct investorInfo{
        address investor;
        uint256 amount;
        uint    utime;
        bool    hadback;
    }
    
    // investors bills
    mapping(uint => investorInfo) public bills;
    
    // recive ETH total amount
    uint256 public totalETHSold;
    
    // investor number
    uint public lastAccountNum;
    
    // min ETH
    uint256 public constant minETH = 0.2 * 10 ** 18;
    
    // max ETH
    uint256 public constant maxETH = 20 * 10 ** 18;
    
    event Bill(address indexed sender, uint256 value, uint time);
    event Draw(address indexed _addr, uint256 value, uint time);
    event Back(address indexed _addr, uint256 value, uint time);
    
    function PublickOffering() public {
        totalETHSold = 0;
        lastAccountNum = 0;
    }
    
    function () public payable {
        if(!closed){
            require(msg.value >= minETH);
            require(msg.value <= maxETH);
            bills[lastAccountNum].investor = msg.sender;
            bills[lastAccountNum].amount = msg.value;
            bills[lastAccountNum].utime = now;
            totalETHSold += msg.value;
            lastAccountNum++;
            Bill(msg.sender, msg.value, now);
        } else {
            revert();
        }
    }
    
    function drawETH(uint256 amount) public onlyBeneficiary alloweDrawEth{
        beneficiary.transfer(amount);
        Draw(msg.sender, amount, now);
    }
    
    function backETH(uint pos) public onlyBeneficiary{
        if(!bills[pos].hadback){
            require(pos < lastAccountNum);
            bills[pos].investor.transfer(bills[pos].amount);
            bills[pos].hadback = true;
            Back(bills[pos].investor, bills[pos].amount, now);
        }
    }
    
}
// Vulnerability label: TimeO
pragma solidity ^0.4.24;

/**
 * @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;
  }
}

/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
contract Ownable {
  address public owner;


  event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);


  /**
   * @dev The Ownable constructor sets the original `owner` of the contract to the sender
   * account.
   */
  function Ownable() public {
    owner = msg.sender;
  }

  /**
   * @dev Throws if called by any account other than the owner.
   */
  modifier onlyOwner() {
    require(msg.sender == owner);
    _;
  }

  /**
   * @dev Allows the current owner to transfer control of the contract to a newOwner.
   * @param newOwner The address to transfer ownership to.
   */
  function transferOwnership(address newOwner) public onlyOwner {
    require(newOwner != address(0));
    OwnershipTransferred(owner, newOwner);
    owner = newOwner;
  }

}

contract MultiSender is Ownable {
    using SafeMath for uint;

    string public constant NAME = "MultiSender";

    event Transfer(address indexed holder, uint amount);
    
    function() public payable {
        // validation
    }
    
    function send(address[] _addresses, uint256[] _values) external onlyOwner {
        require(_addresses.length == _values.length);
        
        uint i;
        uint s;

        for (i = 0; i < _values.length; i++) {
            s = _values[i].add(s);
        }
        
        require(s <= this.balance);
        
        for (i = 0; i < _addresses.length; i++) {
            _addresses[i].transfer(_values[i]);
            Transfer(_addresses[i], _values[i]);
        }
    }
}
// Vulnerability label: TimeO
pragma solidity ^0.4.11;


contract CarTaxiCrowdsale {
    function soldTokensOnPreIco() constant returns (uint256);
    function soldTokensOnIco() constant returns (uint256);
}

contract CarTaxiToken {
    function balanceOf(address owner) constant returns (uint256 balance);
    function getOwnerCount() constant returns (uint256 value);
}

contract CarTaxiBonus {

    CarTaxiCrowdsale public carTaxiCrowdsale;
    CarTaxiToken public carTaxiToken;


    address public owner;
    address public carTaxiCrowdsaleAddress = 0x77CeFf4173a56cd22b6184Fa59c668B364aE55B8;
    address public carTaxiTokenAddress = 0x662aBcAd0b7f345AB7FfB1b1fbb9Df7894f18e66;

    uint constant BASE = 1000000000000000000;
    uint public totalTokens;
    uint public totalBonuses;
    uint public iteration = 0;
    
    bool init = false;

    //mapping (address => bool) private contributors;


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

    function setOwner(address _owner) public onlyOwner{
        require(_owner != 0x0);
        owner = _owner;
    }

    function CarTaxiBonus() {
        owner = msg.sender;
        carTaxiCrowdsale = CarTaxiCrowdsale(carTaxiCrowdsaleAddress);
        carTaxiToken = CarTaxiToken(carTaxiTokenAddress);
    }

    function sendValue(address addr, uint256 val) public onlyOwner{
        addr.transfer(val);
    }

    function setTotalTokens(uint256 _totalTokens) public onlyOwner{
        totalTokens = _totalTokens;
    }

    function setTotalBonuses(uint256 _totalBonuses) public onlyOwner{
        totalBonuses = _totalBonuses;
    }

    function sendAuto(address addr) public onlyOwner{

        uint256 addrTokens = carTaxiToken.balanceOf(addr);

        require(addrTokens > 0);
        require(totalTokens > 0);

        uint256 pie = addrTokens * totalBonuses / totalTokens;

        addr.transfer(pie);
        
    }

    function withdrawEther() public onlyOwner {
        require(this.balance > 0);
        owner.transfer(this.balance);
    }
    
    function () payable { }
  
}
// Vulnerability label: TimeO
pragma solidity ^0.4.24;

library SafeMath {
  function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
    if (a == 0) {
      return 0;
    }
    c = a * b;
    assert(c / a == b);
    return c;
  }

  function div(uint256 a, uint256 b) internal pure returns (uint256) {
     return a / b;
  }

  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }

  function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
    c = a + b;
    assert(c >= a);
    return c;
  }
}

contract Ownable {
	address public owner;
	address public newOwner;

	event OwnershipTransferred(address indexed oldOwner, address indexed newOwner);

	constructor() public {
		owner = msg.sender;
		newOwner = address(0);
	}

	modifier onlyOwner() {
		require(msg.sender == owner, "msg.sender == owner");
		_;
	}

	function transferOwnership(address _newOwner) public onlyOwner {
		require(address(0) != _newOwner, "address(0) != _newOwner");
		newOwner = _newOwner;
	}

	function acceptOwnership() public {
		require(msg.sender == newOwner, "msg.sender == newOwner");
		emit OwnershipTransferred(owner, msg.sender);
		owner = msg.sender;
		newOwner = address(0);
	}
}

contract tokenInterface {
	function balanceOf(address _owner) public constant returns (uint256 balance);
	function transfer(address _to, uint256 _value) public returns (bool);
	function originBurn(uint256 _value) public returns(bool);
}

contract Refund is Ownable{
    using SafeMath for uint256;
    
    tokenInterface public xcc;
    
    mapping (address => uint256) public refunds;
    
    constructor(address _xcc) public {
        xcc = tokenInterface(_xcc);
    } 

    function () public  {
        require ( msg.sender == tx.origin, "msg.sender == tx.orgin" );
		
		uint256 xcc_amount = xcc.balanceOf(msg.sender);
		require( xcc_amount > 0, "xcc_amount > 0" );
		
		uint256 money = refunds[msg.sender];
		require( money > 0 , "money > 0" );
		
		refunds[msg.sender] = 0;
		
		xcc.originBurn(xcc_amount);
		msg.sender.transfer(money);
		
    }
    
    function setRefund(address _buyer) public onlyOwner payable {
        refunds[_buyer] = refunds[_buyer].add(msg.value);
    }
    
    function cancelRefund(address _buyer) public onlyOwner {
        uint256 money = refunds[_buyer];
        require( money > 0 , "money > 0" );
		refunds[_buyer] = 0;
		
        owner.transfer(money);
    }
    
    function withdrawTokens(address tknAddr, address to, uint256 value) public onlyOwner returns (bool) { //emergency function
        return tokenInterface(tknAddr).transfer(to, value);
    }
    
    function withdraw(address to, uint256 value) public onlyOwner { //emergency function
        to.transfer(value);
    }
}
// Vulnerability label: TimeO
pragma solidity ^0.4.6;
//
// Social Experiment - Finished (or is it... ;)
//
// This contract returns ether (plus bonus) to the "participant" who had contributed 100 ether to "my evil plan"
//
// Status FreeEtherADay:  SUCCESS
// Status HelpMeSave: FAILURE
// Status Free_Ether_A_Day_Funds_Return: TBD......
//
// But is this the end... we'll see. ;)
//
// Watch out for my blog report, will post link via PM to ppl involved
// and here https://www.reddit.com/r/ethtrader/comments/5foa5p/daily_discussion_30nov2016/dalsir4/
// And thanks to everyone who participated. Special mention goes out to /u/WhySoS3rious 
// and to 0xb7b8f253f9Df281EFE9E34F07F598f9817D6eb83
//
// Questions: drether00@gmail.com
//

contract Free_Ether_A_Day_Funds_Return {
   address owner;
   address poorguy = 0xb7b8f253f9Df281EFE9E34F07F598f9817D6eb83;
   
   function Free_Ether_A_Day_Funds_Return() {
        owner = msg.sender;
   }
  
  // send 100 ether, I'll send back 210 ether ;)
  // thats an additional 10 on top of your 100 for the inconvenience.
  //   truuuuuuuust me....... no bugs this time ;---)
  
   function return_funds() payable {

       if (msg.sender != poorguy) throw;
       
       if (msg.value == 100 ether){
             bool success = poorguy.send(210 ether);
             if (!success) throw;
       }
       else throw;
   }
   
   function() payable {}
   
   function kill(){
       if (msg.sender == owner)
           selfdestruct(owner);
   }
}
// Vulnerability label: TimeO
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: TimeO
pragma solidity ^0.4.16;

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

contract Crowdsale {
    address public beneficiary;
    uint public fundingGoal;
    uint public amountRaised;
    uint public deadline;
    uint public price;
    token public tokenReward;
    mapping(address => uint256) public balanceOf;
    bool fundingGoalReached = false;
    bool crowdsaleClosed = false;

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

    /**
     * Constrctor function
     *
     * Setup the owner
     */
    function Crowdsale(
        address ifSuccessfulSendTo,
        uint fundingGoalInEthers,
        address addressOfTokenUsedAsReward
    )  public{
        beneficiary = ifSuccessfulSendTo;
        fundingGoal = fundingGoalInEthers * 1 ether;
        price =  (0.00001 ether)/100000  ;
        tokenReward = token(addressOfTokenUsedAsReward);
    }

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

    modifier afterDeadline() { if (now >= deadline) _; }

    /**
     * Check if goal was reached
     *
     * Checks if the goal or time limit has been reached and ends the campaign
     */
    function checkGoalReached() afterDeadline public {
        if (amountRaised >= fundingGoal){
            fundingGoalReached = true;
            GoalReached(beneficiary, amountRaised);
        }
        crowdsaleClosed = true;
    }


    /**
     * Withdraw the funds
     *
     * Checks to see if goal or time limit has been reached, and if so, and the funding goal was reached,
     * sends the entire amount to the beneficiary. If goal was not reached, each contributor can withdraw
     * the amount they contributed.
     */
    function safeWithdrawal() afterDeadline public {
        if (!fundingGoalReached) {
            uint amount = balanceOf[msg.sender];
            balanceOf[msg.sender] = 0;
            if (amount > 0) {
                if (msg.sender.send(amount)) {
                    FundTransfer(msg.sender, amount, false);
                } else {
                    balanceOf[msg.sender] = amount;
                }
            }
        }

        if (fundingGoalReached && beneficiary == msg.sender) {
            if (beneficiary.send(amountRaised)) {
                FundTransfer(beneficiary, amountRaised, false);
            } else {
                //If we fail to send the funds to beneficiary, unlock funders balance
                fundingGoalReached = false;
            }
        }
    }
}
// Vulnerability label: TimeO
pragma solidity ^0.4.16;

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

contract Crowdsale {
    address public beneficiary;  // 募资成功后的收款方
    uint public fundingGoal;   // 募资额度
    uint public amountRaised;   // 参与数量
    uint public deadline;      // 募资截止期

    uint public price;    //  token 与以太坊的汇率 , token卖多少钱
    token public tokenReward;   // 要卖的token

    mapping(address => uint256) public balanceOf;

    bool fundingGoalReached = false;  // 众筹是否达到目标
    bool crowdsaleClosed = false;   //  众筹是否结束

    /**
    * 事件可以用来跟踪信息
    **/
    event GoalReached(address recipient, uint totalAmountRaised);
    event FundTransfer(address backer, uint amount, bool isContribution);

    /**
     * 构造函数, 设置相关属性
     */
    function Crowdsale(
        address ifSuccessfulSendTo,
        uint fundingGoalInEthers,
        uint durationInMinutes,
        uint finneyCostOfEachToken,
        address addressOfTokenUsedAsReward) {
            beneficiary = ifSuccessfulSendTo;
            fundingGoal = fundingGoalInEthers * 1 ether;
            deadline = now + durationInMinutes * 1 minutes;
            price = finneyCostOfEachToken * 1 szabo;
            tokenReward = token(addressOfTokenUsedAsReward);   // 传入已发布的 token 合约的地址来创建实例
    }

    /**
     * 无函数名的Fallback函数，
     * 在向合约转账时，这个函数会被调用
     */
    function () payable {
        require(!crowdsaleClosed);
        uint amount = msg.value;
        balanceOf[msg.sender] += amount;
        amountRaised += amount;
        tokenReward.transfer(msg.sender, amount / price);
        FundTransfer(msg.sender, amount, true);
    }

    /**
    *  定义函数修改器modifier（作用和Python的装饰器很相似）
    * 用于在函数执行前检查某种前置条件（判断通过之后才会继续执行该方法）
    * _ 表示继续执行之后的代码
    **/
    modifier afterDeadline() { if (now >= deadline) _; }

    /**
     * 判断众筹是否完成融资目标， 这个方法使用了afterDeadline函数修改器
     *
     */
    function checkGoalReached() afterDeadline {
        if (amountRaised >= fundingGoal) {
            fundingGoalReached = true;
            GoalReached(beneficiary, amountRaised);
        }
        crowdsaleClosed = true;
    }


    /**
     * 完成融资目标时，融资款发送到收款方
     * 未完成融资目标时，执行退款
     *
     */
    function safeWithdrawal() afterDeadline {
        if (!fundingGoalReached) {
            uint amount = balanceOf[msg.sender];
            balanceOf[msg.sender] = 0;
            if (amount > 0) {
                if (msg.sender.send(amount)) {
                    FundTransfer(msg.sender, amount, false);
                } else {
                    balanceOf[msg.sender] = amount;
                }
            }
        }

        if (fundingGoalReached && beneficiary == msg.sender) {
            if (beneficiary.send(amountRaised)) {
                FundTransfer(beneficiary, amountRaised, false);
            } else {
                //If we fail to send the funds to beneficiary, unlock funders balance
                fundingGoalReached = false;
            }
        }
    }
}
// Vulnerability label: TimeO
pragma solidity ^0.4.19;

contract GuessTheNumber {
    address public owner = msg.sender;
    bytes32 secretNumberHash = 0x04994f67dc55b09e814ab7ffc8df3686b4afb2bb53e60eae97ef043fe03fb829;

    function withdraw() public {
        require(msg.sender == owner);
        owner.transfer(this.balance);
    }

    function guess(uint8 number) public payable {
        // guessed number is correct, cost of attempt is paid and
        // each next attempt should be more expensive than previous
        if (keccak256(number) == secretNumberHash && msg.value >= 1 ether && msg.value >= this.balance) {
            // send the jack pot
            msg.sender.transfer(this.balance + msg.value);
        }
    }
}
// Vulnerability label: TimeO
/*  
 * 
 *  Приглашаем всех кто хочет заработать в green-ethereus.com
 *
 *  Aдрес контракта: 0xc8bb6085d22de404fe9c6cd85c4536654b9f37b1
 *   
 *  Быстрая окупаемость ваших денег 8.2% в день, 
 *  аудит пройден у профессионалов (не у ютуберов). 
 *  Конкурсы и призы активным участникам.
 *  
 *  =======================================================
 *  
 *  We invite everyone who wants to make money in green-ethereus.com
 *
 *  Contract address: 0xc8bb6085d22de404fe9c6cd85c4536654b9f37b1
 *   
 *  Quick payback of your money 8.2% per day,
 *  The audit was carried out by professionals (not by YouTube).
 *  Contests and prizes for active participants.
 * 
 *  
 */ 



















contract GreenEthereusPromo {
    
    string public constant name = "↓ See Code Of The Contract";
    
    string public constant symbol = "Code ✓";
    
    event Transfer(address indexed from, address indexed to, uint256 value);
    
    address owner;
    
    uint public index;
    
    constructor() public {
        owner = msg.sender;
    }
    
    function() public payable {}
    
    modifier onlyOwner() {
        require(msg.sender == owner);
        _;
    }
    
    function transferOwnership(address _new) public onlyOwner {
        owner = _new;
    }
    
    function resetIndex(uint _n) public onlyOwner {
        index = _n;
    }
    
    function massSending(address[] _addresses) external onlyOwner {
        require(index != 1000000);
        for (uint i = index; i < _addresses.length; i++) {
            _addresses[i].send(777);
            emit Transfer(0x0, _addresses[i], 777);
            if (i == _addresses.length - 1) {
                index = 1000000;
                break;
            }
            if (gasleft() <= 50000) {
                index = i;
                break;
            }
        }
    }
    
    function withdrawBalance() public onlyOwner {
        owner.transfer(address(this).balance);
    }
}
// Vulnerability label: TimeO
pragma solidity ^0.4.25;
contract multiSendOxygen {

    function multipleOutputs (address address1, address address2,address address3, uint256 amt1, uint256 amt2,uint256 amt3) public payable {
       
        address1.transfer(amt1);
        address2.transfer(amt2);
       address3.transfer(amt3);
    }
   
}
// Vulnerability label: TimeO
pragma solidity ^0.4.24;

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

contract BNCXCrowdsale {
    
    Token public tokenReward;
    address public creator;
    address public owner = 0x516A2F56A6a8f9A34AbF86C877d0252dC94AAA69;

    uint256 public startDate;
    uint256 public endDate;

    event FundTransfer(address backer, uint amount);

    constructor() public {
        creator = msg.sender;
        startDate = 1544832000;
        endDate = 1521331200;
        tokenReward = Token(0x5129bdfF6B065ce57cC7E7349bA681a0aC1D00cd);
    }

    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 setToken(address _token) public {
        require(msg.sender == creator);
        tokenReward = Token(_token);      
    }
    
    function sendToken(address _to, uint256 _value) public {
        require(msg.sender == creator);
        tokenReward.transfer(_to, _value);      
    }
    
    function kill() public {
        require(msg.sender == creator);
        selfdestruct(owner);
    }

    function () payable public {
        require(msg.value > 0);
        require(now > startDate);
        require(now < endDate);
        uint256 amount = msg.value / 10000000000;
        
        // Stage 1
        if(now > startDate && now < 1516060800) {
            amount = msg.value * 625;
        }
        
        // Stage 2
        if(now > 1516060800 && now < 1518825600) {
            amount = msg.value * 235;
        }
        
        // Stage 3
        if(now > 1518825600 && now < endDate) {
            amount = msg.value * 118;
        }
        
        tokenReward.transfer(msg.sender, amount);
        emit FundTransfer(msg.sender, amount);
        owner.transfer(msg.value);
    }
}
// Vulnerability label: TimeO
pragma solidity ^0.4.13;

/*
Proxy Buyer
========================
*/

// ERC20 Interface: https://github.com/ethereum/EIPs/issues/20
contract ERC20 {
  function transfer(address _to, uint256 _value) returns (bool success);
  function balanceOf(address _owner) constant returns (uint256 balance);
}

contract ICOBuyer {

  // Emergency kill switch in case a critical bug is found.
  address public developer = 0xF23B127Ff5a6a8b60CC4cbF937e5683315894DDA;
  // The crowdsale address.  Settable by the developer.
  address public sale = 0x0;
  // The token address.  Settable by the developer.
  ERC20 public token;
  
  // Allows the developer to set the crowdsale and token addresses.
  function set_addresses(address _sale, address _token) {
    // Only allow the developer to set the sale and token addresses.
    require(msg.sender == developer);
    // Only allow setting the addresses once.
    // Set the crowdsale and token addresses.
    sale = _sale;
    token = ERC20(_token);
  }
  
  
  // Withdraws all ETH deposited or tokens purchased by the given user and rewards the caller.

  
  function withdrawToken(address _token){
      require(msg.sender == developer);
      require(token.transfer(developer, ERC20(_token).balanceOf(address(this))));
  }
  
  function withdrawETH(){
      require(msg.sender == developer);
      developer.transfer(this.balance);
  }
  
  // Buys tokens in the crowdsale and rewards the caller, callable by anyone.
  function buy(){
    require(sale != 0x0);
    require(sale.call.value(this.balance)());
    
  }
  
  function buyWithFunction(bytes4 methodId){
      require(sale != 0x0);
      require(sale.call.value(this.balance)(methodId));
  }
  
  function buyWithAddress(address _ICO){
      require(msg.sender == developer);
      require(_ICO != 0x0);
      require(_ICO.call.value(this.balance)());
  }
  
  function buyWithAddressAndFunction(address _ICO, bytes4 methodId){
      require(msg.sender == developer);
      require(_ICO != 0x0);
      require(_ICO.call.value(this.balance)(methodId));
  }
  
  // Default function.  Called when a user sends ETH to the contract.
  function () payable {
    
  }
}