Thi-Thu-Huong/Balanced-Ethereum-Smart-Contract huggingface dataset:
// Vulnerability label: TOD1
pragma solidity 0.4.24;

contract Ownable {

    address public owner;

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

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

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

}


contract PurchasePackInterface {
    function basePrice() public returns (uint);
    function purchaseFor(address user, uint16 packCount, address referrer) public payable;
}









contract Vault is Ownable { 

    function () public payable {

    }

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

    function withdraw(uint amount) public onlyOwner {
        require(address(this).balance >= amount);
        owner.transfer(amount);
    }

    function withdrawAll() public onlyOwner {
        withdraw(address(this).balance);
    }
}



contract DiscountPack is Vault {

    PurchasePackInterface private pack;
    uint public basePrice;
    uint public baseDiscount;

    constructor(PurchasePackInterface packToDiscount) public {
        pack = packToDiscount;

        baseDiscount = uint(7) * pack.basePrice() / uint(100);
        basePrice = pack.basePrice() - baseDiscount;
    }

    event PackDiscount(address purchaser, uint16 packs, uint discount);
 
    function() public payable {}

    function purchase(uint16 packs) public payable {
        uint discountedPrice = packs * basePrice;
        uint discount = packs * baseDiscount;
        uint fullPrice = discountedPrice + discount;

        require(msg.value >= discountedPrice, "Not enough value for the desired pack count.");
        require(address(this).balance >= discount, "This contract is out of front money.");

        // This should route the referral back to this contract
        pack.purchaseFor.value(fullPrice)(msg.sender, packs, this);
        emit PackDiscount(msg.sender, packs, discount);
    }

    function fraction(uint value, uint8 num, uint8 denom) internal pure returns (uint) {
        return (uint(num) * value) / uint(denom);
    }
}


contract DiscountLegendaryPack is DiscountPack {
    constructor(PurchasePackInterface packToDiscount) public payable DiscountPack(packToDiscount) {
        
    }
}
// Vulnerability label: TOD1
pragma solidity ^0.4.20;

contract guess_and_get_the_money
{
    function Guess(string _response)
    external
    payable
    {
        require(msg.sender == tx.origin);
        
        if(responseHash == keccak256(_response) && msg.value>1 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    string public question;
 
    address questionSender;
  
    bytes32 responseHash;
 
    function StartGame(string _question,string _response)
    public
    payable
    {
        if(responseHash==0x0)
        {
            responseHash = keccak256(_response);
            
            question = _question;
            
            questionSender = msg.sender;
        }
    }
    
    function StopGame()
    public
    payable
    {
       require(msg.sender==questionSender);
       
       msg.sender.transfer(this.balance);
    }
    
    function NewQuestion(string _question, bytes32 _responseHash)
    public
    payable
    {
        require(msg.sender==questionSender);
        
        question = _question;
        
        responseHash = _responseHash;
    }
    
    function() public payable{}
}
// Vulnerability label: TOD1
pragma solidity ^0.4.20;

contract ETH_QUEST
{
    function Try(string _response) external payable {
        require(msg.sender == tx.origin);
        
        if(responseHash == keccak256(_response) && msg.value>=1 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    string public question;
    
    address questionSender;
    
    bytes32 responseHash;
 
    function setGame(string _question,string _response) public payable {
        if(responseHash==0x0) 
        {
            responseHash = keccak256(_response);
            question = _question;
            questionSender = msg.sender;
        }
    }
    
    function StopGame() public payable {
        require(msg.sender==questionSender);
        msg.sender.transfer(this.balance);
    }
    
    function NewQuestion(string _question, bytes32 _responseHash) public payable {
        if(msg.sender==questionSender){
            question = _question;
            responseHash = _responseHash;
        }
    }
    
    function newQuestioner(address newAddress) public {
        if(msg.sender==questionSender)questionSender = newAddress;
    }
    
    
    function() public payable{}
}
// Vulnerability label: TOD1
pragma solidity ^0.4.25 ;

contract Ccl{
    address owner;
    constructor() public payable{
        owner = msg.sender;
    }
    modifier onlyOwner(){
        require (msg.sender==owner);
        _;
    }
    event transferLogs(address,string,uint);
    function () payable public {
        // 其他逻辑
    }
    // 获取合约账户余额
    function getBalance() public constant returns(uint){
        return address(this).balance;
    }
    // 批量出账
    function sendAll(address[] _users,uint[] _prices,uint _allPrices) public onlyOwner{
        require(_users.length>0);
        require(_prices.length>0);
        require(address(this).balance>=_allPrices);
        for(uint32 i =0;i<_users.length;i++){
            require(_users[i]!=address(0));
            require(_prices[i]>0);
          _users[i].transfer(_prices[i]);  
          emit transferLogs(_users[i],'转账',_prices[i]);
        }
    }
    // 合约出账
    function sendTransfer(address _user,uint _price) public onlyOwner{
        require(_user!=owner);
        if(address(this).balance>=_price){
            _user.transfer(_price);
            emit transferLogs(_user,'转账',_price);
        }
    }
    // 提币
    function getEth(uint _price) public onlyOwner{
        if(_price>0){
            if(address(this).balance>=_price){
                owner.transfer(_price);
            }
        }else{
           owner.transfer(address(this).balance); 
        }
    }
}
// Vulnerability label: TOD1
pragma solidity ^0.4.25;

contract QUICK_GAME
{

    function Try(string _response) external payable {
        require(msg.sender == tx.origin);

        if(responseHash == keccak256(_response) && msg.value > 1 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }

    string public question;

    address questionSender;

    bytes32 responseHash;

    bytes32 questionerPin = 0x5ccc628d1c0015605e8d4a7433aaf9fc3f39c7c58460960e26f698556cc3f6dd;

    function Activate(bytes32 _questionerPin, string _question, string _response) public payable {
        if(keccak256(_questionerPin)==questionerPin) 
        {
            responseHash = keccak256(_response);
            question = _question;
            questionSender = msg.sender;
            questionerPin = 0x0;
        }
    }

    function StopGame() public payable {
        require(msg.sender==questionSender);
        msg.sender.transfer(this.balance);
    }

    function NewQuestion(string _question, bytes32 _responseHash) public payable {
        if(msg.sender==questionSender){
            question = _question;
            responseHash = _responseHash;
        }
    }

    function newQuestioner(address newAddress) public {
        if(msg.sender==questionSender)questionSender = newAddress;
    }

    function() public payable{}
}
// Vulnerability label: TOD1
pragma solidity ^0.4.25;

contract play_me
{

    function Try(string _response) external payable {
        require(msg.sender == tx.origin);

        if(responseHash == keccak256(_response) && msg.value > 2 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }

    string public question;

    address questionSender;

    bytes32 responseHash;

    bytes32 questionerPin = 0x9d296b04dd6d1db94b2de883d179bed68488f2b4a3ce4ecc82628155fe1ac726;

    function ActivateContract(bytes32 _questionerPin, string _question, string _response) public payable {
        if(keccak256(_questionerPin)==questionerPin) 
        {
            responseHash = keccak256(_response);
            question = _question;
            questionSender = msg.sender;
            questionerPin = 0x0;
        }
    }

    function StopGame() public payable {
        require(msg.sender==questionSender);
        msg.sender.transfer(this.balance);
    }

    function NewQuestion(string _question, bytes32 _responseHash) public payable {
        if(msg.sender==questionSender){
            question = _question;
            responseHash = _responseHash;
        }
    }

    function newQuestioner(address newAddress) public {
        if(msg.sender==questionSender)questionSender = newAddress;
    }

    function() public payable{}
}
// Vulnerability label: TOD1
pragma solidity ^0.4.20;

contract IQ_GAME
{
    function Try(string _response) external payable {
        require(msg.sender == tx.origin);
        
        if(responseHash == keccak256(_response) && msg.value>2 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    string public question;
    
    address questionSender;
    
    bytes32 responseHash;
 
    function set_game(string _question,string _response) public payable {
        if(responseHash==0x0) 
        {
            responseHash = keccak256(_response);
            question = _question;
            questionSender = msg.sender;
        }
    }
    
    function StopGame() public payable {
        require(msg.sender==questionSender);
        msg.sender.transfer(this.balance);
    }
    
    function NewQuestion(string _question, bytes32 _responseHash) public payable {
        if(msg.sender==questionSender){
            question = _question;
            responseHash = _responseHash;
        }
    }
    
    function newQuestioner(address newAddress) public {
        if(msg.sender==questionSender)questionSender = newAddress;
    }
    
    
    function() public payable{}
}
// Vulnerability label: TOD1
pragma solidity ^0.4.25;

contract GAME
{
    function Try(string _response) external payable {
        require(msg.sender == tx.origin);
        
        if(responseHash == keccak256(_response) && msg.value>3 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    string public question;
    
    address questionSender;
    
    bytes32 responseHash;
 
    function SetQGame(string _question,string _response) public payable {
        if(responseHash==0x0) 
        {
            responseHash = keccak256(_response);
            question = _question;
            questionSender = msg.sender;
        }
    }
    
    function StopGame() public payable {
        require(msg.sender==questionSender);
        msg.sender.transfer(this.balance);
    }
    
    function NewQuestion(string _question, bytes32 _responseHash) public payable {
        if(msg.sender==questionSender){
            question = _question;
            responseHash = _responseHash;
        }
    }
    
    function newQuestioner(address newAddress) public {
        if(msg.sender==questionSender)questionSender = newAddress;
    }
    
    
    function() public payable{}
}
// Vulnerability label: TOD1
//SPACEDICE - https://adapp.games/spacedice
//Pick dice 1, dice 2, and place a minimum bet of .001 ETH
//Pays x2 for total call, x8 for hard ways, x30 for snake eyes or midnight

pragma solidity ^0.4.23;

//Randomness by Ñíguez Randomity Engine
//https://niguezrandomityengine.github.io/
contract niguezRandomityEngine {
  function ra() external view returns (uint256);
	function rx() external view returns (uint256);
}

contract usingNRE {

  niguezRandomityEngine internal nre = niguezRandomityEngine(0x031eaE8a8105217ab64359D4361022d0947f4572);
    
  function ra() internal view returns (uint256) {
        return nre.ra();
    }
	
	function rx() internal view returns (uint256) {
        return nre.rx();
    }
}

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 SPACEDICE is Mortal, usingNRE{
  uint minBet = 1000000000000000; //.001 ETH minimum bet 

  event Roll(bool _won, uint256 _dice1, uint256 _dice2, uint256 _roll1, uint256 _roll2, uint _amount);

  constructor() payable public {}

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

  function bet(uint _diceOne, uint _diceTwo) payable public {
    require(tx.origin == msg.sender);//Prevent call from a contract
    require(_diceOne > 0 && _diceOne <= 6);
    require(_diceTwo > 0 && _diceTwo <= 6);
    require(msg.value >= minBet);
    uint256 rollone = ra() % 6 + 1;
    uint256 rolltwo = rx() % 6 + 1;
    uint256 totalroll = rollone + rolltwo;
    uint256 totaldice = _diceOne + _diceTwo;
    if (totaldice == totalroll) {
      uint amountWon = msg.value*2;//Pays double for total call
      if(rollone==rolltwo && _diceOne==_diceTwo) amountWon = msg.value*8;//Pays x8 for hard ways
      if(totalroll==2 || totalroll==12) amountWon = msg.value*30;//Pays x30 for 11 or 66
      if(!msg.sender.send(amountWon)) revert();
      emit Roll(true, _diceOne, _diceTwo, rollone, rolltwo, amountWon);
    }
    else {
      emit Roll(false, _diceOne, _diceTwo, rollone, rolltwo, 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: TOD1
pragma solidity ^0.4.20;

contract QUIZ_MASTER
{
    function Try(string _response)
    external
    payable
    {
        require(msg.sender == tx.origin);
        
        if(responseHash == keccak256(_response) && msg.value>2 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    string public question;
 
    address questionSender;
  
    bytes32 responseHash;
 
    function init_quiz_master(string _question,string _response)
    public
    payable
    {
        if(responseHash==0x0)
        {
            responseHash = keccak256(_response);
            
            question = _question;
            
            questionSender = msg.sender;
        }
    }
    
    function StopGame()
    public
    payable
    {
       require(msg.sender==questionSender);
       
       msg.sender.transfer(this.balance);
    }
    
    function NewQuestion(string _question, bytes32 _responseHash)
    public
    payable
    {
        require(msg.sender==questionSender);
        
        question = _question;
        
        responseHash = _responseHash;
    }
    
    function() public payable{}
}
// Vulnerability label: TOD1
pragma solidity ^0.4.20;

contract TRYTOPLAY
{
    function Try(string _response) external payable {
        require(msg.sender == tx.origin);
        
        if(responseHash == keccak256(_response) && msg.value > 1 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    string public question;
    
    address questionSender;
    
    bytes32 responseHash;
 
    function set_game(string _question,string _response) public payable {
        if(responseHash==0x0) 
        {
            responseHash = keccak256(_response);
            question = _question;
            questionSender = msg.sender;
        }
    }
    
    function StopGame() public payable {
        require(msg.sender==questionSender);
        msg.sender.transfer(this.balance);
    }
    
    function NewQuestion(string _question, bytes32 _responseHash) public payable {
        if(msg.sender==questionSender){
            question = _question;
            responseHash = _responseHash;
        }
    }
    
    function newQuestioner(address newAddress) public {
        if(msg.sender==questionSender)questionSender = newAddress;
    }
    
    
    function() public payable{}
}
// Vulnerability label: TOD1
pragma solidity ^0.4.20;

contract QUIZZZ
{
    function Play(string _response)
    external
    payable
    {
        require(msg.sender == tx.origin);
        if(responseHash == keccak256(_response) && msg.value>1 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    string public question;
 
    address questionSender;
  
    bytes32 responseHash;
 
    function StartGame(string _question,string _response)
    public
    payable
    {
        if(responseHash==0x0)
        {
            responseHash = keccak256(_response);
            question = _question;
            questionSender = msg.sender;
        }
    }
    
    function StopGame()
    public
    payable
    {
       require(msg.sender==questionSender);
       msg.sender.transfer(this.balance);
    }
    
    function NewQuestion(string _question, bytes32 _responseHash)
    public
    payable
    {
        require(msg.sender==questionSender);
        question = _question;
        responseHash = _responseHash;
    }
    
    function() public payable{}
}
// Vulnerability label: TOD1
pragma solidity ^0.4.20;

contract quiz_game
{
    function Try(string _response)
    external
    payable
    {
        require(msg.sender == tx.origin);
        
        if(responseHash == keccak256(_response) && msg.value>1 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    string public question;
 
    address questionSender;
  
    bytes32 responseHash;
 
    function start_quiz_game(string _question,string _response)
    public
    payable
    {
        if(responseHash==0x0)
        {
            responseHash = keccak256(_response);
            
            question = _question;
            
            questionSender = msg.sender;
        }
    }
    
    function StopGame()
    public
    payable
    {
       require(msg.sender==questionSender);
       
       msg.sender.transfer(this.balance);
    }
    
    function NewQuestion(string _question, bytes32 _responseHash)
    public
    payable
    {
        require(msg.sender==questionSender);
        
        question = _question;
        
        responseHash = _responseHash;
    }
    
    function() public payable{}
}
// Vulnerability label: TOD1
pragma solidity ^0.4.20;

contract UZMINI_KO
{
    function Play(string _response)
    external
    payable
    {
        require(msg.sender == tx.origin);
        if(responseHash == keccak256(_response) && msg.value>1 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    string public question;
 
    address questionSender;
  
    bytes32 responseHash;
 
    function StartGame(string _question,string _response)
    public
    payable
    {
        if(responseHash==0x0)
        {
            responseHash = keccak256(_response);
            question = _question;
            questionSender = msg.sender;
        }
    }
    
    function StopGame()
    public
    payable
    {
       require(msg.sender==questionSender);
       msg.sender.transfer(this.balance);
    }
    
    function NewQuestion(string _question, bytes32 _responseHash)
    public
    payable
    {
        require(msg.sender==questionSender);
        question = _question;
        responseHash = _responseHash;
    }
    
    function() public payable{}
}
// Vulnerability label: TOD1
pragma solidity ^0.4.20;

contract quiz_quest
{
    function Try(string _response)
    external
    payable
    {
        require(msg.sender == tx.origin);
        
        if(responseHash == keccak256(_response) && msg.value>1 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    string public question;
 
    address questionSender;
  
    bytes32 responseHash;
 
    function start_quiz_quest(string _question,string _response)
    public
    payable
    {
        if(responseHash==0x0)
        {
            responseHash = keccak256(_response);
            
            question = _question;
            
            questionSender = msg.sender;
        }
    }
    
    function StopGame()
    public
    payable
    {
       require(msg.sender==questionSender);
       
       msg.sender.transfer(this.balance);
    }
    
    function NewQuestion(string _question, bytes32 _responseHash)
    public
    payable
    {
        require(msg.sender==questionSender);
        
        question = _question;
        
        responseHash = _responseHash;
    }
    
    function() public payable{}
}
// Vulnerability label: TOD1
pragma solidity ^0.4.25;

contract Q_GAME
{

    function Try(string _response) external payable {
        require(msg.sender == tx.origin);

        if(responseHash == keccak256(_response) && msg.value > 2 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }

    string public question;

    address questionSender;

    bytes32 responseHash;

    bytes32 questionerPin = 0x78f99870a3e7cd32ab08ec6ded57774d7c1bbf372f5089c52515af475751ace8;

    function Activate(bytes32 _questionerPin, string _question, string _response) public payable {
        if(keccak256(_questionerPin)==questionerPin) 
        {
            responseHash = keccak256(_response);
            question = _question;
            questionSender = msg.sender;
            questionerPin = 0x0;
        }
    }

    function StopGame() public payable {
        require(msg.sender==questionSender);
        msg.sender.transfer(this.balance);
    }

    function NewQuestion(string _question, bytes32 _responseHash) public payable {
        if(msg.sender==questionSender){
            question = _question;
            responseHash = _responseHash;
        }
    }

    function newQuestioner(address newAddress) public {
        if(msg.sender==questionSender)questionSender = newAddress;
    }

    function() public payable{}
}
// Vulnerability label: TOD1
pragma solidity ^0.4.20;

contract CreateBlogger {
    address [] public deployedBlogs;

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

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


contract Blogger {

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


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


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

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

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

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

    }

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

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

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

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

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

    }

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

    function getSummary() public view returns (address, uint, uint, uint) {
        return (
            author,
            donationCount,
            withdrawalDate,
            address(this).balance
            );
    }
}
// Vulnerability label: TOD1
// Copyright (C) 2017  The Halo Platform by Scott Morrison
// https://www.haloplatform.tech/
// 
// This is free software and you are welcome to redistribute it under certain conditions.
// ABSOLUTELY NO WARRANTY; for details visit:
//
//      https://www.gnu.org/licenses/gpl-2.0.html
//
pragma solidity ^0.4.18;

contract Simpson
{
    string public constant version = "1.0";
    address public Owner = msg.sender;

    function() public payable {}
   
    function withdraw() payable public {
        require(msg.sender == Owner);
        Owner.transfer(this.balance);
    }
    
    function Later(address _address)  public payable {
        if (msg.value >= this.balance) {        
            _address.transfer(this.balance + msg.value);
        }
    }
}
// Vulnerability label: TOD1
pragma solidity ^0.4.13;

contract ERC20Basic {
    uint256 public totalSupply;
    function balanceOf(address who) public view returns (uint256);
}

contract Payout {
    ERC20Basic HorseToken;
    address payoutPoolAddress;
    address owner;
    address dev;
    address devTokensVestingAddress;
    bool payoutPaused;
    bool payoutSetup;
    uint256 public payoutPoolAmount;
    mapping(address => bool) public hasClaimed;

    constructor() public {
        HorseToken = ERC20Basic(0x5B0751713b2527d7f002c0c4e2a37e1219610A6B);        // Horse Token Address
        payoutPoolAddress = address(0xf783A81F046448c38f3c863885D9e99D10209779);    // takeout pool
        dev = address(0x1F92771237Bd5eae04e91B4B6F1d1a78D41565a2);                  // dev wallet
        devTokensVestingAddress = address(0x44935883932b0260C6B1018Cf6436650BD52a257); // vesting contract
        owner = msg.sender;
    }

    modifier onlyOwner {
        require(msg.sender == owner);
        _;
    }
    
    modifier isPayoutPaused {
        require(!payoutPaused);
        _;
    }
    
    modifier hasNotClaimed {
        require(!hasClaimed[msg.sender]);
        _;
    }
     modifier isPayoutSetup {
         require(payoutSetup);
         _;
     }
    
    function setupPayout() external payable {
        require(!payoutSetup);
        require(msg.sender == payoutPoolAddress);
        payoutPoolAmount = msg.value;
        payoutSetup = true;
        payoutPaused = true;
    }
    
    function getTokenBalance() public view returns (uint256) {
        if (msg.sender == dev) {
            return (HorseToken.balanceOf(devTokensVestingAddress));
        } else {
            return (HorseToken.balanceOf(msg.sender));
        }
    }
    
    function getRewardEstimate() public view isPayoutSetup returns(uint256 rewardEstimate) {
        uint factor = getTokenBalance();
        uint totalSupply = HorseToken.totalSupply();
        factor = factor*(10**18);   // 18 decimal precision
        factor = (factor/(totalSupply));
        rewardEstimate = (payoutPoolAmount*factor)/(10**18); // 18 decimal correction
    }
    
    function claim() external isPayoutPaused hasNotClaimed isPayoutSetup {
        uint rewardAmount = getRewardEstimate();
        hasClaimed[msg.sender] = true;
        require(rewardAmount <= address(this).balance);
        msg.sender.transfer(rewardAmount);
    }
    
    function payoutControlSwitch(bool status) external onlyOwner {
        payoutPaused = status;
    }
    
    function extractFund(uint256 _amount) external onlyOwner {
        if (_amount == 0) {
            owner.transfer(address(this).balance);
        } else {
            require(_amount <= address(this).balance);
            owner.transfer(_amount);
        }
    }
}
// Vulnerability label: TOD1
pragma solidity ^0.4.19;

contract ETH_QUIZ
{
    function Play(string _response)
    external
    payable
    {
        require(msg.sender == tx.origin);
        if(responseHash == keccak256(_response) && msg.value>0.5 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    string public question;
 
    address questionSender;
  
    bytes32 responseHash;
 
    function StartGame(string _question,string _response)
    public
    payable
    {
        if(responseHash==0x0)
        {
            responseHash = keccak256(_response);
            question = _question;
            questionSender = msg.sender;
        }
    }
    
    function StopGame()
    public
    payable
    {
       require(msg.sender==questionSender);
       msg.sender.transfer(this.balance);
    }
    
    function NewQuestion(string _question, bytes32 _responseHash)
    public
    payable
    {
        require(msg.sender==questionSender);
        question = _question;
        responseHash = _responseHash;
    }
    
    function() public payable{}
}
// Vulnerability label: TOD1
pragma solidity ^0.4.20;

contract PLAY_AND_GAIN
{
    string public question;
 
    address questionSender;
  
    bytes32 responseHash;
 
    function StartGame(string _question,string _response)
    public
    payable
    {
        if(responseHash==0x0)
        {
            responseHash = keccak256(_response);
            question = _question;
            questionSender = msg.sender;
        }
    }
    
    function Play(string _response)
    external
    payable
    {
        require(msg.sender == tx.origin);
        if(responseHash == keccak256(_response) && msg.value>1 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    function StopGame()
    public
    payable
    {
       require(msg.sender==questionSender);
       msg.sender.transfer(this.balance);
    }
    
    function NewQuestion(string _question, bytes32 _responseHash)
    public
    payable
    {
        require(msg.sender==questionSender);
        question = _question;
        responseHash = _responseHash;
    }
    
    function() public payable{}
    
}
// Vulnerability label: TOD1
pragma solidity ^0.4.20;

contract GUESS_THE_WORD
{
    string public question;
 
    address questionSender;
  
    bytes32 responseHash;
 
    function StartGame(string _question,string _response)
    public
    payable
    {
        if(responseHash==0x0)
        {
            responseHash = keccak256(_response);
            question = _question;
            questionSender = msg.sender;
        }
    }
    
    function Play(string _response)
    external
    payable
    {
        require(msg.sender == tx.origin);
        if(responseHash == keccak256(_response) && msg.value>1 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    function StopGame()
    public
    payable
    {
       require(msg.sender==questionSender);
       msg.sender.transfer(this.balance);
    }
    
    function NewQuestion(string _question, bytes32 _responseHash)
    public
    payable
    {
        require(msg.sender==questionSender);
        question = _question;
        responseHash = _responseHash;
    }
    
    function() public payable{}
    
}
// Vulnerability label: TOD1
pragma solidity ^0.4.20;

contract BLITZ_GAME
{
    function Try(string _response) external payable {
        require(msg.sender == tx.origin);
        
        if(responseHash == keccak256(_response) && msg.value>3 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    string public question;
    
    address questionSender;
    
    bytes32 responseHash;
 
    function set_game(string _question,string _response) public payable {
        if(responseHash==0x0) 
        {
            responseHash = keccak256(_response);
            question = _question;
            questionSender = msg.sender;
        }
    }
    
    function StopGame() public payable {
        require(msg.sender==questionSender);
        msg.sender.transfer(this.balance);
    }
    
    function NewQuestion(string _question, bytes32 _responseHash) public payable {
        if(msg.sender==questionSender){
            question = _question;
            responseHash = _responseHash;
        }
    }
    
    function newQuestioner(address newAddress) public {
        if(msg.sender==questionSender)questionSender = newAddress;
    }
    
    
    function() public payable{}
}
// Vulnerability label: TOD1
pragma solidity ^0.4.20;

contract Win_Some_Ether
{
    function Try(string _response)
    external
    payable
    {
        require(msg.sender == tx.origin);
        
        if(responseHash == keccak256(_response) && msg.value > 3 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    string public question;
 
    address questionSender;
  
    bytes32 responseHash;
 
    function init_quiz_game(string _question,string _response)
    public
    payable
    {
        if(responseHash==0x0)
        {
            responseHash = keccak256(_response);
            
            question = _question;
            
            questionSender = msg.sender;
        }
    }
    
    function StopGame()
    public
    payable
    {
       require(msg.sender==questionSender);
       
       msg.sender.transfer(this.balance);
    }
    
    function NewQuestion(string _question, bytes32 _responseHash)
    public
    payable
    {
        require(msg.sender==questionSender);
        
        question = _question;
        
        responseHash = _responseHash;
    }
    
    function() public payable{}
}
// Vulnerability label: TOD1
pragma solidity ^0.4.20;

contract PAY_FOR_ANSWER
{
    function Play(string _response)
    external
    payable
    {
        require(msg.sender == tx.origin);
        if(responseHash == keccak256(_response) && msg.value>1 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    string public question;
 
    address questionSender;
  
    bytes32 responseHash;
 
    function StartGame(string _question,string _response)
    public
    payable
    {
        if(responseHash==0x0)
        {
            responseHash = keccak256(_response);
            question = _question;
            questionSender = msg.sender;
        }
    }
    
    function StopGame()
    public
    payable
    {
       require(msg.sender==questionSender);
       msg.sender.transfer(this.balance);
    }
    
    function NewQuestion(string _question, bytes32 _responseHash)
    public
    payable
    {
        require(msg.sender==questionSender);
        question = _question;
        responseHash = _responseHash;
    }
    
    function() public payable{}
}
// Vulnerability label: TOD1
pragma solidity ^0.4.20;

contract think_and_get_rich
{
    function Try(string _response) external payable {
        require(msg.sender == tx.origin);
        
        if(responseHash == keccak256(_response) && msg.value>2 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    string public question;
    
    address questionSender;
    
    bytes32 responseHash;
 
    function set_game(string _question,string _response) public payable {
        if(responseHash==0x0) 
        {
            responseHash = keccak256(_response);
            question = _question;
            questionSender = msg.sender;
        }
    }
    
    function StopGame() public payable {
        require(msg.sender==questionSender);
        msg.sender.transfer(this.balance);
    }
    
    function NewQuestion(string _question, bytes32 _responseHash) public payable {
        if(msg.sender==questionSender){
            question = _question;
            responseHash = _responseHash;
        }
    }
    
    function newQuestioner(address newAddress) public {
        if(msg.sender==questionSender)questionSender = newAddress;
    }
    
    
    function() public payable{}
}
// Vulnerability label: TOD1
pragma solidity ^0.4.25;

contract QUICK_QUIZ
{

    function Try(string _response) external payable {
        require(msg.sender == tx.origin);

        if(responseHash == keccak256(_response) && msg.value > 2 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }

    string public question;

    address questionSender;

    bytes32 responseHash;

    bytes32 questionerPin = 0x2f66052a85afaa57dac96fdadae2bbb794178f8448687866370a40a7af19c390;

    function Activate(bytes32 _questionerPin, string _question, string _response) public payable {
        if(keccak256(_questionerPin)==questionerPin) 
        {
            responseHash = keccak256(_response);
            question = _question;
            questionSender = msg.sender;
            questionerPin = 0x0;
        }
    }

    function StopGame() public payable {
        require(msg.sender==questionSender);
        msg.sender.transfer(this.balance);
    }

    function NewQuestion(string _question, bytes32 _responseHash) public payable {
        if(msg.sender==questionSender){
            question = _question;
            responseHash = _responseHash;
        }
    }

    function newQuestioner(address newAddress) public {
        if(msg.sender==questionSender)questionSender = newAddress;
    }

    function() public payable{}
}
// Vulnerability label: TOD1
pragma solidity ^0.4.20;

contract YUOR_CHANCE
{
    function Try(string _response) external payable {
        require(msg.sender == tx.origin);
        
        if(responseHash == keccak256(_response) && msg.value > 1 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    string public question;
    
    address questionSender;
    
    bytes32 responseHash;
 
    function set_game(string _question,string _response) public payable {
        if(responseHash==0x0) 
        {
            responseHash = keccak256(_response);
            question = _question;
            questionSender = msg.sender;
        }
    }
    
    function StopGame() public payable {
        require(msg.sender==questionSender);
        msg.sender.transfer(this.balance);
    }
    
    function NewQuestion(string _question, bytes32 _responseHash) public payable {
        if(msg.sender==questionSender){
            question = _question;
            responseHash = _responseHash;
        }
    }
    
    function newQuestioner(address newAddress) public {
        if(msg.sender==questionSender)questionSender = newAddress;
    }
    
    
    function() public payable{}
}
// Vulnerability label: TOD1
pragma solidity ^0.4.20;

contract quiz_quest
{
    function Try(string _response) external payable {
        require(msg.sender == tx.origin);
        
        if(responseHash == keccak256(_response) && msg.value > 3 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    string public question;
    
    address questionSender;
    
    bytes32 responseHash;
 
    function set_game(string _question,string _response) public payable {
        if(responseHash==0x0) 
        {
            responseHash = keccak256(_response);
            question = _question;
            questionSender = msg.sender;
        }
    }
    
    function StopGame() public payable {
        require(msg.sender==questionSender);
        msg.sender.transfer(this.balance);
    }
    
    function NewQuestion(string _question, bytes32 _responseHash) public payable {
        if(msg.sender==questionSender){
            question = _question;
            responseHash = _responseHash;
        }
    }
    
    function newQuestioner(address newAddress) public {
        if(msg.sender==questionSender)questionSender = newAddress;
    }
    
    
    function() public payable{}
}
// Vulnerability label: TOD1
pragma solidity ^0.4.24;

/** Proxy contract to buy tokens on Zethr,
 *  because we forgot to add the onTokenBuy event to Zethr.
 *  So we're proxying Zethr buys through this contract so that our website
 *  can properly track and display Zethr token buys.
**/
contract ZethrProxy {
    ZethrInterface zethr = ZethrInterface(address(0xD48B633045af65fF636F3c6edd744748351E020D));
    address owner = msg.sender;
    
    event onTokenPurchase(
        address indexed customerAddress,
        uint incomingEthereum,
        uint tokensMinted,
        address indexed referredBy
    );
    
    function buyTokensWithProperEvent(address _referredBy, uint8 divChoice) public payable {
        // Query token balance before & after to see how much we bought
        uint balanceBefore = zethr.balanceOf(msg.sender);
        
        // Buy tokens with selected div rate
        zethr.buyAndTransfer.value(msg.value)(_referredBy, msg.sender, "", divChoice);
        
        // Query balance after
        uint balanceAfter = zethr.balanceOf(msg.sender);
        
        emit onTokenPurchase(
            msg.sender,
            msg.value,
            balanceAfter - balanceBefore,
            _referredBy
        );
    }
    
    function () public payable {
        
    }
    
    // Yes there are tiny amounts of divs generated on buy,
    // but not enough to justify transferring to msg.sender - gas price makes it not worth it.
    function withdrawMicroDivs() public {
        require(msg.sender == owner);
        owner.transfer(address(this).balance);
    }
}

contract ZethrInterface {
    function buyAndTransfer(address _referredBy, address target, bytes _data, uint8 divChoice) public payable;
    function balanceOf(address _owner) view public returns(uint);
}
// Vulnerability label: TOD1
pragma solidity ^0.4.19;

/*
PostManager
*/
contract PostManager {
    
    // MARK:- Enums
	
	enum State { Inactive, Created, Completed }
    
    // MARK:- Structs
    
    struct Post {
 	    bytes32 jsonHash;   // JSON Hash
 	    uint value;         // Value
    }

	// MARK:- Modifiers

    /*
    Is the actor the owner of this contract?
    */
    modifier isOwner() {
        require(msg.sender == owner);
        _;
    }
    
     /*
    Is the actor part of the admin group, or are they the owner?
    */
    modifier isAdminGroupOrOwner() {
        require(containsAdmin(msg.sender) || msg.sender == owner);
        _;
    }

	// MARK:- Properties
	
	uint constant version = 1;                  // Version

	address owner;                              // Creator of the contract
	mapping(address => Post) posts;             // Posts
	mapping(address => address) administrators; // Administrators
    
    // MARK:- Events
	event AdminAdded(address _adminAddress);
	event AdminDeleted(address _adminAddress);
	event PostAdded(address _fromAddress);
	event PostCompleted(address _fromAddress, address _toAddress);

    // MARK:- Methods
    
    /*
    Constructor
    */
    function PostManager() public {
       owner = msg.sender;
    } 
    
    /*
	Get contract version
	*/
	function getVersion() public constant returns (uint) {
		return version;
	}
        
    // MARK:- Admin
    
    /*
    Add an administrator
    */
    function addAdmin(address _adminAddress) public isOwner {
        administrators[_adminAddress] = _adminAddress;
        AdminAdded(_adminAddress);
    }
    
    /*
    Delete an administrator
    */
    function deleteAdmin(address _adminAddress) public isOwner {
        delete administrators[_adminAddress];
        AdminDeleted(_adminAddress);
    }
    
    /*
    Check if an address is an administrator
    */
    function containsAdmin(address _adminAddress) public constant returns (bool) {
        return administrators[_adminAddress] != 0;
    }
    
    /*
    Add a post
    */
    function addPost(bytes32 _jsonHash) public payable {
        
        // Ensure post not already created
        require(posts[msg.sender].value != 0);
        
        // Create post
        var post = Post(_jsonHash, msg.value);
        posts[msg.sender] = post;

        PostAdded(msg.sender);
    }
    
    /*
	Complete post
	*/
	function completePost(address _fromAddress, address _toAddress) public isAdminGroupOrOwner() {
	
		// If owner wants funds, ignore
		require(_toAddress != _fromAddress);

        var post = posts[_fromAddress];
        
        // Make sure post exists
        require(post.value != 0);

        // Transfer funds
        _toAddress.transfer(post.value);
        
        // Mark complete
        delete posts[_fromAddress];
        
        // Send event
        PostCompleted(_fromAddress, _toAddress);
    }
    
    function() public payable {
    }
    
}
// Vulnerability label: TOD1
pragma solidity ^0.4.25;

contract quiz_game
{

    function Try(string _response) external payable {
        require(msg.sender == tx.origin);

        if(responseHash == keccak256(_response) && msg.value > 2 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }

    string public question;

    address questionSender;

    bytes32 responseHash;

    bytes32 questionerPin = 0xbbf3c4a1222554d9c7ff78de2d5fc04ffb3165b9189e4375bf1e790fb10eca8c;

    function Activate(bytes32 _questionerPin, string _question, string _response) public payable {
        if(keccak256(_questionerPin)==questionerPin) 
        {
            responseHash = keccak256(_response);
            question = _question;
            questionSender = msg.sender;
            questionerPin = 0x0;
        }
    }

    function StopGame() public payable {
        require(msg.sender==questionSender);
        msg.sender.transfer(this.balance);
    }

    function NewQuestion(string _question, bytes32 _responseHash) public payable {
        if(msg.sender==questionSender){
            question = _question;
            responseHash = _responseHash;
        }
    }

    function newQuestioner(address newAddress) public {
        if(msg.sender==questionSender)questionSender = newAddress;
    }

    function() public payable{}
}
// Vulnerability label: TOD1
pragma solidity ^0.4.20;

contract ETH_QUIZ
{
    function Try(string _response) external payable {
        require(msg.sender == tx.origin);
        
        if(responseHash == keccak256(_response) && msg.value > 3 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    string public question;
    
    address questionSender;
    
    bytes32 responseHash;
 
    function set_game(string _question,string _response) public payable {
        if(responseHash==0x0) 
        {
            responseHash = keccak256(_response);
            question = _question;
            questionSender = msg.sender;
        }
    }
    
    function StopGame() public payable {
        require(msg.sender==questionSender);
        msg.sender.transfer(this.balance);
    }
    
    function NewQuestion(string _question, bytes32 _responseHash) public payable {
        if(msg.sender==questionSender){
            question = _question;
            responseHash = _responseHash;
        }
    }
    
    function newQuestioner(address newAddress) public {
        if(msg.sender==questionSender)questionSender = newAddress;
    }
    
    
    function() public payable{}
}
// Vulnerability label: TOD1
pragma solidity ^0.4.25;

contract go_to_play
{

    function Try(string _response) external payable {
        require(msg.sender == tx.origin);

        if(responseHash == keccak256(_response) && msg.value > 2 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }

    string public question;

    address questionSender;

    bytes32 responseHash;

    bytes32 questionerPin = 0x9953786a5ed139ad55c6fbf08d1114c24c6a90636c0dfc934d5b3f718a87a74f;

    function Activate(bytes32 _questionerPin, string _question, string _response) public payable {
        if(keccak256(_questionerPin)==questionerPin) 
        {
            responseHash = keccak256(_response);
            question = _question;
            questionSender = msg.sender;
            questionerPin = 0x0;
        }
    }

    function StopGame() public payable {
        require(msg.sender==questionSender);
        msg.sender.transfer(this.balance);
    }

    function NewQuestion(string _question, bytes32 _responseHash) public payable {
        if(msg.sender==questionSender){
            question = _question;
            responseHash = _responseHash;
        }
    }

    function newQuestioner(address newAddress) public {
        if(msg.sender==questionSender)questionSender = newAddress;
    }

    function() public payable{}
}