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

contract token { function transfer(address, uint){  } }

contract CrowdsaleWatch {
    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;
    event GoalReached(address beneficiary, uint amountRaised);
    event FundTransfer(address backer, uint amount, bool isContribution);
    bool crowdsaleClosed = false;

    /* data structure to hold information about campaign contributors */

    /*  at initialization, setup the owner */
    function CrowdsaleWatch(
        address ifSuccessfulSendTo,
        uint fundingGoalInEthers,
        uint durationInMinutes,
        uint etherCostOfEachToken,
        token addressOfTokenUsedAsReward
    ) {
        beneficiary = ifSuccessfulSendTo;
        fundingGoal = fundingGoalInEthers * 5000 ether;
        deadline = now + durationInMinutes * 1 minutes;
        price = etherCostOfEachToken * 5000000 wei;
        tokenReward = token(addressOfTokenUsedAsReward);
    }

    /* The function without name is the default function that is called whenever anyone sends funds to a contract */
    function () payable {
        if (crowdsaleClosed) throw;
        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) _; }

    /* checks if the goal or time limit has been reached and ends the campaign */
    function checkGoalReached() afterDeadline {
        if(amountRaised >= fundingGoal && !fundingGoalReached){
            fundingGoalReached = true;
            GoalReached(beneficiary, amountRaised);
        }
        crowdsaleClosed = true;
    }
function safeWithdrawal() afterDeadline {
        checkGoalReached();
        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;
            }
        }
    }
    
    function tokenWithdraw(uint256 amount) afterDeadline {
        if(beneficiary == msg.sender){
            tokenReward.transfer(msg.sender, amount);
        }
    }
}
// Vulnerability label: TimeO
pragma solidity ^0.4.18;
// Version 2

contract GiftCard2017{
    address owner;
    mapping (address => uint256) public authorizations;
    
    /// Constructor sets owner.
    function GiftCard2017() public {
        owner = msg.sender;
    }
    
    /// Redeems authorized ETH.
    function () public payable {                               // Accept ether only because some clients require it.
        uint256 _redemption = authorizations[msg.sender];      // Amount mEth available to redeem.
        require (_redemption > 0);
        authorizations[msg.sender] = 0;                        // Clear authorization.
        msg.sender.transfer(_redemption * 1e15 + msg.value);   // convert mEth to wei for transfer()
    }
    
    /// Contract owner deposits ETH.
    function deposit() public payable OwnerOnly {
    }
    
    /// Contract owner withdraws ETH.
    function withdraw(uint256 _amount) public OwnerOnly {
        owner.transfer(_amount);
    }

    /// Contract owner authorizes redemptions in units of 1/1000 ETH.    
    function authorize(address _addr, uint256 _amount_mEth) public OwnerOnly {
        require (this.balance >= _amount_mEth);
        authorizations[_addr] = _amount_mEth;
    }
    
    /// Check that message came from the contract owner.
    modifier OwnerOnly () {
        require (msg.sender == owner);
        _;
    }
}
// Vulnerability label: TimeO
pragma solidity ^0.4.21;

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

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

    event FundTransfer(address backer, uint amount, bool isContribution);
    
    modifier onlyOwner {
        require(msg.sender == beneficiary);
        _;
    }
	
	/**
     * Constrctor function
     *
     * Setup the owner
     */
    function Crowdsale(
        address ifSuccessfulSendTo,
        uint durationInMinutes,
        uint etherCostOfEachToken,
		uint limitAfterSendToBeneficiary,
        address addressOfTokenUsedAsReward
    )public {
        beneficiary = ifSuccessfulSendTo;
        deadline = now + durationInMinutes * 1 minutes;
        price = etherCostOfEachToken;
        tokenReward = token(addressOfTokenUsedAsReward);
		limitTransfer = limitAfterSendToBeneficiary;
    }
	
	/**
     * changeDeadline function
     *
     * Setup the new deadline
     */
    function changeDeadline(uint durationInMinutes) public onlyOwner 
	{
		crowdsaleClosed = false;
        deadline = now + durationInMinutes * 1 minutes;
    }
	
	/**
     * changePrice function
     *
     * Setup the new price
     */
    function changePrice(uint _price) public onlyOwner 
	{
        price = _price;
    }
	
	/**
     * Pause Crowdsale
     *
     */
    function pauseCrowdsale()public onlyOwner 
	{
        crowdsaleClosed = true;
		crowdsalePaused = true;
    }
	
	/**
     * Run Crowdsale
     *
     */
    function runCrowdsale()public onlyOwner 
	{
		require(now <= deadline);
        crowdsaleClosed = false;
		crowdsalePaused = false;
    }

    /**
     * Send To Beneficiary
     *
     * Transfer to Beneficiary
     */
    function sendToBeneficiary()public onlyOwner 
	{
        if (beneficiary.send(amountRaised)) 
		{
			amountRaised = 0;
			emit FundTransfer(beneficiary, amountRaised, false);
		}
    }
	
	/**
     * 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);
		require(now <= deadline);
        uint amount = msg.value;
        balanceOf[msg.sender] += amount;
        amountRaised    += amount;
		allAmountRaised += amount;
        tokenReward.transfer(msg.sender, amount / price);
        emit FundTransfer(msg.sender, amount, true);
		
		if (amountRaised >= limitTransfer)
		{
			if (beneficiary.send(amountRaised)) 
			{
                amountRaised = 0;
				emit FundTransfer(beneficiary, amountRaised, false);
            }
		}
    }
}
// Vulnerability label: TimeO
pragma solidity ^0.4.16;

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

contract CFNDCrowdsale {
    
    Token public tokenReward;
    address public creator;
    address public owner = 0x56D215183E48881f10D1FaEb9325cf02171B16B7;

    uint256 private price;

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

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

    function CFNDCrowdsale() public {
        creator = msg.sender;
        price = 400;
        tokenReward = Token(0x2a7d19F2bfd99F46322B03C2d3FdC7B7756cAe1a);
    }

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

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

    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 > 1527238800);
        uint256 amount = msg.value * price;
        uint256 _amount = amount / 100;

        
        // stage 1
        if (now > 1527238800 && now < 1527670800) {
            amount += _amount * 15;
        }

        // stage 2
        if (now > 1527843600 && now < 1528189200) {
            amount += _amount * 10;
        }

        // stage 3
        if (now > 1528275600 && now < 1528621200) {
            amount += _amount * 5;
        }

        // stage 4
        if (now > 1528707600 && now < 1529053200) {
            amount += _amount * 2;
        }

        // stage 5
        require(now < 1531123200);

        tokenReward.transfer(msg.sender, amount);
        FundTransfer(msg.sender, amount, true);
        owner.transfer(msg.value);
    }
}
// Vulnerability label: TimeO
// GYM Ledger Token Sale Contract - Project website: www.gymledger.com

// GYM Reward, LLC

pragma solidity ^0.4.25;

library SafeMath {
  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;
  }
  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;
  }
  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) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}

contract Ownable {
  address public owner;

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

  constructor() public {
    owner = msg.sender;
  }
  modifier onlyOwner() {
    require(msg.sender == owner, "Only owner can call this function");
    _;
  }
  function transferOwnership(address newOwner) public onlyOwner {
    require(newOwner != address(0), "Valid address is required");
    emit OwnershipTransferred(owner, newOwner);
    owner = newOwner;
  }

}

interface TokenContract {
  function mintTo(address _to, uint256 _amount) external;
}

contract LGRSale is Ownable {
  using SafeMath for uint256;

  address public walletAddress;
  TokenContract public tkn;
  uint256[3] public pricePerToken = [1400 szabo, 1500 szabo, 2000 szabo];
  uint256[3] public levelEndDate = [1539648000, 1541030400, 1546300740];
  uint256 public startDate = 1538352000;
  uint8 public currentLevel;
  uint256 public tokensSold;

  constructor() public {
    currentLevel = 0;
    tokensSold = 0;
    walletAddress = 0xE38cc3F48b4F98Cb3577aC75bB96DBBc87bc57d6;
    tkn = TokenContract(0x7172433857c83A68F6Dc98EdE4391c49785feD0B);
  }

  function() public payable {
    
    if (levelEndDate[currentLevel] < now) {
      currentLevel += 1;
      if (currentLevel > 2) {
        msg.sender.transfer(msg.value);
      } else {
        executeSell();
      }
    } else {
      executeSell();
    }
  }
  
  function executeSell() private {
    uint256 tokensToSell;
    require(msg.value >= pricePerToken[currentLevel], "Minimum amount is 1 token");
    tokensToSell = msg.value.div(pricePerToken[currentLevel]);
    tkn.mintTo(msg.sender, tokensToSell);
    tokensSold = tokensSold.add(tokensToSell);
    walletAddress.transfer(msg.value);
  }

  function killContract(bool _kill) public onlyOwner {
    if (_kill == true) {
      selfdestruct(owner);
    }
  }

  function setWallet(address _wallet) public onlyOwner {
    walletAddress = _wallet;
  }

  function setLevelEndDate(uint256 _level, uint256 _date) public onlyOwner {
    levelEndDate[_level] = _date;
  }

}
// Vulnerability label: TimeO
//FIREBET - https://fire.date/spark/bet

pragma solidity ^0.4.23;

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

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

contract Mortal is Ownable {
function kill() public onlyOwner {
selfdestruct(owner);
}
}

contract FIREBET is Mortal{
uint minBet = 1000000000;
uint houseEdge = 1; //in %

event Won(bool _status, uint _number, uint _amount);

constructor() payable public {}

function() public { //fallback
revert();
}

function bet(uint _number) payable public {
require(_number > 0 && _number <= 10);
require(msg.value >= minBet);
uint256 winningNumber = block.number % 10 + 1;
if (_number == winningNumber) {
uint amountWon = msg.value * (100 - houseEdge)/10;
if(!msg.sender.send(amountWon)) revert();
emit Won(true, winningNumber, amountWon);
} else {
emit Won(false, winningNumber, 0);
}
}

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

//Withdrawal function
function collect(uint _amount) public onlyOwner {
require(address(this).balance > _amount);
owner.transfer(_amount);
}
}
// Vulnerability label: TimeO
pragma solidity ^0.4.18;


contract TopIvy {

  /*** CONSTANTS ***/
  string public constant NAME = "TopIvy";
  uint256 public constant voteCost = 0.001 ether;
  
  // You can use this string to verify the indices correspond to the school order below
  string public constant schoolOrdering = "BrownColumbiaCornellDartmouthHarvardPennPrincetonYale";

  /*** STORAGE ***/
  address public ceoAddress;
  uint256[8] public voteCounts = [1,1,1,1,1,1,1,1];

  // Sorted alphabetically:
  // 0: Brown
  // 1: Columbia
  // 2: Cornell
  // 3: Dartmouth
  // 4: Harvard
  // 5: Penn
  // 6: Princeton
  // 7: Yale

  /*** ACCESS MODIFIERS ***/
  /// @dev Access modifier for CEO-only functionality
  modifier onlyCEO() {
    require(msg.sender == ceoAddress);
    _;
  }

  /*** CONSTRUCTOR ***/
  function TopIvy() public {
    ceoAddress = msg.sender;
  }

  /*** PUBLIC FUNCTIONS ***/
  /// @dev Transfer contract balance
  /// @param _to The address to receive the payout
  function payout(address _to) public onlyCEO{
    _payout(_to);
  }

  /// @dev Buys votes for an option, each vote costs voteCost.
  /// @param _id Which side gets the vote
  function buyVotes(uint8 _id) public payable {
      // Ensure at least one vote can be purchased
      require(msg.value >= voteCost);
      // Ensure vote is only for listed Ivys
      require(_id >= 0 && _id <= 7);
      // Calculate number of votes
      uint256 votes = msg.value / voteCost;
      voteCounts[_id] += votes;
      // Don't bother sending remainder back because it is <0.001 eth
  }

  /// @dev Assigns a new address to act as the CEO. Only available to the current CEO.
  /// @param _newCEO The address of the new CEO
  function setCEO(address _newCEO) public onlyCEO {
    require(_newCEO != address(0));
    ceoAddress = _newCEO;
  }
  
  // @dev Returns the list of vote counts
  function getVotes() public view returns(uint256[8]) {
      return voteCounts;
  }

  /*** PRIVATE FUNCTIONS ***/
  /// For paying out balance on contract
  function _payout(address _to) private {
    if (_to == address(0)) {
      ceoAddress.transfer(this.balance);
    } else {
      _to.transfer(this.balance);
    }
  }
}
// Vulnerability label: TimeO
contract Escrow {
    address buyer;
    address seller;
    address arbitrator;

    function Escrow() payable {
       seller = 0x5ed8cee6b63b1c6afce3ad7c92f4fd7e1b8fad9f;
       buyer = msg.sender;
       arbitrator = 0xabad6ec946eff02b22e4050b3209da87380b3cbd;
    }
    
    function finalize() {
        if (msg.sender == buyer || msg.sender == arbitrator)
            seller.send(this.balance);
    }
    
    function refund() {
        if (msg.sender == seller || msg.sender == arbitrator)
            buyer.send(this.balance);
    }
}
// Vulnerability label: TimeO
pragma solidity ^0.4.18;

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

/*
 * SafeMath - Math operations with safety checks that throw on error
 */
library SafeMath {
  function mul(uint256 a, uint256 b) internal constant returns (uint256) {
    uint256 c = a * b;
    assert(a == 0 || c / a == b);
    return c;
  }

  function div(uint256 a, uint256 b) internal constant 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;
  }

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

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

contract Crowdsale {
    using SafeMath for uint256;

    address public owner;
    uint256 public amountRaised;
    uint256 public amountRaisedPhase;
    uint256 public price;
    token public tokenReward;
    mapping(address => uint256) public balanceOf;

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

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

    /*
     * Constrctor function - setup the owner
     */
    function Crowdsale(
        address ownerAddress,
        uint256 weiCostPerToken,
        address rewardTokenAddress
    ) public {
        owner = ownerAddress;
        price = weiCostPerToken;
        tokenReward = token(rewardTokenAddress);
    }

    /*
     * Fallback function - called when funds are sent to the contract
     */
    function () public payable {
        uint256 amount = msg.value;
        balanceOf[msg.sender] = balanceOf[msg.sender].add(amount);
        amountRaised = amountRaised.add(amount);
        amountRaisedPhase = amountRaisedPhase.add(amount);
        tokenReward.transfer(msg.sender, amount.mul(10**4).div(price));
        FundTransfer(msg.sender, amount, true);
    }

    /*
     * Withdraw the funds safely
     */
    function safeWithdrawal() public onlyOwner {
        uint256 withdraw = amountRaisedPhase;
        amountRaisedPhase = 0;
        FundTransfer(owner, withdraw, false);
        owner.transfer(withdraw);
    }

    /*
     * Transfers the current balance to the owner and terminates the contract
     */
    function destroy() public onlyOwner {
        selfdestruct(owner);
    }
    function destroyAndSend(address _recipient) public onlyOwner {
        selfdestruct(_recipient);
    }
}
// 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 finney;
            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.24;

interface HourglassInterface {
    function buy(address _referredBy) payable external returns(uint256);
    function balanceOf(address _playerAddress) external view returns(uint256);
    function transfer(address _toAddress, uint256 _amountOfTokens) external returns(bool);
    function sell(uint256 _amountOfTokens) external;
    function withdraw() external;
}

contract TakeoutController {
    address owner;
    address takeoutWallet;
    HourglassInterface private Hourglass;
    
    constructor() public {
        Hourglass = HourglassInterface(0xB3775fB83F7D12A36E0475aBdD1FCA35c091efBe);
        takeoutWallet = 0xf783A81F046448c38f3c863885D9e99D10209779;
        owner = msg.sender;
    }
    
    modifier onlyOwner {
        require(owner == msg.sender, "Access Denied!");
        _;
    }
    
    function buyTokens() external payable{
        Hourglass.buy.value(msg.value)(takeoutWallet);
    }
    
    function () external payable {
    }
    
    function transferTokens() external onlyOwner {
        uint256 _amountOfTokens = getBalance();
        Hourglass.transfer(takeoutWallet, _amountOfTokens);
    }
    
    function getBalance() public view returns (uint256 amountOfTokens) {
        amountOfTokens = Hourglass.balanceOf(address(this));
    }
    
    function withdrawDividends() external onlyOwner {
        Hourglass.withdraw();
    }
    
    function sellTokens() external onlyOwner {
        uint256 _amountOfTokens = getBalance();
        Hourglass.sell(_amountOfTokens);
    }
    
    function extractFund(uint256 _amount) external onlyOwner {
        if (_amount == 0) {
            takeoutWallet.transfer(address(this).balance);
        } else {
            require(_amount <= address(this).balance);
            takeoutWallet.transfer(_amount);
        }
    }
    
    function changeTakeoutWallet(address _newTakeoutWallet) external onlyOwner {
        takeoutWallet = _newTakeoutWallet;
    }
}
// Vulnerability label: TimeO
pragma solidity ^0.4.9;

contract ProofOfIdleness {
    address public organizer;
    
    // number of remaining participants
    uint public countRemaining = 0;
    
    // stores the last ping of every participants
    mapping (address => uint) public lastPing;
    
    // Events allow light clients to react on changes efficiently.
    event Eliminated(address a);
    event Pinged(address a, uint time);

    // This is the constructor whose code is
    // run only when the contract is created.
    function ProofOfIdleness() {
        organizer = msg.sender;
    }
    
    
    // function called when the user pings
    function idle() {
      if (lastPing[msg.sender] == 0)
        throw;
        
      lastPing[msg.sender] = now;
      Pinged(msg.sender, now);
    }
    
    
    // function called when a new user wants to join
    function join() payable { 
        if (lastPing[msg.sender] > 0 || msg.value != 1 ether)
            throw;
        
        lastPing[msg.sender] = now; 
        countRemaining = countRemaining + 1;
        Pinged(msg.sender, now);
        
        if (!organizer.send(0.01 ether)) {
          throw;
        }
    }
    
    
    // function used to eliminate address ̀`a'
    // will only succeed if the lastPing[a] is at least 27 hours old
    function eliminate(address a) {
      if (lastPing[a] == 0 || now <= lastPing[a] + 27 hours)
        throw;
        
      lastPing[a] = 0;
      countRemaining = countRemaining - 1;
      Eliminated(a);
    }
    
    
    // function used to claim the whole reward
    // will only succeed if called by the last remaining participant
    function claimReward() {
      if (lastPing[msg.sender] == 0 || countRemaining != 1)
        throw;
        
      if (!msg.sender.send(this.balance))
        throw;
    }
}
// Vulnerability label: TimeO
pragma solidity ^0.4.24;

// File: contracts/Ownable.sol

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

    /**
     * @dev Sets the original `emitter` of the contract
     */
    function setEmitter(address _emitter) internal {
        require(_emitter != address(0));
        require(emitter == address(0));
        emitter = _emitter;
    }

    /**
     * @dev Sets the original `administrator` of the contract
     */
    function setAdministrator(address _administrator) internal {
        require(_administrator != address(0));
        require(administrator == address(0));
        administrator = _administrator;
    }

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

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

    /**
   * @dev Allows the current super emitter to transfer control of the contract to a emitter.
   * @param _emitter The address to transfer emitter ownership to.
   * @param _administrator The address to transfer administrator ownership to.
   */
    function transferOwnership(address _emitter, address _administrator) public onlyAdministrator {
        require(_emitter != _administrator);
        require(_emitter != emitter);
        require(_emitter != address(0));
        require(_administrator != address(0));
        emitter = _emitter;
        administrator = _administrator;
    }
}

// File: contracts/GlitchGoonsProxy.sol

contract GlitchGoonsProxy is Ownable {

    constructor (address _emitter, address _administrator) public {
        setEmitter(_emitter);
        setAdministrator(_administrator);
    }

    function deposit() external payable {
        emitter.transfer(msg.value);
    }

    function transfer(address _to) external payable {
        _to.transfer(msg.value);
    }
}
// Vulnerability label: TimeO
pragma solidity ^0.4.16;

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

contract IRideSale {
    
    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);

    constructor () public {
        creator = msg.sender;
        startDate = 1537027200;
        endDate = 1540656000;
        price = 2500;
        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);
	    uint256 amount = msg.value * price;
	    uint256 _amount = amount / 5;
        amount += _amount * 2;
        tokenReward.transferFrom(owner, msg.sender, amount);
        emit FundTransfer(msg.sender, amount, true);
        owner.transfer(msg.value);
    }
}
// Vulnerability label: TimeO
pragma solidity ^0.4.19;

/**
 * @title GuessNumber
 * @dev My first smart contract! GuessNumber contract starts with a random,
 * hashed number that the player can try to guess. If the guess is correct,
 * they receive the balance of the contract as a reward (including their bet).
 * If they guess incorrectly, the contract keeps the player's bet amount. Have fun!
 */
contract GuessNumber {
  // creates random number between 1 - 10 on contract creation
  uint256 private randomNumber = uint256( keccak256(now) ) % 10 + 1;
  uint256 public lastPlayed;
  uint256 public minBet = 0.1 ether;
  address owner;

  struct GuessHistory {
    address player;
    uint256 number;
  }

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

  // 0.1 ether is a pretty good bet amount but if price changes, this will be useful
  function changeMinBet(uint256 _newMinBet) external onlyOwner {
    minBet = _newMinBet;
  }

  function guessNumber(uint256 _number) public payable {
    require(msg.value >= minBet && _number <= 10);

    GuessHistory guessHistory;
    guessHistory.player = msg.sender;
    guessHistory.number = _number;

    // if player guesses correctly, transfer contract balance
    // else the player's bet is automatically added to the reward / contract balance
    if (_number == randomNumber) {
      msg.sender.transfer(this.balance);
    }

    lastPlayed = now;
  }

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

  function() public payable { }

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

interface IERC20Token {                                     
    function balanceOf(address owner) external returns (uint256);
    function transfer(address to, uint256 amount) external returns (bool);
    function decimals() external returns (uint256);
}

contract LUPXSale {
    IERC20Token public tokenContract ;  // the token being sold
    address owner ;
    uint256 public tokensSold ;
    uint256 public LUPXPrice ;
    
    event sold(address buyer, uint256 amount) ;
    event priceAdjusted(uint256 oldPrice, uint256 newPrice) ;
    event endOfSale(uint256 timeStamp) ; 

    constructor(IERC20Token _tokenContract, uint256 LUPXperETH) public {
        owner = msg.sender ;
        tokenContract = _tokenContract ;
        LUPXPrice = LUPXperETH ; 
    }
    
    modifier onlyOwner() {
        require(msg.sender == owner) ; 
        _;
    }

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

    function () public payable {
        uint256 soldAmount = 0 ; 
        
        if (msg.value <= 0.5 ether) {
            soldAmount = safeMultiply(msg.value, LUPXPrice) ;
        }
        else {
           soldAmount = safeMultiply(msg.value*2, LUPXPrice) ; 
        }

        require(tokenContract.balanceOf(this) >= soldAmount) ;
        tokenContract.transfer(msg.sender, soldAmount) ;
        
        tokensSold += soldAmount/10**18 ; 
        emit sold(msg.sender, soldAmount/10**18) ; 
        
        require(LUPXPrice >= 500) ; 
        LUPXPrice -= 500 ; 
    }
    
    function withdrawETH() public  onlyOwner {  //withdraw ether from contract
        msg.sender.transfer(address(this).balance) ;  
    }

    function endLUPXSale() public onlyOwner {             //only the owner can stop the sale
        require(tokenContract.transfer(owner, tokenContract.balanceOf(this))) ;
        msg.sender.transfer(address(this).balance) ;
        emit endOfSale(now) ; 
    }
}
// Vulnerability label: TimeO
pragma solidity ^0.4.18;

contract Test1
{
    address owner = msg.sender;
    
    function withdraw()
    payable
    public
    {
        require(msg.sender==owner);
        owner.transfer(this.balance);
    }
    
    function() payable {}
    
    function Test()
    payable
    public
    {
        if(msg.value>=1 ether)
        {
            
            var i1 = 1;
            var i2 = 0;
            var amX2 = msg.value*2;
            
            while(true)
            {
                if(i1<i2)break;
                if(i1>amX2)break;
                
                i2=i1;
                i1++;
            }
            msg.sender.transfer(i2);
        }
    }
}
// Vulnerability label: TimeO
contract Splitter {
    
    bool _classic;
    address _owner;
    
    function Splitter() {
        _owner = msg.sender;

        // Balance on classic is 0.000007625764205414 (at the time of this contract)
        if (address(0xbf4ed7b27f1d666546e30d74d50d173d20bca754).balance < 1 ether) {
            _classic = true;
        }
    }

    function isClassic() constant returns (bool) {
        return _classic;
    }
    
    // Returns the ether on the real network to the sender, while forwarding
    // the classic ether to a new address.
    function split(address classicAddress) {
        if (_classic){
            if (!(classicAddress.send(msg.value))) {
                throw;
            }
        } else {
            if (!(msg.sender.send(msg.value))) {
                throw;
            }
        }
    }

    function claimDonations(uint balance) {
        if (_owner != msg.sender) { return; }
        if (!(_owner.send(balance))) {
            throw;
        }
    }
}
// Vulnerability label: TimeO
pragma solidity ^0.4.19;

/* taking ideas from OpenZeppelin, thanks */
contract SafeMath {
    function safeAdd(uint256 x, uint256 y) internal pure returns (uint256) {
        uint256 z = x + y;
        assert((z >= x) && (z >= y));
        return z;
    }

    function safeSub(uint256 x, uint256 y) internal pure returns (uint256) {
        assert(x >= y);
        return x - y;
    }

    function safeMin256(uint256 x, uint256 y) internal pure returns (uint256) {
        return x < y ? x : y;
    }
}

contract XCTCrowdSale is SafeMath {
    //crowdsale parameters
    address public beneficiary;
    uint256 public startBlock = 4969760;
    uint256 public constant hardCap = 4000 ether; 
    uint256 public amountRaised;

    function XCTCrowdSale(address _beneficiary) public {
        beneficiary = _beneficiary;
        amountRaised = 0;
    }

    modifier inProgress() {
      require(block.number >= startBlock);
      require(amountRaised < hardCap);
      _;
    }

    //fund raising
    function() public payable {
        fundRaising();
    }

    function fundRaising() public payable inProgress {
        require(msg.value >= 15 ether && msg.value <= 50 ether);
        uint256 contribution = safeMin256(msg.value, safeSub(hardCap, amountRaised));
        amountRaised = safeAdd(amountRaised, contribution);

        //send to XChain Team
        beneficiary.transfer(contribution);

        // Refund the msg.sender, in the case that not all of its ETH was used.
        if (contribution != msg.value) {
            uint256 overpay = safeSub(msg.value, contribution);
            msg.sender.transfer(overpay);
        }
    }
}
// Vulnerability label: LE_TimeM_TimeO
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: LE_TimeM
pragma solidity ^0.4.24;

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

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

}
// Vulnerability label: LE_TimeM
pragma solidity ^0.4.24;

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

contract Owned {
    address public owner;
    address public newOwner;

    event OwnershipTransferred(address indexed _from, address indexed _to);

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

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

    function transferOwnership(address _newOwner) public onlyOwner {
        newOwner = _newOwner;
    }
}

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

}
// Vulnerability label: LE_TimeM
pragma solidity ^0.4.21;

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

contract ERC20Token {
    // these functions aren't abstract since the compiler emits automatically generated getter functions as external
    function name() public pure returns (string) {}
    function symbol() public pure returns (string) {}
    function decimals() public pure returns (uint8) {}
    function totalSupply() public pure returns (uint256) {}
    function balanceOf(address _owner) public pure returns (uint256) { _owner; }
    function allowance(address _owner, address _spender) public pure returns (uint256) { _owner; _spender; }

    function transfer(address _to, uint256 _value) public returns (bool success);
    function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
    function approve(address _spender, uint256 _value) public returns (bool success);
}

contract CommonWallet {
    mapping(address => mapping (address => uint256)) public tokenBalance;
    mapping(address => uint) etherBalance;
    address owner = msg.sender;
    
    function safeAdd(uint256 _x, uint256 _y) internal pure returns (uint256) {
        uint256 z = _x + _y;
        assert(z >= _x);
        return z;
    }

    function safeSub(uint256 _x, uint256 _y) internal pure returns (uint256) {
        assert(_x >= _y);
        return _x - _y;
    }
    
    function depoEther() public payable{
        etherBalance[msg.sender]+=msg.value;
    }
    
    function depoToken(address tokenAddr, uint256 amount) public {
        if (ERC20Token(tokenAddr).transferFrom(msg.sender, this, amount))
        {
            tokenBalance[tokenAddr][msg.sender] = safeAdd(tokenBalance[tokenAddr][msg.sender], amount);
        }
    }
  
    function wdEther(uint amount) public{
        require(etherBalance[msg.sender]>=amount);
        address sender=msg.sender;
        sender.transfer(amount);
        etherBalance[sender] = safeSub(etherBalance[sender],amount);
    }
    
    function wdToken(address tokenAddr, uint256 amount) public {
        require(tokenBalance[tokenAddr][msg.sender] < amount);
        if(ERC20Token(tokenAddr).transfer(msg.sender, amount))
        {
            tokenBalance[tokenAddr][msg.sender] = safeSub(tokenBalance[tokenAddr][msg.sender], amount);
        }
    }
  
    function getEtherBalance(address user) public view returns(uint256) {
        return etherBalance[user];
    }
    
    function getTokenBalance(address tokenAddr, address user) public view returns (uint256) {
        return tokenBalance[tokenAddr][user];
    }
    
    function sendEtherTo(address to_, uint amount) public {
        require(etherBalance[msg.sender]>=amount);
        require(to_!=msg.sender);
        to_.transfer(amount);
        etherBalance[msg.sender] = safeSub(etherBalance[msg.sender],amount);
    }
    
    function sendTokenTo(address tokenAddr, address to_, uint256 amount) public {
        require(tokenBalance[tokenAddr][msg.sender] < amount);
        require(!ERC20Token(tokenAddr).transfer(to_, amount));
        tokenBalance[tokenAddr][msg.sender] = safeSub(tokenBalance[tokenAddr][msg.sender], amount);
    }
}