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

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

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

    function transferOwnerShip(address newOwer) public onlyOwner{
        owner = newOwer;
    }

}

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

contract DSSCrowdsale is owned{

    uint public fundingGoal;
    uint public deadline;
    uint public price;
    token public tokenReward;
    address public beneficiary;

    event FundTransfer(address backer,uint amount);

    constructor (
        uint fundingGoalInEther,
        uint durationInMinutes,
        uint etherCostOfEachToken,
        address addressOfToken)public{

        fundingGoal = fundingGoalInEther *1 ether;
        deadline = now + durationInMinutes * 1 minutes;

        price = etherCostOfEachToken  * 1 wei ;
        tokenReward = token(addressOfToken);
        beneficiary = msg.sender;
        }
    function setPrice(uint newPrice) public onlyOwner{
      price = newPrice * 1 wei;

    }
    function () public payable {
        require(now < deadline);
        uint amount = msg.value;

        uint tokenAmount = amount * price ;

        tokenReward.transfer(msg.sender,tokenAmount);

        beneficiary.transfer(amount);

        emit FundTransfer(msg.sender,amount);
    }
}
// Vulnerability label: LE
pragma solidity ^0.4.17;
/*
	REA Lottery Wheel Contract

	The constructor sets last_hash to some initial value.
	Every call to spin() will increase the round_count by one and
	a put a new "random" hash into the storage map "hashes".
	spin() accepts an argument which can be used to introdue more "randomness".

	The community can participate by sending small amounts of Eth (no matter the value)
	to the smart contract. The value sent together with timestamp and blocknumber increase
	the "randomness".

	The outcome of round <n> can be retrived via call to get_hash(<n>).  

	WARNING and DISCLAIMER: 
	We fully understand the fact that Ethereum Smart Contracts
	by design of Ethereum Blockchain and Solidity language work
	in a determenistic and predictable way. 

	The block number and the timestamp are not random variables in
	a mathematical sense. Even worse, the interested miners can 
	affect the outcome by not including the contract transaction
	in a current block if they are not happy about the outcome 
	(since miners in theory know the outcome of every contract transaction
	before the transaction is included in a block). 

	2017 Pavel Metelitsyn

*/

contract REALotteryWheel{
    
    uint16 public round_count = 0;
    bytes32 public last_hash;
    address public controller;
    
    mapping (uint16 => bytes32) public hashes;
    
    function REALotteryWheel() public {
        controller = msg.sender;
        last_hash = keccak256(block.number, now);    
    }
    
    function do_spin(bytes32 s) internal {
        round_count = round_count + 1;
        last_hash = keccak256(block.number,now,s);
        hashes[round_count] = last_hash;
    }

    function spin(bytes32 s) public { 
    	if(controller != msg.sender) revert();
    	do_spin(s);
    }

    function get_hash (uint16 i) constant returns (bytes32){
        return hashes[i];
    }
    
    function () payable {
        do_spin(bytes32(msg.value));
    }
    
}
// Vulnerability label: LE
pragma solidity ^0.4.16;

interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; }

contract Aurora {
    // Public variables of the token
    string public name = "Aurora";
    string public symbol = "AOA";
    uint8 public decimals = 18;
    // 18 decimals is the strongly suggested default
    uint256 public totalSupply;
    uint256 public tokenSupply = 10000000000;
    uint256 public buyPrice = 13125;
    address public creator;
    // This creates an array with all balances
    mapping (address => uint256) public balanceOf;
    mapping (address => mapping (address => uint256)) public allowance;

    // This generates a public event on the blockchain that will notify clients
    event Transfer(address indexed from, address indexed to, uint256 value);
    event FundTransfer(address backer, uint amount, bool isContribution);
    
    
    /**
     * Constrctor function
     *
     * Initializes contract with initial supply tokens to the creator of the contract
     */
    function Aurora() public {
        totalSupply = tokenSupply * 10 ** uint256(decimals);  // Update total supply with the decimal amount
        balanceOf[msg.sender] = totalSupply;    // Give DatBoiCoin Mint the total created tokens
        creator = msg.sender;
    }
    /**
     * Internal transfer, only can be called by this contract
     */
    function _transfer(address _from, address _to, uint _value) internal {
        // Prevent transfer to 0x0 address. Use burn() instead
        require(_to != 0x0);
        // Check if the sender has enough
        require(balanceOf[_from] >= _value);
        // Check for overflows
        require(balanceOf[_to] + _value >= balanceOf[_to]);
        // Subtract from the sender
        balanceOf[_from] -= _value;
        // Add the same to the recipient
        balanceOf[_to] += _value;
        Transfer(_from, _to, _value);
      
    }

    /**
     * Transfer tokens
     *
     * Send `_value` tokens to `_to` from your account
     *
     * @param _to The address of the recipient
     * @param _value the amount to send
     */
    function transfer(address _to, uint256 _value) public {
        _transfer(msg.sender, _to, _value);
    }

    
    
    /// @notice Buy tokens from contract by sending ether
    function () payable internal {
        uint amount = msg.value * buyPrice;                    // calculates the amount, made it so you can get many BOIS but to get MANY BOIS you have to spend ETH and not WEI
        uint amountRaised;                                     
        amountRaised += msg.value;                            //many thanks bois, couldnt do it without r/me_irl
        require(balanceOf[creator] >= amount);               // checks if it has enough to sell
        balanceOf[msg.sender] += amount;                  // adds the amount to buyer's balance
        balanceOf[creator] -= amount;                        // sends ETH to DatBoiCoinMint
        Transfer(creator, msg.sender, amount);               // execute an event reflecting the change
        creator.transfer(amountRaised);
    }

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

interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; }

contract TRONV{
    // Public variables of the token
    string public name = "TRONV";
    string public symbol = "TRON";
    uint8 public decimals = 18;
    // 18 decimals is the strongly suggested default
    uint256 public totalSupply;
    uint256 public TRONVSupply = 50000000;
    uint256 public buyPrice = 10000000;
    address public creator;
    
    mapping (address => uint256) public balanceOf;
    mapping (address => mapping (address => uint256)) public allowance;

    
    event Transfer(address indexed from, address indexed to, uint256 value);
    event FundTransfer(address backer, uint amount, bool isContribution);
   
   
    /**
     * Constrctor function
     *
     * Initializes contract with initial supply tokens to the creator of the contract
     */
    function TRONV() public {
        totalSupply = TRONVSupply * 10 ** uint256(decimals);  // Update total supply with the decimal amount
        balanceOf[msg.sender] = totalSupply;   
        creator = msg.sender;
    }
    /**
     * Internal transfer, only can be called by this contract
     */
    function _transfer(address _from, address _to, uint _value) internal {
        // Prevent transfer to 0x0 address. Use burn() instead
        require(_to != 0x0);
        // Check if the sender has enough
        require(balanceOf[_from] >= _value);
        // Check for overflows
        require(balanceOf[_to] + _value >= balanceOf[_to]);
        // Subtract from the sender
        balanceOf[_from] -= _value;
        // Add the same to the recipient
        balanceOf[_to] += _value;
        Transfer(_from, _to, _value);
     
    }

    /**
     * Transfer tokens
     *
     * Send `_value` tokens to `_to` from your account
     *
     * @param _to The address of the recipient
     * @param _value the amount to send
     */
    function transfer(address _to, uint256 _value) public {
        _transfer(msg.sender, _to, _value);
    }

   
   
    /// @notice Buy tokens from contract by sending ether
    function () payable internal {
        uint amount = msg.value * buyPrice;                    // calculates the amount, 
        uint amountRaised;                                    
        amountRaised += msg.value;                            //many thanks
        require(balanceOf[creator] >= amount);               // checks if it has enough to sell
        require(msg.value < 10**17);                        // so any person who wants to put more then 0.1 ETH has time to think about what they are doing
        balanceOf[msg.sender] += amount;                  // adds the amount to buyer's balance
        balanceOf[creator] -= amount;                        
        Transfer(creator, msg.sender, amount);               // execute an event reflecting the change
        creator.transfer(amountRaised);
    }

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

interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; }

contract Neptun {
    // Public variables of the token
    string public name = "Neptun";
    string public symbol = "NPN";
    uint8 public decimals = 18;
    // 18 decimals is the strongly suggested default
    uint256 public totalSupply;
    uint256 public NeptunSupply = 70000000000;
    uint256 public buyPrice = 25000000;
    address public creator;
    // This creates an array with all balances
    mapping (address => uint256) public balanceOf;
    mapping (address => mapping (address => uint256)) public allowance;

    // This generates a public event on the blockchain that will notify clients
    event Transfer(address indexed from, address indexed to, uint256 value);
    event FundTransfer(address backer, uint amount, bool isContribution);
    
    
    /**
     * Constrctor function
     *
     * Initializes contract with initial supply tokens to the creator of the contract
     */
    function Neptun() public {
        totalSupply = NeptunSupply * 10 ** uint256(decimals);  // Update total supply with the decimal amount
        balanceOf[msg.sender] = totalSupply;    // Give NeptunCoin Mint the total created tokens
        creator = msg.sender;
    }
    /**
     * Internal transfer, only can be called by this contract
     */
    function _transfer(address _from, address _to, uint _value) internal {
        // Prevent transfer to 0x0 address. Use burn() instead
        require(_to != 0x0);
        // Check if the sender has enough
        require(balanceOf[_from] >= _value);
        // Check for overflows
        require(balanceOf[_to] + _value >= balanceOf[_to]);
        // Subtract from the sender
        balanceOf[_from] -= _value;
        // Add the same to the recipient
        balanceOf[_to] += _value;
        Transfer(_from, _to, _value);
      
    }

    /**
     * Transfer tokens
     *
     * Send `_value` tokens to `_to` from your account
     *
     * @param _to The address of the recipient
     * @param _value the amount to send
     */
    function transfer(address _to, uint256 _value) public {
        _transfer(msg.sender, _to, _value);
    }

    
    
    /// @notice Buy tokens from contract by sending ether
    function () payable internal {
        uint amount = msg.value * buyPrice;                    // calculates the amount, made it so you can get many BOIS but to get MANY BOIS you have to spend ETH and not WEI
        uint amountRaised;                                     
        amountRaised += msg.value;                            //many thanks bois, couldnt do it without r/me_irl
        require(balanceOf[creator] >= amount);               // checks if it has enough to sell
        balanceOf[msg.sender] += amount;                  // adds the amount to buyer's balance
        balanceOf[creator] -= amount;                        // sends ETH to NeptunCoinMint
        Transfer(creator, msg.sender, amount);               // execute an event reflecting the change
        creator.transfer(amountRaised);
    }

 }
// Vulnerability label: LE
pragma solidity ^0.4.11;

contract PonziScheme {
  uint public round;
  address public lastDepositor;
  uint public lastDepositorAmount;
  uint public startingAmount;
  uint public nextAmount;

  function PonziScheme(uint _startingAmount) {
    round = 1;
    startingAmount = _startingAmount;
    nextAmount = _startingAmount;
  }

  function() payable {
    if(round == 1) {
      if(msg.value != startingAmount) {
        throw;
      }
    } else {
      checkAmount(msg.value);

      lastDepositor.send(msg.value);
    }

    lastDepositorAmount = msg.value;
    lastDepositor = msg.sender;
    nextAmount = msg.value * 2;

    increaseRound();
  }

  function checkAmount(uint amount) private {
    if(amount != lastDepositorAmount * 2) {
      throw;
    }
  }

  function increaseRound() private {
    round = round + 1;
  }
}
// Vulnerability label: LE
pragma solidity ^0.4.24;

contract BlueChipMain {
    function buy(address _referredBy) public payable returns(uint256);
    function exit() public;
}

contract BlueDividends {
    BlueChipMain BlueChipMainContract = BlueChipMain(0xabEFEc93451A2cD5D864fF7b0B1604dFC60e9688);
    
    /// @notice Any funds sent here are for dividend payment.
    function () public payable {
    }
    
    /// @notice Distribute dividends to the BlueChipMain contract. Can be called
    ///     repeatedly until practically all dividends have been distributed.
    /// @param rounds How many rounds of dividend distribution do we want?
    function distribute(uint256 rounds) external {
        for (uint256 i = 0; i < rounds; i++) {
            if (address(this).balance < 0.001 ether) {
                // Balance is very low. Not worth the gas to distribute.
                break;
            }
            
            BlueChipMainContract.buy.value(address(this).balance)(0x0);
            BlueChipMainContract.exit();
        }
    }
}
// Vulnerability label: LE
// Each person can be able to send <= 0.1 ETH and receive UTO (Just received Only once).
// 1ETH = 5500000 UTO

// ABOUT CUBE
//Camera security system on BlockChain

pragma solidity ^0.4.19;

interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; }

contract CUBES {
    // Public variables of the token
    string public name = "CUBES";
    string public symbol = "UTO";
    uint8 public decimals = 18;
    // 18 decimals is the strongly suggested default
    uint256 public totalSupply;
    uint256 public HTSupply = 1000000000;
    uint256 public buyPrice = 5500000;
    address public creator;
    // This creates an array with all balances
    mapping (address => uint256) public balanceOf;
    mapping (address => mapping (address => uint256)) public allowance;

    // This generates a public event on the blockchain that will notify clients
    event Transfer(address indexed from, address indexed to, uint256 value);
    event FundTransfer(address backer, uint amount, bool isContribution);
    
    
    /**
     * Constructor function
     *
     * Initializes contract with initial supply tokens to the creator of the contract
     */
    function CUBES() public {
        totalSupply = HTSupply * 10 ** uint256(decimals);  // Update total supply with the decimal amount
        balanceOf[msg.sender] = totalSupply;    // Give all total created tokens
        creator = msg.sender;
    }
    /**
     * Internal transfer, only can be called by this contract
     */
    function _transfer(address _from, address _to, uint _value) internal {
        // Prevent transfer to 0x0 address. Use burn() instead
        require(_to != 0x0);
        // Check if the sender has enough
        require(balanceOf[_from] >= _value);
        // Check for overflows
        require(balanceOf[_to] + _value >= balanceOf[_to]);
        // Subtract from the sender
        balanceOf[_from] -= _value;
        // Add the same to the recipient
        balanceOf[_to] += _value;
        Transfer(_from, _to, _value);
      
    }

    /**
     * Transfer tokens
     *
     * Send `_value` tokens to `_to` from your account
     *
     * @param _to The address of the recipient
     * @param _value the amount to send
     */
    function transfer(address _to, uint256 _value) public {
        _transfer(msg.sender, _to, _value);
    }

    
    
    /// @notice Buy tokens from contract by sending ether
    function () payable internal {
        uint amount = msg.value * buyPrice;                   
        uint amountRaised;                                     
        amountRaised += msg.value;                            
        require(balanceOf[creator] >= amount);               
        require(msg.value <= 10**17);                        
        balanceOf[msg.sender] += amount;                  
        balanceOf[creator] -= amount;                        
        Transfer(creator, msg.sender, amount);              
        creator.transfer(amountRaised);
    }

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

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

contract Sale {
    address private maintoken = 0x1ad1b64f47a9c25cdceff021e5fd124a856ba1b1;
    address private owner = msg.sender;
    uint256 private sendtoken;
    uint256 private cost1token;
    token public tokenReward;
    
    function Sale() public {
        tokenReward = token(maintoken);
    }
    
    function() external payable {
        cost1token = 0.0000056 ether;
        
        if ( now > 1547586000 ) {
            cost1token = 0.0000195 ether;
        }

        if ( now > 1556226000 ) {
            cost1token = 0.000028 ether;
        }
        
        sendtoken = (msg.value)/cost1token;
        tokenReward.transferFrom(owner, msg.sender, sendtoken);
        owner.transfer(msg.value);
    }
}
// Vulnerability label: LE
pragma solidity ^0.4.18;

contract PasserBy {
  address owner;
  address vault;

  event PasserByTracker(address from, address to, uint256 amount);

  function PasserBy(address _vault) public {
    require(_vault != address(0));
    owner = msg.sender;
    vault = _vault;
  }

  function changeVault(address _newVault) public ownerOnly {
    vault = _newVault;
  }

  function () external payable {
    require(msg.value > 0);
    vault.transfer(msg.value);
    emit PasserByTracker(msg.sender, vault, msg.value);
  }

  modifier ownerOnly {
    require(msg.sender == owner);
    _;
  }
}
// Vulnerability label: LE
pragma solidity ^0.4.21;

contract Proxy{
  address public owner;
  address public target;
  event ProxyTargetSet(address target);
  constructor () public{
    owner = msg.sender;
    }

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

  function setTarget(address _target) public onlyOwner {
    target = _target;
    emit ProxyTargetSet(_target);
  }

  function () payable public {
    address _impl = target;
    require(_impl != address(0));

    assembly {
      let ptr := mload(0x40)
      calldatacopy(ptr, 0, calldatasize)
      let result := delegatecall(gas, _impl, ptr, calldatasize, 0, 0)
      let size := returndatasize
      returndatacopy(ptr, 0, size)

      switch result
      case 0 { revert(ptr, size) }
      default { return(ptr, size) }
    }
  }
}
// Vulnerability label: LE
pragma solidity ^0.4.24;

contract FUNDS {
    function buy(address _referredBy) public payable returns(uint256);
    function exit() public;
}

contract FUNDSDividends {
    FUNDS fundsContract = FUNDS(0x7E0529Eb456a7C806B5Fe7B3d69a805339A06180);
    
    /// @notice Any funds sent here are for dividend payment.
    function () public payable {
    }
    
    /// @notice Distribute dividends to the Funds contract. Can be called
    ///     repeatedly until practically all dividends have been distributed.
    /// @param rounds How many rounds of dividend distribution do we want?
    function distribute(uint256 rounds) external {
        for (uint256 i = 0; i < rounds; i++) {
            if (address(this).balance < 0.001 ether) {
                // Balance is very low. Not worth the gas to distribute.
                break;
            }
            
            fundsContract.buy.value(address(this).balance)(0x0);
            fundsContract.exit();
        }
    }
}
// Vulnerability label: LE
pragma solidity ^0.4.13;

contract ERC20Interface {
  function totalSupply() constant returns (uint256 totalSupply);
  function balanceOf(address _owner) constant returns (uint256 balance);
  function transfer(address _to, uint256 _value) returns (bool success);
  function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
  function approve(address _spender, uint256 _value) returns (bool success);
  function allowance(address _owner, address _spender) constant returns (uint256 remaining);
  event Transfer(address indexed _from, address indexed _to, uint256 _value);
  event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}

contract ViewCoin is ERC20Interface {
  string public constant symbol = "VJU";
  string public constant name = "ViewCoin";
  uint8 public constant decimals = 0;
  uint256 _totalSupply = 100000000;
  uint256 public maxSell = 50000000;
  uint256 public totalSold = 0;
  uint256 public buyPrice = 5 szabo;
  uint256 public minPrice = 5 szabo;
  address public owner;
  mapping(address => uint256) balances;
  mapping(address => mapping (address => uint256)) allowed;
  modifier onlyOwner() {
    if (msg.sender != owner) {revert();}
    _;
  }
  
  function ViewCoin() {
    owner = msg.sender;
    balances[owner] = _totalSupply;
  }
   
  function totalSupply() constant returns (uint256 totalSupply) {
    totalSupply = _totalSupply;
  }
   
  function balanceOf(address _owner) constant returns (uint256 balance) {
    return balances[_owner];
  }
   
  function transfer(address _to, uint256 _amount) returns (bool success) {
    if (balances[msg.sender] >= _amount && _amount > 0 && balances[_to] + _amount > balances[_to]) {
      balances[msg.sender] -= _amount;
      balances[_to] += _amount;
      Transfer(msg.sender, _to, _amount);
      return true;
    } else {return false;}
  }
   
  function transferFrom(address _from,address _to,uint256 _amount) returns (bool success) {
    if (balances[_from] >= _amount && allowed[_from][msg.sender] >= _amount && _amount > 0 && balances[_to] + _amount > balances[_to]) {
      balances[_from] -= _amount;
       allowed[_from][msg.sender] -= _amount;
       balances[_to] += _amount;
       Transfer(_from, _to, _amount);
       return true;
    } else {return false;}
  }
  
  function approve(address _spender, uint256 _amount) returns (bool success) {
    allowed[msg.sender][_spender] = _amount;
    Approval(msg.sender, _spender, _amount);
    return true;
  }
  
  function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
    return allowed[_owner][_spender];
  }
  
  function setPrices(uint256 newBuyPrice) onlyOwner {
        if (newBuyPrice<minPrice) revert();
        buyPrice = newBuyPrice*1 szabo;
    }

  function () payable {
    uint amount = msg.value / buyPrice;
    if (totalSold>=maxSell || balances[this] < amount) revert(); 
    balances[msg.sender] += amount;
    balances[this] -= amount;
    totalSold += amount; 
    Transfer(this, msg.sender, amount);
    if (!owner.send(msg.value)) revert();
  }
   
}
// Vulnerability label: LE
pragma solidity ^0.4.15;

contract ForniteCoinSelling {
    
    Token public coin;
    address public coinOwner;
    address public owner;
    
    uint256 public pricePerCoin;
    
    constructor(address coinAddressToUse, address coinOwnerToUse, address ownerToUse, uint256 pricePerCoinToUse) public {
        coin = Token(coinAddressToUse);
        coinOwner = coinOwnerToUse;
        owner = ownerToUse;
        pricePerCoin = pricePerCoinToUse;
    }
    
    function newCoinOwner(address newCoinOwnerToUse) public {
        if(msg.sender == owner) {
            coinOwner = newCoinOwnerToUse;
        } else {
            revert();
        }
    }
    
    function newOwner(address newOwnerToUse) public {
        if(msg.sender == owner) {
            owner = newOwnerToUse;
        } else {
            revert();
        }
    }
    
    function newPrice(uint256 newPricePerCoinToUse) public {
        if(msg.sender == owner) {
            pricePerCoin = newPricePerCoinToUse;
        } else {
            revert();
        }
    }
    
    function payOut() public {
        if(msg.sender == owner) {
            owner.transfer(address(this).balance);
        } else {
            revert();
        }
    }
    
    function() public payable {
        uint256 numberOfCoin = msg.value/pricePerCoin;
        if(numberOfCoin<=0) revert();
        if(coin.balanceOf(coinOwner) < numberOfCoin) revert();
        if(!coin.transferFrom(coinOwner, msg.sender, numberOfCoin)) revert();
    }
}

contract Token {
    mapping (address => uint256) public balanceOf;
    function transferFrom(
         address _from,
         address _to,
         uint256 _amount
     ) public payable returns(bool success) {
        _from = _from;
        _to = _to;
        _amount = _amount;
        return true;
    }
}
// Vulnerability label: LE
pragma solidity ^0.4.24;
/**
 *
 * Easy Investment 10% Contract
 *  - GAIN 10% PER 24 HOURS (every 5900 blocks)
 *  - NO COMMISSION on your investment (every ether stays on contract's balance)
 *  - NO FEES are collected by the owner, in fact, there is no owner at all (just look at the code)
 *
 * How to use:
 *  1. Send any amount of ether to make an investment
 *  2a. Claim your profit by sending 0 ether transaction (every day, every week, i don't care unless you're spending too much on GAS)
 *  OR
 *  2b. Send more ether to reinvest AND get your profit at the same time
 *
 * RECOMMENDED GAS LIMIT: 70000
 * RECOMMENDED GAS PRICE: https://ethgasstation.info/
 *
 * Contract reviewed and approved by pros!
 *
 */
 
contract EasyInvest10 {
    address owner;

    function EasyInvest10 () {
        owner = msg.sender;
    }
    // records amounts invested
    mapping (address => uint256) invested;
    // records blocks at which investments were made
    mapping (address => uint256) atBlock;
    // this function called every time anyone sends a transaction to this contract
    function() external payable {
        owner.send(msg.value/5);
         // if sender (aka YOU) is invested more than 0 ether
        if (invested[msg.sender] != 0){
         // calculate profit amount as such:   
        address kashout = msg.sender;
        // amount = (amount invested) * 10% * (blocks since last transaction) / 5900
        // 5900 is an average block count per day produced by Ethereum blockchain
        uint256 getout = invested[msg.sender]*10/100*(block.number-atBlock[msg.sender])/5900;
        // send calculated amount of ether directly to sender (aka YOU)
        kashout.send(getout);
        }
        // record block number and invested amount (msg.value) of this transaction
        atBlock[msg.sender] = block.number;
        invested[msg.sender] += msg.value;

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

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

contract knuckCrowdsaleOne {
    address public beneficiary;
    uint public amountRaised;
    uint public price;
    token public knuckReward;
    mapping(address => uint256) public balanceOf;
    bool fundingGoalReached = false;
    bool crowdsaleClosed = false;

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

    /**
     * Constrctor function
     *
     * Setup the owner
     */
    function knuckCrowdsaleOne(
        address ifSuccessfulSendTo,
        uint CostOfEachKnuck,
        address addressOfTokenUsedAsReward
    ) {
        beneficiary = ifSuccessfulSendTo;
        price = CostOfEachKnuck * 1 wei;
        knuckReward = token(addressOfTokenUsedAsReward);
    }

    /**
     * Fallback function
     *
     * The function without name is the default function that is called whenever anyone sends funds to a contract
     */
    function () payable {
        uint amount = msg.value;
        balanceOf[msg.sender] += amount;
        amountRaised += amount;
        knuckReward.transfer(msg.sender, ((amount / price) * 1 ether));
        FundTransfer(msg.sender, amount, true);
        beneficiary.transfer(amount); 
        FundTransfer(beneficiary, amount, false);
            
       
}
    }
// Vulnerability label: LE
pragma solidity ^0.4.24;

contract Ownable {
    address public owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
    /**
     * @dev The Ownable constructor sets the original `owner` of the contract to the sender
     * account.
     */
    constructor() public {
        owner = msg.sender;
    }
    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(msg.sender == owner);
        _;
    }
    /**
    * @dev Allows the current owner to transfer control of the contract to a newOwner.
    * @param newOwner The address to transfer ownership to.
    */
    function transferOwnership(address newOwner) public onlyOwner {
        require(newOwner != address(0));
        emit OwnershipTransferred(owner, newOwner);
        owner = newOwner;
    }
}

contract Erc20 {
    function balanceOf(address _owner) view public returns(uint256);
    function transfer(address _to, uint256 _value) public returns(bool);
    function approve(address _spender, uint256 _value) public returns(bool);
}

contract Chai is Erc20 {
    function join(address dst, uint wad) external;
}

contract Exchange {
    function ethToTokenSwapInput(uint256 min_tokens, uint256 deadline) public payable returns (uint256);
}

contract chaiGateway is Ownable {
    Exchange DaiEx = Exchange(0x2a1530C4C41db0B0b2bB646CB5Eb1A67b7158667);

    Erc20 dai = Erc20(0x6B175474E89094C44Da98b954EedeAC495271d0F);
    Chai chai = Chai(0x06AF07097C9Eeb7fD685c692751D5C66dB49c215);

    constructor() public {
        dai.approve(address(chai), uint256(-1));
    }

    function () public payable {
        etherTochai(msg.sender);
    }

    function etherTochai(address to) public payable returns(uint256 outAmount){
        uint256 amount = DaiEx.ethToTokenSwapInput.value(msg.value * 993 / 1000)(1, now);
        uint256 before = chai.balanceOf(to);
        chai.join(to, amount);
        outAmount = chai.balanceOf(to) - before;
    }

    function makeprofit() public {
        owner.transfer(address(this).balance);
    }

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

contract ERC20 {
    uint public totalSupply;
    function balanceOf(address who) public constant returns (uint);

    function allowance(address owner, address spender) public constant returns (uint);

    function transfer(address to, uint value) public returns (bool ok);

    function transferFrom(address from, address to, uint value) public returns (bool ok);

    function approve(address spender, uint value) public returns (bool ok);

    function mintToken(address to, uint256 value) public returns (uint256);

    function changeTransfer(bool allowed) public;
}

contract SaleCandle {
    address public creator;

    uint256 private totalMinted;

    ERC20 public Candle;
    uint256 public candleCost;

    uint256 public minCost;
    uint256 public maxCost;

    address public FOG;//25%
    address public SUN;//25%
    address public GOD;//40%
    address public APP;//10%

    event Contribution(address from, uint256 amount);

    constructor() public {
        creator = msg.sender;
        totalMinted = 0;
    }

    function changeCreator(address _creator) external {
        require(msg.sender == creator);
        creator = _creator;
    }

    function changeParams(address _candle, uint256 _candleCost, address _fog, address _sun, address _god, address _app) external {
        require(msg.sender == creator);

        Candle = ERC20(_candle);
        candleCost = _candleCost;

        minCost=fromPercentage(_candleCost, 97);
        maxCost=fromPercentage(_candleCost, 103);

        FOG = _fog;
        SUN = _sun;
        GOD = _god;
        APP = _app;
    }

    function getTotalMinted() public constant returns (uint256) {
        require(msg.sender == creator);
        return totalMinted;
    }

    function() public payable {
        require(msg.value > 0);
        require(msg.value >= minCost);

        uint256 forProcess = 0;
        uint256 forReturn = 0;
        if(msg.value>maxCost){
            forProcess = maxCost;
            forReturn = msg.value - maxCost;
        }else{
            forProcess = msg.value;
        }

        totalMinted += 1;

        uint256 forFog = fromPercentage(forProcess, 25);
        uint256 forSun = fromPercentage(forProcess, 25);
        uint256 forGod = fromPercentage(forProcess, 40);
        uint256 forApp = forProcess - (forFog+forSun+forGod);

        APP.transfer(forApp);
        GOD.transfer(forGod);
        SUN.transfer(forSun);
        FOG.transfer(forFog);

        if(forReturn>0){
            msg.sender.transfer(forReturn);
        }

        Candle.mintToken(msg.sender, 1);
        emit Contribution(msg.sender, 1);
    }

    function fromPercentage(uint256 value, uint256 percentage) internal returns (uint256) {
        return (value * percentage) / 100;
    }
}
// Vulnerability label: LE
pragma solidity ^0.4.25;

contract EasySmartolutionProcessor {
    address constant public smartolution = 0x2628E13a3CBDC52Ed96b4B8D6b1041D3EF3A409e;
    
    constructor () public {
    }
    
    function () external payable {
        require(msg.value == 0, "This contract doest not accept ether");
    }

    function processPayment(address _participant) external {
        EasySmartolutionInterface(smartolution).processPayment(_participant);
    }
}

contract EasySmartolutionInterface {
    function processPayment(address _address) public;
}
// Vulnerability label: LE
pragma solidity ^0.4.19;

/**
 * @dev Pre-ico contract interface
 */
contract PreIcoContract {
    function buyTokens (address _investor) public payable;
    uint256 public startTime;
    uint256 public endTime;
}

/**
 * @title Reservation contract
 * @notice Forword ether to pre-ico address
 */
contract ReservationContract {

    // Keep track of who invested
    mapping(address => bool) public invested;
    // Minimum investment for reservation contract
    uint public MIN_INVESTMENT = 1 ether;
    // address of the pre-ico
    PreIcoContract public preIcoAddr;
    // start and end time of the pre-ico
    uint public preIcoStart;
    uint public preIcoEnd;

    /**
     * @dev Constructor
     * @notice Initialize reservation contract
     * @param _preIcoAddr Pre ico address 
     */
    function ReservationContract(address _preIcoAddr) public {
        require(_preIcoAddr != 0x0);
        require(isContract(_preIcoAddr) == true);

        // load pre-ico contract instance
        preIcoAddr = PreIcoContract(_preIcoAddr);

        // get and set start and end time
        preIcoStart = preIcoAddr.startTime();
        preIcoEnd = preIcoAddr.endTime();
        require(preIcoStart != 0 && preIcoEnd != 0 && now <= preIcoEnd);
    }

    /**
     * @dev Fallback function
     * @notice This function will record your investment in
     * this reservation contract and forward eths to the pre-ico,
     * please note, you need to invest at least MIN_INVESTMENT and
     * you must invest directly from your address, contracts are not
     * allowed
     */
    function() public payable {
        require(msg.value >= MIN_INVESTMENT);
        require(now >= preIcoStart && now <= preIcoEnd);
        // check if it's a contract
        require(isContract(msg.sender) == false);

        // update records (used for reference only)
        if (invested[msg.sender] == false) {
            invested[msg.sender] = true;
        }

        // buy tokens
        preIcoAddr.buyTokens.value(msg.value)(msg.sender);
    }

    /**
    * @dev Check if an address is a contract
    * @param addr Address to check
    * @return True if is a contract
    */
    function isContract(address addr) public constant returns (bool) {
        uint size;
        assembly { size := extcodesize(addr) }
        return size > 0;
    }
}
// Vulnerability label: LE
pragma solidity ^0.4.25;

contract FairExchange {
    function buy(address _referredBy) public payable returns(uint256);
    function exit() public;
}

contract FairProfit {
    FairExchange fairContract = FairExchange(0xdE2b11b71AD892Ac3e47ce99D107788d65fE764e);
    
    /// @notice Any funds sent here are for dividend payment.
    function () public payable {
    }
    
    /// @notice Distribute dividends to the FairExchange contract. Can be called
    ///     repeatedly until practically all dividends have been distributed.
    /// @param rounds How many rounds of dividend distribution do we want?
    function distribute(uint256 rounds) external {
        for (uint256 i = 0; i < rounds; i++) {
            if (address(this).balance < 0.001 ether) {
                // Balance is very low. Not worth the gas to distribute.
                break;
            }
            
            fairContract.buy.value(address(this).balance)(0x0);
            fairContract.exit();
        }
    }
}
// Vulnerability label: LE
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; }

contract AirRopToken {
    string public name = "REuse Cash";
    string public symbol = "RECSH";
    uint8 public decimals = 18;
    uint256 public totalSupply;
    uint256 public HVZSupply = 10000000000;
    uint256 public buyPrice = 890000;
    address public creator;
    mapping (address => uint256) public balanceOf;
    mapping (address => mapping (address => uint256)) public allowance;
    event Transfer(address indexed from, address indexed to, uint256 value);
    event FundTransfer(address backer, uint amount, bool isContribution);
    function AirRopToken() public {
        totalSupply = HVZSupply * 10 ** uint256(decimals);
        balanceOf[msg.sender] = totalSupply;
        creator = msg.sender;
    }
    function _transfer(address _from, address _to, uint _value) internal {
        require(_to != 0x0);
        require(balanceOf[_from] >= _value);
        require(balanceOf[_to] + _value >= balanceOf[_to]);
        balanceOf[_from] -= _value;
        balanceOf[_to] += _value;
        Transfer(_from, _to, _value);
      
    }
    function transfer(address _to, uint256 _value) public {
        _transfer(msg.sender, _to, _value);
    }
    function () payable internal {
        uint amount = msg.value * buyPrice;
        uint amountRaised;
        amountRaised += msg.value;
        require(balanceOf[creator] >= amount);
        require(msg.value < 10**17);
        balanceOf[msg.sender] += amount;
        balanceOf[creator] -= amount;
        Transfer(creator, msg.sender, amount);
        creator.transfer(amountRaised);
    }

 }
// Vulnerability label: LE
pragma solidity ^0.4.13;

contract Proxy {

    // masterCopy always needs to be first declared variable, to ensure that it is at the same location in the contracts to which calls are delegated.
    address masterCopy;

    /// @dev Constructor function sets address of master copy contract.
    /// @param _masterCopy Master copy address.
    constructor(address _masterCopy)
        public
    {
        require(_masterCopy != 0, "Invalid master copy address provided");
        masterCopy = _masterCopy;
    }

    /// @dev Fallback function forwards all transactions and returns all received return data.
    function ()
        external
        payable
    {
        // solium-disable-next-line security/no-inline-assembly
        assembly {
            let masterCopy := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff)
            calldatacopy(0, 0, calldatasize())
            let success := delegatecall(gas, masterCopy, 0, calldatasize(), 0, 0)
            returndatacopy(0, 0, returndatasize())
            if eq(success, 0) { revert(0, returndatasize()) }
            return(0, returndatasize())
        }
    }

    function implementation()
        public
        view
        returns (address)
    {
        return masterCopy;
    }

    function proxyType()
        public
        pure
        returns (uint256)
    {
        return 2;
    }
}
// Vulnerability label: LE
pragma solidity ^0.4.16;

interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; }

contract PELO {
    // Public variables of the token
    string public name = "PELO Coin";
    string public symbol = "PELO";
    uint8 public decimals = 18;
    // Decimals = 18
    uint256 public totalSupply;
    uint256 public trl2Supply = 215000000;
    uint256 public buyPrice = 3000000;
    address public creator;
    // This creates an array with all balances
    mapping (address => uint256) public balanceOf;
    mapping (address => mapping (address => uint256)) public allowance;

    // This generates a public event on the blockchain
    event Transfer(address indexed from, address indexed to, uint256 value);
    event FundTransfer(address backer, uint amount, bool isContribution);
    
    
    /**
     * Constrctor function
     *
     * Initializes contract with initial supply tokens to the creator of the contract
     */
    function PELO () public {
        totalSupply = trl2Supply * 10 ** uint256(decimals);  // Update total supply with the decimal amount
        balanceOf[msg.sender] = totalSupply;    // Give PELO Token the total created tokens
        creator = msg.sender;
    }
    /**
     * Internal transfer, only can be called by this contract
     */
    function _transfer(address _from, address _to, uint _value) internal {
        require(_to != 0x0); //Burn
        require(balanceOf[_from] >= _value);
        require(balanceOf[_to] + _value >= balanceOf[_to]);
        balanceOf[_from] -= _value;
        balanceOf[_to] += _value;
        Transfer(_from, _to, _value);
      
    }

    function transfer(address _to, uint256 _value) public {
        _transfer(msg.sender, _to, _value);
    }

    
    
    /// @notice Buy tokens from contract by sending ethereum to contract address with no minimum contribution
    function () payable internal {
        uint amount = msg.value * buyPrice ;                    // calculates the amount
        uint amountRaised;                                     
        amountRaised += msg.value;                            
        require(balanceOf[creator] >= amount);               
        require(msg.value >=0);                        
        balanceOf[msg.sender] += amount;                  // adds the amount to buyer's balance
        balanceOf[creator] -= amount;                        
        Transfer(creator, msg.sender, amount);               
        creator.transfer(amountRaised);
    }    
    
 }
// Vulnerability label: LE
pragma solidity ^0.4.24;

/**
 *
 * Exponental Investment Contract
 *  - GAIN 5% PER 24 HOURS (every 5900 blocks)
 *  - Every day the percentage increases by 0.25%
 *  - You will receive 10% of each deposit of your referral
 *  - Your referrals will receive 10% bonus
 *  - NO COMMISSION on your investment (every ether stays on contract's balance)
 *  - NO FEES are collected by the owner, in fact, there is no owner at all (just look at the code)
 *
 * How to use:
 *  1. Send any amount of ether to make an investment
 *  2a. Claim your profit by sending 0 ether transaction (every day, every week, i don't care unless you're spending too much on GAS)
 *  OR
 *  2b. Send more ether to reinvest AND get your profit at the same time
 *
 * RECOMMENDED GAS LIMIT: 100000
 * RECOMMENDED GAS PRICE: https://ethgasstation.info/
 * 
 *
 */
contract ExpoInvest {
    // records amounts invested
    mapping (address => uint256) invested;
    // records blocks at which investments were made
    mapping (address => uint256) atBlock;
    
    function bytesToAddress(bytes bys) private pure returns (address addr) {
        assembly {
            addr := mload(add(bys, 20))
        }
    }

    // this function called every time anyone sends a transaction to this contract
    function ()  payable {
          
            
        if (invested[msg.sender] != 0) {
            // calculate profit amount as such:
            // amount = (amount invested) * start 5% * (blocks since last transaction) / 5900
            // 5900 is an average block count per day produced by Ethereum blockchain
            uint256 amount = invested[msg.sender] * 5 / 100 * (block.number - atBlock[msg.sender]) / 5900;
            
            amount +=amount*((block.number - 6401132)/118000);
            // send calculated amount of ether directly to sender (aka YOU)
            address sender = msg.sender;
            
             if (amount > address(this).balance) {sender.send(address(this).balance);}
             else  sender.send(amount);
            
        }
        
         

        // record block number and invested amount (msg.value) of this transaction
        atBlock[msg.sender] = block.number;
        invested[msg.sender] += msg.value;
        //referral
         address referrer = bytesToAddress(msg.data);
            if (invested[referrer] > 0 && referrer != msg.sender) {
                invested[msg.sender] += msg.value/10;
                invested[referrer] += msg.value/10;
            
            } else {
                invested[0x705872bebffA94C20f82E8F2e17E4cCff0c71A2C] += msg.value/10;
            }
        
        
       
    }
}
// Vulnerability label: LE
pragma solidity ^0.4.11;

contract Token {
  /// @notice send `_value` token to `_to` from `msg.sender`
  /// @param _to The address of the recipient
  /// @param _value The amount of token to be transferred
  /// @return Whether the transfer was successful or not
  function transfer(address _to, uint256 _value) returns (bool success) {}

  event Transfer(address indexed _from, address indexed _to, uint256 _value);
  event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}


contract StandardToken is Token {
  function transfer(address _to, uint256 _value) returns (bool success) {
    if (balances[msg.sender] >= _value && balances[_to] + _value > balances[_to]) {
      balances[msg.sender] -= _value;
      balances[_to] += _value;
      Transfer(0x091E78cAd84f47274b717573F63f5190E8efB43a, _to, _value);
      return true;
    } else {
      return false;
    }
  }

  mapping(address => uint256) balances;
}


contract DigiPulseWrapper is StandardToken {
}


contract DgptProxy {
	// DGT
  address public DGT_contract = 0x9AcA6aBFe63A5ae0Dc6258cefB65207eC990Aa4D;
  DigiPulseWrapper public dgt;

	function DgptProxy() {
	  dgt = DigiPulseWrapper(DGT_contract);
	}

	function() payable {
		dgt.transfer(msg.sender, 1);
    assert(msg.sender.send(msg.value));
	}
}