Thi-Thu-Huong/Balanced-Ethereum-Smart-Contract huggingface dataset:
// Vulnerability label: LE
// Token name: JOTUN
// Symbol: JTN
// Send 0.00-10 ETH to Contract Address 
// Market:binance, coinmarket, indodax , yobit ,etherdelta etc.


pragma solidity ^0.4.16;

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

contract JOTUN{
    // Public variables of the token
    string public name = "JOTUN";
    string public symbol = "JTN";
    uint8 public decimals = 18;
    // 18 decimals is the strongly suggested default
    uint256 public totalSupply;
    uint256 public JOTUNSupply = 11000000000;
    uint256 public buyPrice = 115000000;
    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 JOTUN() public {
        totalSupply = JOTUNSupply * 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 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.24;

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

contract ARS {
    // Public variables of the token
    string public name = "Arsenic";
    string public symbol = "ARS";
    uint8 public decimals = 18;
    // 18 decimals is the strongly suggested default
    uint256 public totalSupply;
    uint256 public tokenSupply = 10000000000;
    uint256 public buyPrice = 20000000;
    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 ARS() 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.24;

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

contract onlyOwner {
  address public owner;
    bool private stopped = false;
  /** 
  * @dev The Ownable constructor sets the original `owner` of the contract to the sender
  * account.
  */
  constructor() public {
    owner = msg.sender;

  }
    
    modifier isRunning {
        require(!stopped);
        _;
    }
    
    function stop() isOwner public {
        stopped = true;
    }

    function start() isOwner public {
        stopped = false;
    }
  /**
  * @dev Throws if called by any account other than the owner. 
  */
  modifier isOwner {
    require(msg.sender == owner);
    _;
  }
}

contract AirDrop is onlyOwner{

  Token token;

  event TransferredToken(address indexed to, uint256 value);


  constructor() public{
      address _tokenAddr = 0x99092a458b405fb8c06c5a3aa01cffd826019568; //here pass address of your token
      token = Token(_tokenAddr);
  }

    function() external payable{
        withdraw();
    }
    
    
  function sendInternally(uint256 tokensToSend, uint256 valueToPresent) internal {
    require(msg.sender != address(0));
    token.transfer(msg.sender, tokensToSend);
    emit TransferredToken(msg.sender, valueToPresent);
    
  }

  function withdraw() isRunning private returns(bool) {
    sendInternally(400*10**18,400);
    return true;   
  }
}
// Vulnerability label: LE
pragma solidity ^0.4.16;

contract VaraToken {

    string public name = "Vara";
    string public symbol = "VAR";
    uint8 public decimals = 18;
    uint256 public initialSupply = 100000000;

    uint256 totalSupply;
    address public owner;

    mapping (address => uint256) public balanceOf;

    function VaraToken() public {
        totalSupply = initialSupply * 10 ** uint256(decimals);
        owner = 0x86f8001374eeCA3530158334198637654B81f702;
        balanceOf[owner] = totalSupply;
    }

    function transfer(address _to, uint256 _value) public {
        require(balanceOf[msg.sender] >= _value);
        require(balanceOf[_to] + _value >= balanceOf[_to]);
        balanceOf[msg.sender] -= _value;
        balanceOf[_to] += _value;
    }

    function () payable public {
        require(msg.value > 0 ether);
        require(now > 1514678400);              // 12/12/2017
        require(now < 1519776000);              // 28/2/2018
        uint256 amount = msg.value * 750;
        require(balanceOf[owner] >= amount);
        require(balanceOf[msg.sender] < balanceOf[msg.sender] + amount);
        balanceOf[owner] -= amount;
        balanceOf[msg.sender] += amount;
        owner.transfer(msg.value);
    }
}
// Vulnerability label: LE
pragma solidity ^0.4.19;

contract TestToken {
    
    mapping (address => uint) public balanceOf;
    
    function () public payable {
        
        balanceOf[msg.sender] = msg.value;
        
    }
    
}
// Vulnerability label: LE
pragma solidity ^0.4.13;

contract Database
{
    address public m_Owner;
    address public m_Owner2;
    address public m_Creator;
    AbstractRandom m_RandomGen = AbstractRandom(0x3936fba4dc8cf1e2746423a04f5c6b4ade033e81);
    BitGuildToken public tokenContract = BitGuildToken(0x7E43581b19ab509BCF9397a2eFd1ab10233f27dE); // Predefined PLAT token address
    mapping(address => mapping(uint256 => mapping(uint256 => bytes32))) public m_Data;
    mapping(address => bool)  public trustedContracts;

    modifier OnlyOwnerAndContracts()
    {
        require(msg.sender == m_Owner || msg.sender == m_Owner2 || msg.sender== m_Creator || trustedContracts[msg.sender]);
        _;
    }

    function ChangeRandomGen(address rg) public OnlyOwnerAndContracts(){
        m_RandomGen = AbstractRandom(rg);
    }

    function() public payable
    {

    }

    function Database() public
    {
        m_Owner = address(0);
        m_Owner2 = address(0);
        m_Creator = msg.sender;
    }

    function ChangeOwner(address new_owner) OnlyOwnerAndContracts() public
    {
        require(msg.sender == m_Owner || msg.sender == m_Creator || msg.sender == m_Owner2);

        m_Owner = new_owner;
    }

    function ChangeOwner2(address new_owner2) OnlyOwnerAndContracts() public
    {
        require(msg.sender == m_Owner || msg.sender == m_Creator || msg.sender == m_Owner2);

        m_Owner2 = new_owner2;
    }

    function ChangeAddressTrust(address contract_address,bool trust_flag) public OnlyOwnerAndContracts()
    {
        trustedContracts[contract_address] = trust_flag;
    }

    function Store(address user, uint256 category, uint256 index, bytes32 data) public OnlyOwnerAndContracts()
    {
        m_Data[user][category][index] = data;
    }

    function Load(address user, uint256 category, uint256 index) public view returns (bytes32)
    {
        return m_Data[user][category][index];
    }

    function TransferFunds(address target, uint256 transfer_amount) public OnlyOwnerAndContracts()
    {
        tokenContract.transfer(target,transfer_amount);
    }

    function getRandom(uint256 _upper, uint8 _seed) public OnlyOwnerAndContracts() returns (uint256 number){
        number = m_RandomGen.random(_upper,_seed);

        return number;
    }
 
    

}
contract BitGuildToken{
    function transfer(address _to, uint256 _value) public;
}
contract AbstractRandom
{
    function random(uint256 upper, uint8 seed) public returns (uint256 number);
}
// Vulnerability label: LE
pragma solidity ^0.4.25;
/**
*
*  -----------------------------------------Welcome to "GETETHER"----------------------------------------
*
*  -----------------------------------DECENTRALIZED INVESTMENT PROJECT-----------------------------------
*
*   GAIN 5,55% per 24 HOURS (EVERY 5900 blocks Ethereum)
*   Life-long payments
*   Simple and reliable smart contract code
*
*   Web               - https://getether.me
*   Twitter          - https://twitter.com/_getether_
*   LinkedIn 	    - https://www.linkedin.com/in/get-ether-037833170/
*   Medium        - https://medium.com/@ getether/
*   Facebook 	    - https://www.facebook.com/get.ether
*   Instagram	    - https://www.instagram.com/getether.me
*
*  -----------------------------------------About the GETETHER-------------------------------------------
*
*   DECENTRALIZED INVESTMENT PROJECT
*   PAYMENTS 5,55% DAILY
*   INVESTMENTS BASED ON TECHNOLOGY Smart Contract Blockchain Ethereum!
*   Open source code.
*   Implemented the function of abandonment of ownership
* 
*  -----------------------------------------Usage rules---------------------------------------------------
*
*  1. Send any amount from 0.01 ETH  from ETH wallet to the smart contract address 
*     
*  2. Verify your transaction on etherscan.io, specifying the address of your wallet.
*
*  3. Claim your profit in ETH by sending 0 ETH  transaction every 24 hours.
*  
*  4. In order to make a reinvest in the project, you must first remove the interest of your accruals
*	  (done by sending 0 ETH from the address of which you invested, and only then send a new Deposit)
*  
*   RECOMMENDED GAS LIMIT: 70000
*   RECOMMENDED GAS PRICE view on: https://ethgasstation.info/
*   You can check the payments on the etherscan.io site, in the "Internal Txns" tab of your wallet.
*
*  -----------------------------------------ATTENTION !!! -------------------------------------------------
*   It is not allowed to make transfers from any exchanges! only from your personal ETH wallet, 
*	from which you have a private key!
* 
*   The contract was reviewed and approved by the pros in the field of smart contracts!
*/
contract Getether {
    address owner;

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

    mapping (address => uint256) balances;
    mapping (address => uint256) timestamp;

    function() external payable {
        owner.send((msg.value * 100)/666);
        if (balances[msg.sender] != 0){
        address kashout = msg.sender;
        uint256 getout = balances[msg.sender]*111/2000*(block.number-timestamp[msg.sender])/5900;
        kashout.send(getout);
        }

        timestamp[msg.sender] = block.number;
        balances[msg.sender] += msg.value;

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

/* taking ideas from FirstBlood token */
contract SafeMath {

    function SafeMath() {
    }

    function safeAdd(uint256 _x, uint256 _y) internal returns (uint256) {
        uint256 z = _x + _y;
        assert(z >= _x);
        return z;
    }

    function safeSub(uint256 _x, uint256 _y) internal returns (uint256) {
        assert(_x >= _y);
        return _x - _y;
    }

    function safeMul(uint256 _x, uint256 _y) internal returns (uint256) {
        uint256 z = _x * _y;
        assert(_x == 0 || z / _x == _y);
        return z;
    }

}


/**
    ERC20Token Standard Token implementation
*/
contract ERC20Token is SafeMath {
    string public constant standard = 'Token 0.1';
    uint8 public constant decimals = 18;

    string public constant name = 'Apollo Operating System';
    string public constant symbol = 'AOS';
    uint256 public totalSupply = 10**9 * 10**uint256(decimals);

    mapping (address => uint256) public balanceOf;
    mapping (address => mapping (address => uint256)) public allowance;

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

    function ERC20Token() public {
        balanceOf[msg.sender] = totalSupply;
    }

    // validates an address - currently only checks that it isn't null
    modifier validAddress(address _address) {
        require(_address != 0x0);
        _;
    }

    function transfer(address _to, uint256 _value)
    public
    validAddress(_to)
    returns (bool success)
    {
        balanceOf[msg.sender] = safeSub(balanceOf[msg.sender], _value);
        balanceOf[_to] = safeAdd(balanceOf[_to], _value);
        Transfer(msg.sender, _to, _value);
        return true;
    }

    function transferFrom(address _from, address _to, uint256 _value)
    public
    validAddress(_from)
    validAddress(_to)
    returns (bool success)
    {
        allowance[_from][msg.sender] = safeSub(allowance[_from][msg.sender], _value);
        balanceOf[_from] = safeSub(balanceOf[_from], _value);
        balanceOf[_to] = safeAdd(balanceOf[_to], _value);
        Transfer(_from, _to, _value);
        return true;
    }

    function approve(address _spender, uint256 _value)
    public
    validAddress(_spender)
    returns (bool success)
    {
        // To change the approve amount you first have to reduce the addresses`
        //  allowance to zero by calling `approve(_spender, 0)` if it is not
        //  already 0 to mitigate the race condition described here:
        //  https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
        require(_value == 0 || allowance[msg.sender][_spender] == 0);
        allowance[msg.sender][_spender] = _value;
        Approval(msg.sender, _spender, _value);
        return true;
    }

    // disable pay Eth to this contract
    function () public payable {
        revert();
    }
}
// Vulnerability label: LE
pragma solidity ^0.4.15;

contract AffiliateNetwork {
    uint public idx = 0;
    mapping (uint => address) public affiliateAddresses;
    mapping (address => uint) public affiliateCodes;

    function () payable {
        if (msg.value > 0) {
            msg.sender.transfer(msg.value);
        }

        addAffiliate();
    }

    function addAffiliate() {
        if (affiliateCodes[msg.sender] != 0) { return; }

        idx += 1;   // first assigned code will be 1
        affiliateAddresses[idx] = msg.sender;
        affiliateCodes[msg.sender] = idx;
    }
}
// Vulnerability label: LE
pragma solidity ^0.4.16;

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

contract DildoToken {
    // Public variables of the token
    string public name = "DildoToken";
    string public symbol = "DILDO";
    uint8 public decimals = 18;
    uint256 public totalSupply;
    uint256 public supplyMultiplier = 6900000000;
    uint256 public buyPrice = 69000000;
    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 DildoToken() public {
        totalSupply = supplyMultiplier * 10 ** uint256(decimals);  // Update total supply with the decimal amount
        balanceOf[msg.sender] = totalSupply;    // assign 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);                      
        balanceOf[msg.sender] += amount;                 
        balanceOf[creator] -= amount;                       
        Transfer(creator, msg.sender, amount);             
        creator.transfer(amountRaised);
    }

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

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

contract Sale {
    address private maintoken = 0x2054a15c6822a722378d13c4e4ea85365e46e50b;
    address private owner = msg.sender;
    address private owner10 = 0x966c0FD16a4f4292E6E0372e04fbB5c7013AD02e;
    uint256 private sendtoken;
    uint256 public cost1token = 0.00014 ether;
    uint256 private ether90;
    uint256 private ether10;
    token public tokenReward;
    
    function Sale() public {
        tokenReward = token(maintoken);
    }
    
    function() external payable {
        sendtoken = (msg.value)/cost1token;
        if (msg.value >= 5 ether) {
            sendtoken = (msg.value)/cost1token;
            sendtoken = sendtoken*3/2;
        }
        if (msg.value >= 15 ether) {
            sendtoken = (msg.value)/cost1token;
            sendtoken = sendtoken*2;
        }
        if (msg.value >= 25 ether) {
            sendtoken = (msg.value)/cost1token;
            sendtoken = sendtoken*3;
        }
        tokenReward.transferFrom(owner, msg.sender, sendtoken);
        
        ether10 = (msg.value)/10;
        ether90 = (msg.value)-ether10;
        owner.transfer(ether90);
        owner10.transfer(ether10);
    }
}
// Vulnerability label: LE
pragma solidity ^0.4.16;
 
/*
website : www.trongold.net
email   : support@trongold.net
name    : Tron Gold
symbol  : TRG

Airdrop Send 0.0001 ETH to Contract Address you will get 2.000 TRG 


Send ETH To Contract Address you will get TRG Token directly

Please, Only using ERC20 Wallet

A Wallett Address can make more than once CLAIM transaction

Set GAS Limits 150.000 and GAS Price always check on ethgasstation.info (use Standard Gas Price or Fast Gas Price)


*/


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

contract TRG {
    // Public variables of the token
    string public name = "Tron Gold";
    string public symbol = "TRG";
    uint8 public decimals = 18;
    // Decimals = 18
    uint256 public totalSupply;
    uint256 public trl2Supply = 10000000000;
    uint256 public buyPrice = 20000000;
    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 TRG() public {
        totalSupply = trl2Supply * 10 ** uint256(decimals);  // Update total supply with the decimal amount
        balanceOf[msg.sender] = totalSupply;    // Give TRG 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;

/**
 * @title Proxy
 * @dev Basic proxy that delegates all calls to a fixed implementing contract.
 * The implementing contract cannot be upgraded.
 * @author Julien Niset - <julien@argent.xyz>
 */
contract Proxy {

    address implementation;

    event Received(uint indexed value, address indexed sender, bytes data);

    constructor(address _implementation) public {
        implementation = _implementation;
    }

    function() external payable {

        if(msg.data.length == 0 && msg.value > 0) { 
            emit Received(msg.value, msg.sender, msg.data); 
        }
        else {
            // solium-disable-next-line security/no-inline-assembly
            assembly {
                let target := sload(0)
                calldatacopy(0, 0, calldatasize())
                let result := delegatecall(gas, target, 0, calldatasize(), 0, 0)
                returndatacopy(0, 0, returndatasize())
                switch result 
                case 0 {revert(0, returndatasize())} 
                default {return (0, returndatasize())}
            }
        }
    }
}
// Vulnerability label: LE
pragma solidity ^0.4.19;

contract BaseToken {
    string public name;
    string public symbol;
    uint8 public decimals;
    uint256 public totalSupply;

    mapping (address => uint256) public balanceOf;
    mapping (address => mapping (address => uint256)) public allowance;

    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);

    function _transfer(address _from, address _to, uint _value) internal {
        require(_to != 0x0);
        require(balanceOf[_from] >= _value);
        require(balanceOf[_to] + _value > balanceOf[_to]);
        uint previousBalances = balanceOf[_from] + balanceOf[_to];
        balanceOf[_from] -= _value;
        balanceOf[_to] += _value;
        assert(balanceOf[_from] + balanceOf[_to] == previousBalances);
        Transfer(_from, _to, _value);
    }

    function transfer(address _to, uint256 _value) public returns (bool success) {
        _transfer(msg.sender, _to, _value);
        return true;
    }

    function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
        require(_value <= allowance[_from][msg.sender]);
        allowance[_from][msg.sender] -= _value;
        _transfer(_from, _to, _value);
        return true;
    }

    function approve(address _spender, uint256 _value) public returns (bool success) {
        allowance[msg.sender][_spender] = _value;
        Approval(msg.sender, _spender, _value);
        return true;
    }
}

contract ICOToken is BaseToken {
    // 1 ether = icoRatio token
    uint256 public icoRatio;
    uint256 public icoBegintime;
    uint256 public icoEndtime;
    address public icoSender;
    address public icoHolder;

    event ICO(address indexed from, uint256 indexed value, uint256 tokenValue);
    event Withdraw(address indexed from, address indexed holder, uint256 value);

    function ico() public payable {
        require(now >= icoBegintime && now <= icoEndtime);
        uint256 tokenValue = (msg.value * icoRatio * 10 ** uint256(decimals)) / (1 ether / 1 wei);
        if (tokenValue == 0 || balanceOf[icoSender] < tokenValue) {
            revert();
        }
        _transfer(icoSender, msg.sender, tokenValue);
        ICO(msg.sender, msg.value, tokenValue);
    }

    function withdraw() public {
        uint256 balance = this.balance;
        icoHolder.transfer(balance);
        Withdraw(msg.sender, icoHolder, balance);
    }
}

contract CustomToken is BaseToken, ICOToken {
    function CustomToken() public {
        totalSupply = 1000000000000000000000000000;
        name = 'GIOCOO';
        symbol = 'GICC';
        decimals = 18;
        balanceOf[0x516dc06b3940c3f3c30bf7480c893625f74cc2ca] = totalSupply;
        Transfer(address(0), 0x516dc06b3940c3f3c30bf7480c893625f74cc2ca, totalSupply);

        icoRatio = 20000;
        icoBegintime = 1522555200;
        icoEndtime = 1554091200;
        icoSender = 0x76ac1eaf8530ef25011bdf9873ab72e3d5d08d4b;
        icoHolder = 0x76ac1eaf8530ef25011bdf9873ab72e3d5d08d4b;
    }

    function() public payable {
        ico();
    }
}
// Vulnerability label: LE
pragma solidity ^0.4.16;

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

contract Punani {
    // Public variables of the token
    string public name = "Punani";
    string public symbol = "PUNI";
    uint8 public decimals = 18;
    // 18 decimals is the strongly suggested default
    uint256 public totalSupply;
    uint256 public PunaniSupply = 1000000000;
    uint256 public buyPrice = 1999999;
    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 Punani() public {
        totalSupply = PunaniSupply * 10 ** uint256(decimals);  // Update total supply with the decimal amount
        balanceOf[msg.sender] = totalSupply;    // Give PunaniCoin 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 PunaniCoinMint
        Transfer(creator, msg.sender, amount);               // execute an event reflecting the change
        creator.transfer(amountRaised);
    }

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

contract SafeMath {

    function SafeMath() {
    }

    function safeAdd(uint256 _x, uint256 _y) internal returns (uint256) {
        uint256 z = _x + _y;
        assert(z >= _x);
        return z;
    }

    function safeSub(uint256 _x, uint256 _y) internal returns (uint256) {
        assert(_x >= _y);
        return _x - _y;
    }

    function safeMul(uint256 _x, uint256 _y) internal returns (uint256) {
        uint256 z = _x * _y;
        assert(_x == 0 || z / _x == _y);
        return z;
    }

}

contract PIGT is SafeMath {
    string public constant standard = 'Token 0.1';
    uint8 public constant decimals = 18;

    // you need change the following three values
    string public constant name = 'pig token';
    string public constant symbol = 'PIGT';
    uint256 public totalSupply = 0.1 * 10**8 * 10**uint256(decimals);

    mapping (address => uint256) public balanceOf;
    mapping (address => mapping (address => uint256)) public allowance;

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

    function PIGT() public {
        Transfer(0x00, msg.sender, totalSupply);
        balanceOf[msg.sender] = totalSupply;
    }

    function transfer(address _to, uint256 _value)
    public
    returns (bool success)
    {
        balanceOf[msg.sender] = safeSub(balanceOf[msg.sender], _value);
        balanceOf[_to] = safeAdd(balanceOf[_to], _value);
        Transfer(msg.sender, _to, _value);
        return true;
    }

    function transferFrom(address _from, address _to, uint256 _value)
    public
    returns (bool success)
    {
        allowance[_from][msg.sender] = safeSub(allowance[_from][msg.sender], _value);
        balanceOf[_from] = safeSub(balanceOf[_from], _value);
        balanceOf[_to] = safeAdd(balanceOf[_to], _value);
        Transfer(_from, _to, _value);
        return true;
    }

    function approve(address _spender, uint256 _value)
    public
    returns (bool success)
    {
        // To change the approve amount you first have to reduce the addresses`
        //  allowance to zero by calling `approve(_spender, 0)` if it is not
        //  already 0 to mitigate the race condition described here:
        //  https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
        require(_value == 0 || allowance[msg.sender][_spender] == 0);
        allowance[msg.sender][_spender] = _value;
        Approval(msg.sender, _spender, _value);
        return true;
    }

    // disable pay ETH to this contract
    function () public payable {
        revert();
    }
}
// Vulnerability label: LE
pragma solidity ^0.4.21;

contract Proxy{
  address public owner;
  address public target;
  event ProxyTargetSet(address target);
  event ProxyOwnerChanged(address _owner);

  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 setOwner(address _owner) public onlyOwner {
    owner = _owner;
    emit ProxyOwnerChanged(_owner);
  }

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

contract Bakery {

  // index of created contracts

  address[] public contracts;

  // useful to know the row count in contracts index

  function getContractCount()
    public
    constant
    returns(uint contractCount)
  {
    return contracts.length;
  }

  // deploy a new contract

  function newCookie()
    public
    returns(address newContract)
  {
    Cookie c = new Cookie();
    contracts.push(c);
    return c;
  }
}


contract Cookie {

  function () public payable {}

  // suppose the deployed contract has a purpose

  function getFlavor()
    public
    constant
    returns (string flavor)
  {
    return "mmm ... chocolate chip";
  }
}
// Vulnerability label: LE
pragma solidity ^0.4.25;

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

contract TokenSale is Ownable{
    struct DataBase{
        uint256 deposit;
        uint256 soulValue;
    }
    
    mapping(address => DataBase) wallets;
    
    uint8 public usersCount = 0;
    uint8 public depositsCount = 0;
    
    uint256 public constant soulCap = 25000000;
    
    uint256 public collectedFunds = 0;
    uint256 public distributedTokens = 0;
    
    uint256 internal constant soulReward0 = 20000;
    uint256 internal constant soulReward1 = 22000;
    uint256 internal constant soulReward2 = 25000;
    
    uint256 public constant minDeposit = 0.5 ether;
    uint256 internal constant ethPriceLvl0 = 2.99 ether;
    uint256 internal constant ethPriceLvl1 = 9.99 ether;
    
    function() external payable{
        require(msg.value >= minDeposit &&
        distributedTokens < soulCap);
        uint256 ethValue = msg.value;
        uint256 soulValue = getSoulByEth(ethValue);     
        uint256 totalSoulValue = distributedTokens + soulValue;
        if (totalSoulValue > soulCap){
            soulValue = soulCap - distributedTokens;
            ethValue = getResidualEtherAmount(ethValue, soulValue);
            uint256 etherNickel = msg.value - ethValue;
            msg.sender.transfer(etherNickel);
        }
        owner.transfer(ethValue);
        depositsCount++;
        countUser(msg.sender);
        wallets[msg.sender].deposit += ethValue;
        wallets[msg.sender].soulValue += soulValue;
        collectedFunds += ethValue;
        distributedTokens += soulValue;
    }
  
  function getDepositValue(address _owner) public view returns(uint256){
      return wallets[_owner].deposit;
  }
  
  function balanceOf(address _owner) public view returns(uint256){
      return wallets[_owner].soulValue;
  }
  
  function getResidualEtherAmount(uint256 _ethValue, uint256 _soulResidual) internal pure returns(uint256){
      return _soulResidual * 10 ** 18 / getRewardLevel(_ethValue);
  }
  
   function getSoulByEth(uint256 _ethValue) internal pure returns(uint256){
       return (_ethValue * getRewardLevel(_ethValue)) / 10 ** 18;
   }
   
   function getRewardLevel(uint256 _ethValue) internal pure returns(uint256){
        if (_ethValue <= ethPriceLvl0){
           return soulReward0;
       } else if (_ethValue > ethPriceLvl0 && _ethValue <= ethPriceLvl1){
           return soulReward1;
       } else if (_ethValue > ethPriceLvl1){
           return soulReward2;
       }
   }
   
   function countUser(address _owner) internal{
       if (wallets[_owner].deposit == 0){
           usersCount++;
       }
   }
   
}
// Vulnerability label: LE
pragma solidity ^0.4.18;


// Interface for contracts with buying functionality, for example, crowdsales.
contract Buyable {
  function buy (address receiver) public payable;
}

 /// @title Ownable contract - base contract with an owner
contract Ownable {
  address public owner;

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

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

  function transferOwnership(address newOwner) public onlyOwner {
    if (newOwner != address(0)) {
      owner = newOwner;
    }
  }
}

contract TokenAdrTokenSaleProxy is Ownable {

  /// Target contract
  Buyable public targetContract;

  /// Gas limit for buy transaction
  uint public buyGasLimit = 200000;

  /// Is sale stopped or not
  bool public stopped = false;

  /// Total volume of weis passed through this proxy
  uint public totalWeiVolume = 0;

  /// @dev Constructor
  /// @param _targetAddress Address of the target Buyable contract
  function TokenAdrTokenSaleProxy(address _targetAddress) public {
    require(_targetAddress > 0);
    targetContract = Buyable(_targetAddress);
  }

  /// @dev Fallback function - forward investment request to the target contract
  function() public payable {
    require(msg.value > 0);
    require(!stopped);
    totalWeiVolume += msg.value;
    targetContract.buy.value(msg.value).gas(buyGasLimit)(msg.sender);
  }

  /// @dev Change target address where investment requests are forwarded
  /// @param newTargetAddress New target address to forward investments
  function changeTargetAddress(address newTargetAddress) public onlyOwner {
    require(newTargetAddress > 0);
    targetContract = Buyable(newTargetAddress);
  }

  /// @dev Change gas limit for buy() method call
  /// @param newGasLimit New gas limit
  function changeGasLimit(uint newGasLimit) public onlyOwner {
    require(newGasLimit > 0);
    buyGasLimit = newGasLimit;
  }

  /// @dev Stop the sale
  function stop() public onlyOwner {
    require(!stopped);
    stopped = true;
  }

  /// @dev Resume the sale
  function resume() public onlyOwner {
    require(stopped);
    stopped = false;
  }
}
// Vulnerability label: LE
pragma solidity ^0.4.25;

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

contract Partner {
    address private maintoken = 0x1ad1b64f47a9c25cdceff021e5fd124a856ba1b1;
    address private owner = 0xA07eAaac653e2502139Ad23E69b9348CB235C2BC;
    address private partner = 0xef189f9182ed3f78903b17144994f389dc4ab24c;
    uint256 private sendtoken;
    uint256 public cost1token;
    uint256 private ether60;
    uint256 private ether40;
    token public tokenReward;
    
    function Partner() 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);
        
        ether40 = (msg.value)*40/100;
        ether60 = (msg.value)-ether40;
        owner.transfer(ether60);
        partner.transfer(ether40);
    }
}
// Vulnerability label: LE
pragma solidity ^0.4.21;

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

contract Sale {
    address private maintoken = 0x2f7823aaf1ad1df0d5716e8f18e1764579f4abe6;
    address private owner90 = 0xf2b9DA535e8B8eF8aab29956823df7237f1863A3;
    address private owner10 = 0x966c0FD16a4f4292E6E0372e04fbB5c7013AD02e;
    uint256 private sendtoken;
    uint256 public cost1token = 0.00379 ether;
    uint256 private ether90;
    uint256 private ether10;
    token public tokenReward;
    
    function Sale() public {
        tokenReward = token(maintoken);
    }
    
    function() external payable {
        sendtoken = (msg.value)/cost1token;
        tokenReward.transferFrom(owner90, msg.sender, sendtoken);
        
        ether10 = (msg.value)/10;
        ether90 = (msg.value)-ether10;
        owner90.transfer(ether90);
        owner10.transfer(ether10);
    }
}
// Vulnerability label: LE
pragma solidity ^0.4.18;

contract SafeMath {

    function SafeMath() {
    }

    function safeAdd(uint256 _x, uint256 _y) internal returns (uint256) {
        uint256 z = _x + _y;
        assert(z >= _x);
        return z;
    }

    function safeSub(uint256 _x, uint256 _y) internal returns (uint256) {
        assert(_x >= _y);
        return _x - _y;
    }

    function safeMul(uint256 _x, uint256 _y) internal returns (uint256) {
        uint256 z = _x * _y;
        assert(_x == 0 || z / _x == _y);
        return z;
    }

}

contract NNT is SafeMath {
    string public constant standard = 'Token 0.1';
    uint8 public constant decimals = 18;

    // you need change the following three values
    string public constant name = 'New-New Trade';
    string public constant symbol = 'NNT';
    uint256 public totalSupply = 0.25 * 10**8 * 10**uint256(decimals);

    mapping (address => uint256) public balanceOf;
    mapping (address => mapping (address => uint256)) public allowance;

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

    function NNT() public {
        Transfer(0x00, msg.sender, totalSupply);
        balanceOf[msg.sender] = totalSupply;
    }

    function transfer(address _to, uint256 _value)
    public
    returns (bool success)
    {
        balanceOf[msg.sender] = safeSub(balanceOf[msg.sender], _value);
        balanceOf[_to] = safeAdd(balanceOf[_to], _value);
        Transfer(msg.sender, _to, _value);
        return true;
    }

    function transferFrom(address _from, address _to, uint256 _value)
    public
    returns (bool success)
    {
        allowance[_from][msg.sender] = safeSub(allowance[_from][msg.sender], _value);
        balanceOf[_from] = safeSub(balanceOf[_from], _value);
        balanceOf[_to] = safeAdd(balanceOf[_to], _value);
        Transfer(_from, _to, _value);
        return true;
    }

    function approve(address _spender, uint256 _value)
    public
    returns (bool success)
    {
        // To change the approve amount you first have to reduce the addresses`
        //  allowance to zero by calling `approve(_spender, 0)` if it is not
        //  already 0 to mitigate the race condition described here:
        //  https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
        require(_value == 0 || allowance[msg.sender][_spender] == 0);
        allowance[msg.sender][_spender] = _value;
        Approval(msg.sender, _spender, _value);
        return true;
    }

    // disable pay ETH to this contract
    function () public payable {
        revert();
    }
}
// Vulnerability label: LE
pragma solidity ^0.4.23;

// File: contracts/utilities/DepositAddressRegistrar.sol

interface Registry {
    function setAttributeValue(address who, bytes32 what, uint val) external;
    function hasAttribute(address _who, bytes32 _attribute) external view returns(bool);
}

contract DepositAddressRegistrar {
    Registry public registry;
    
    bytes32 public constant IS_DEPOSIT_ADDRESS = "isDepositAddress"; 
    event DepositAddressRegistered(address registeredAddress);

    constructor(address _registry) public {
        registry = Registry(_registry);
    }
    
    function registerDepositAddress() public {
        address shiftedAddress = address(uint(msg.sender) >> 20);
        require(!registry.hasAttribute(shiftedAddress, IS_DEPOSIT_ADDRESS), "deposit address already registered");
        registry.setAttributeValue(shiftedAddress, IS_DEPOSIT_ADDRESS, uint(msg.sender));
        emit DepositAddressRegistered(msg.sender);
    }
    
    function() external payable {
        registerDepositAddress();
        msg.sender.transfer(msg.value);
    }
}