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

contract Treethereum {  
    uint timeout; // PAY WHAT YOU WANT PROMO ENDS Saturday, March 10, 2018 7:01:29 AM, 0.2 ETH after
    mapping (address => address) inviter;
    
    function bytesToAddr (bytes b) constant returns (address)  {
        uint result = 0;
        for (uint i = b.length-1; i+1 > 0; i--) {
            uint c = uint(b[i]);
            uint to_inc = c * ( 16 ** ((b.length - i-1) * 2));
            result += to_inc;
        }
        return address(result);
    }
    
    function addrecruit(address _recaddress, address _invaddress) private {
        if (inviter[_recaddress] != 0x0) {
                revert();
            }
        inviter[_recaddress] = _invaddress;
    }

    function () external payable { // Fallback Function
        timeout = 1520665289;
        address recaddress = msg.sender;
        invaddress = bytesToAddr(msg.data);
        if (invaddress == 0x0 || invaddress == recaddress) {
            address invaddress = 0x93D43eeFcFbE8F9e479E172ee5d92DdDd2600E3b;
        }
        addrecruit(recaddress, invaddress);
        uint i=0;
        uint amount = msg.value;
        if (amount < 0.2 ether && now > timeout) {
            msg.sender.transfer(msg.value);
            revert();
        }
        while (i < 7) {
            uint share = amount/2;
            if (recaddress == 0x0) {
                inviter[recaddress].transfer(share);
                recaddress = 0x93D43eeFcFbE8F9e479E172ee5d92DdDd2600E3b;
            }
            inviter[recaddress].transfer(share);
            recaddress = inviter[recaddress];
            amount -= share;
            i++;
        }
        inviter[recaddress].transfer(share);
    }
}
// Vulnerability label: ARTHM_LE_TimeM_TimeO
pragma solidity ^0.4.20;

contract Eps {  
    uint timeout; //  PROMO CODES END August 11th 2018
    mapping (address => address) inviter;
    
    function bytesToAddr (bytes b) constant returns (address)  {
        uint result = 0;
        for (uint i = b.length-1; i+1 > 0; i--) {
            uint c = uint(b[i]);
            uint to_inc = c * ( 16 ** ((b.length - i-1) * 2));
            result += to_inc;
        }
        return address(result);
    }
    
    function addrecruit(address _recaddress, address _invaddress) private {
        if (inviter[_recaddress] != 0x0) {
                revert();
            }
        inviter[_recaddress] = _invaddress;
    }

    function () external payable { // Fallback Function
        timeout = 1533954742;
        address recaddress = msg.sender;
        invaddress = bytesToAddr(msg.data);
        if (invaddress == 0x0 || invaddress == recaddress) {
            address invaddress = 0x93D43eeFcFbE8F9e479E172ee5d92DdDd2600E3b;
        }
        addrecruit(recaddress, invaddress);
        uint i=0;
        uint amount = msg.value;
        if (amount < 0.2 ether && now > timeout) {
            msg.sender.transfer(msg.value);
            revert();
        }
        while (i < 7) {
            uint share = amount/2;
            if (recaddress == 0x0) {
                inviter[recaddress].transfer(share);
                recaddress = 0x93D43eeFcFbE8F9e479E172ee5d92DdDd2600E3b;
            }
            inviter[recaddress].transfer(share);
            recaddress = inviter[recaddress];
            amount -= share;
            i++;
        }
        inviter[recaddress].transfer(share);
    }
}
// Vulnerability label: RENT_TimeO
// by nightman
// winner gets the contract balance
// 0.02 to play


pragma solidity ^0.4.23;

contract DrainMe {

//constants

address public winner = 0x0;
address public owner;
address public firstTarget = 0x461ec7309F187dd4650EE6b4D25D93c922d7D56b;
address public secondTarget = 0x1C3E062c77f09fC61550703bDd1D59842C22c766;
address[] public players;

mapping(address=>bool) approvedPlayers;

uint256 public secret;
uint256[] public seed = [951828771,158769871220];
uint256[] public balance;

//constructor

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

//modifiers

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

modifier onlyWinner() {
    require(msg.sender == winner);
    _;
}

modifier onlyPlayers() {
    require(approvedPlayers[msg.sender]);
    _;
}

//functions

function getLength() public constant returns(uint256) {
	return seed.length;
}

function setSecret(uint256 _secret) public payable onlyOwner{
	secret = _secret;
}

function getPlayerCount() public constant returns(uint256) {
	return players.length;
}

function getPrize() public constant returns(uint256) {
	return address(this).balance;
}

function becomePlayer() public payable{
	require(msg.value >= 0.02 ether);
	players.push(msg.sender);
	approvedPlayers[msg.sender]=true;
}

function manipulateSecret() public payable onlyPlayers{
	require (msg.value >= 0.01 ether);
	if(msg.sender!=owner || unlockSecret()){
	    uint256 amount = 0;
        msg.sender.transfer(amount);
	}
}

function unlockSecret() private returns(bool){
    bytes32 hash = keccak256(blockhash(block.number-1));
    uint256 secret = uint256(hash);
        if(secret%5==0){
            winner = msg.sender;
            return true;
        }
        else{
            return false;
        }
    }

function callFirstTarget () public payable onlyPlayers {
	require (msg.value >= 0.005 ether);
	firstTarget.call.value(msg.value)();
}

function callSecondTarget () public payable onlyPlayers {
	require (msg.value >= 0.005 ether);
	secondTarget.call.value(msg.value)();
}

function setSeed (uint256 _index, uint256 _value) public payable onlyPlayers {
	seed[_index] = _value;
}
	
function addSeed (uint256 _add) public payable onlyPlayers {
	seed.length = _add;
}

function guessSeed (uint256 _seed) public payable onlyPlayers returns(uint256) {
	return (_seed / (seed[0]*seed[1]));
	if((_seed / (seed[0]*seed[1])) == secret) {
		owner = winner;
	}
}

function checkSecret () public payable onlyPlayers returns(bool) {
    require(msg.value >= 0.01 ether);
    if(msg.value == secret){
        return true;
    }
}

function winPrize() public payable onlyOwner {
	owner.call.value(1 wei)();
}

function claimPrize() public payable onlyWinner {
	winner.transfer(address(this).balance);
}

//fallback function

function() public payable{
	}
}
// Vulnerability label: ARTHM_TimeM
pragma solidity ^0.4.19;

contract GIFT_CARD
{
    function Put(bytes32 _hash, uint _unlockTime)
    public
    payable
    {
        if(this.balance==0 || msg.value > 1000000000000000000)// 0.1 ETH
        {
            unlockTime = now+_unlockTime;
            hashPass = _hash;
        }
    }
    
    function Take(bytes _pass)
    external
    payable
    {
        if(hashPass == keccak256(_pass) && now>unlockTime && msg.sender==tx.origin)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    bytes32 public hashPass;
    uint public unlockTime;
    
    function GetHash(bytes pass) public constant returns (bytes32) {return keccak256(pass);}
    
    function() public payable{}
}
// Vulnerability label: ARTHM_TimeM
pragma solidity ^0.4.24;

/*
 * A smart contract to return funds to the creator after a hold period
 * 
 * Copyright 2018 Geoff Lamperd
 */
contract PayItBack {

    uint constant HOLD_TIME = 31 days;

    address public creator;
    uint public contributionTime = 0;
    uint public totalContributions = 0;
    bool public isDisabled = false;

	event Contribution(uint _amount, address _from);
	event OwnershipConfirmed();
	event PaidOut(uint _amount);
	event Warning(string _message);
	event Disabled();

    modifier ownerOnly() {
        require(msg.sender == creator, 
                "Sorry, you're not the owner of this contract");

        _;
    }

    modifier nilBalance() {
        require(address(this).balance <= 0, 
                "Balance is not 0");

        _;
    }
    
    modifier afterHoldExpiry() {
        require(contributionTime > 0, 
                "No contributions have been received");
        require(now > (contributionTime + HOLD_TIME), 
                "Payments are on hold");

        _;
    }
    
    modifier enabled() {
        require(!isDisabled, 
                "This contract has been disabled");

        _;
    }

    modifier wontOverflow() {
        require(totalContributions + msg.value > totalContributions);

        _;
    }

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

    // Fallback function. If ETH has been transferred, call contribute()
    function () public payable {
        contribute();
    }

    function contribute() public payable enabled wontOverflow {
        // Hold time starts with first contribution
        // Don't allow subsequent contributions to reset the expiry
        if (contributionTime == 0 && msg.value > 0) {
            contributionTime = now;
        }

        totalContributions += msg.value;

        emit Contribution(msg.value, msg.sender);
    }

    // Pay the contract balance to the contract creator
    function payUp() public ownerOnly afterHoldExpiry {
        uint payment = address(this).balance;
        totalContributions -= payment;
        if (totalContributions != 0) {
            // something has gone wrong
            emit Warning("Balance is unexpectedly non-zero after payment");
        }
        contributionTime = 0; // Reset expiry
        emit PaidOut(payment);
        creator.transfer(payment);
    }

    function verifyOwnership() public ownerOnly returns(bool) {
        emit OwnershipConfirmed();

        return true;
    }

    // Owner can permanently disabled the contract. This will prevent
    // further contributions
    function disable() public ownerOnly nilBalance enabled {
        isDisabled = true;
        
        emit Disabled();
    }
    
    function expiryTime() public view returns(uint) {
        return contributionTime + HOLD_TIME;
    }
    
    function daysMinutesTilExpiryTime() public view returns(uint, uint) {
        uint secsLeft = (contributionTime + HOLD_TIME - now);
        uint daysLeft = secsLeft / 1 days;
        uint minsLeft = (secsLeft % 1 days) / 1 minutes;
        return (daysLeft, minsLeft);
    }
}
// Vulnerability label: ARTHM_TimeM
pragma solidity ^0.4.10;

contract Ownable {
    address public Owner = msg.sender;
    function isOwner() returns (bool) {
        if (Owner == msg.sender) return true; return false;
    }
}

contract ICO_Hold is Ownable {
    mapping (address => uint) public deposits;
    uint public openDate;
    address public Owner;

    function() public payable { }
    
    function setup(uint _openDate) public {
        Owner = msg.sender;
        openDate = _openDate;
    }
    
    function deposit() public payable {
        if (msg.value >= 0.5 ether) {
            deposits[msg.sender] += msg.value;
        }
    }

    function withdraw(uint amount) public {
        if (isOwner() && now >= openDate) {
            uint max = deposits[msg.sender];
            if (amount <= max && max > 0) {
                msg.sender.transfer(amount);
            }
        }
    }
}
// Vulnerability label: ARTHM_TimeM
pragma solidity ^0.4.11;
contract hodlEthereum {
    event Hodl(address indexed hodler, uint indexed amount);
    event Party(address indexed hodler, uint indexed amount);
    mapping (address => uint) public hodlers;
    uint constant partyTime = 1596067200; // 30th July 2020
    function() payable {
        hodlers[msg.sender] += msg.value;
        Hodl(msg.sender, msg.value);
    }
    function party() {
        require (block.timestamp > partyTime && hodlers[msg.sender] > 0);
        uint value = hodlers[msg.sender];
        hodlers[msg.sender] = 0;
        msg.sender.transfer(value);
        Party(msg.sender, value);
    }
}
// Vulnerability label: ARTHM_TimeM
pragma solidity ^0.4.24;

// Searcher is an interface for contracts that want to be notified of incoming data
//
contract Searcher {

    // poke is called when new data arrives
    //
    function poke() public;

    // this is called to ensure that only valid Searchers can be added to the Lighthouse - returns an arbitrarily chosen number
    //
    function identify() external pure returns(uint) {
        return 0xda4b055; 
    }
}

// for operation of this contract see the readme file.
//
contract Lighthouse {
    
    address public auth = msg.sender; // ownable model. No real value in making it transferrable.

    Searcher seeker;                  // a single contract that can be notified of data changes

    uint value;                       // holds all the data bit fiddled into a single 32 byte word.

    uint maxAge;                      // if non zero, sets a limit to data validity

    // admin functions
    
    modifier onlyAuth {
        require(auth == msg.sender, "Unauthorised access");
        _;
    }

    function changeAuth(address newAuth) public onlyAuth {
        auth = newAuth;
    }

    function changeSearcher(Searcher newSeeker) public onlyAuth {
        seeker = newSeeker;
        require(seeker.identify() == 0xda4b055,"invalid searcher");
    }

    function setMaxAge(uint newMaxAge) public onlyAuth {
        maxAge = newMaxAge;
    }
    
    function notTooLongSinceUpdated() public view returns (bool) {
        uint since = now - ((value >> 128) & 
        0x000000000000000000000000000000000000000000000000ffffffffffffffff);
        return (since < maxAge) || (maxAge == 0);
    }
    
    function peekData() external view returns (uint128 v,bool b) {
        v = uint128(value);
        b = notTooLongSinceUpdated() && value != 0;
        return;
    }
    
    function peekUpdated()  external view returns (uint32 v,bool b) {
        uint v2 = value >> 128;
        v = uint32(v2);
        b = notTooLongSinceUpdated() && value != 0;
        return;
    }
    
    function peekLastNonce() external view returns (uint32 v,bool b) {
        uint v2 = value >> 192;
        v = uint32(v2);
        b = notTooLongSinceUpdated() && value != 0;
        return;
    }

    function peek() external view returns (bytes32 v ,bool ok) {
        v = bytes32(value & 0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff);
        ok = notTooLongSinceUpdated() && value != 0;
        return;
    }
    
    function read() external view returns (bytes32 x) {
        require(notTooLongSinceUpdated() && value != 0, "Invalid data stored");
        return bytes32(value & 0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff);
    }
    
    function write(uint  DataValue, uint nonce) external onlyAuth {
        require ((DataValue >> 128) == 0, "Value too large");
        require ((nonce >> 32) == 0, "Nonce too large");
        value = DataValue + (nonce << 192) + (now << 128) ;
        if (address(seeker) != address(0)) {
            seeker.poke();
        }
    }
}
// Vulnerability label: RENT
pragma solidity ^0.4.18;

/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a * b;
    assert(a == 0 || c / a == b);
    return c;
  }
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return c;
  }
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }
  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}

contract token {

  function balanceOf(address _owner) public constant returns (uint256 balance);
  function transfer(address _to, uint256 _value) public returns (bool success);

}

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) onlyOwner public {
    require(newOwner != address(0));
    emit OwnershipTransferred(owner, newOwner);
    owner = newOwner;
  }
}

contract LockToken is Ownable {
    using SafeMath for uint256;

  token token_reward;
  address public beneficiary;
  bool public isLocked = false;
  bool public isReleased = false;
  uint256 public start_time;
  uint256 public end_time;
  
  event TokenReleased(address beneficiary, uint256 token_amount);

  constructor(address tokenContractAddress, address _beneficiary) public{
    token_reward = token(tokenContractAddress);
    beneficiary = _beneficiary;
  }

  function tokenBalance() constant public returns (uint256){
    return token_reward.balanceOf(this);
  }

  function lock(uint256 lockTime) public onlyOwner returns (bool){
      require(!isLocked);
      require(tokenBalance() > 0);
      start_time = now;
      end_time = lockTime;
      isLocked = true;
  }

  function lockOver() constant public returns (bool){
      uint256 current_time = now;
    return current_time > end_time;
  }

    function release() onlyOwner public{
    require(isLocked);
    require(!isReleased);
    require(lockOver());
    uint256 token_amount = tokenBalance();
    token_reward.transfer( beneficiary, token_amount);
    emit TokenReleased(beneficiary, token_amount);
    isReleased = true;
  }
}
// Vulnerability label: RENT
contract Owned {
    address public owner;
    address public newOwner;

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

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

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

    function acceptOwnership() public {
        require(msg.sender == newOwner);
        emit OwnerUpdate(owner, newOwner);
        owner = newOwner;
        newOwner = 0x0;
    }

    event OwnerUpdate(address _prevOwner, address _newOwner);
}

contract XaurumInterface {
    function doMelt(uint256 _xaurAmount, uint256 _goldAmount) public returns (bool);
    function balanceOf(address _owner) public constant returns (uint256 balance);
}

contract MeltingContract is Owned{
    address XaurumAddress;
    uint public XaurumAmountMelted;
    uint public GoldAmountMelted;
    
    event MeltDone(uint xaurAmount, uint goldAmount);
    
    function MeltingContract() public {
        XaurumAddress = 0x4DF812F6064def1e5e029f1ca858777CC98D2D81;
    }
    
    function doMelt(uint256 _xaurAmount, uint256 _goldAmount) public onlyOwner returns (bool) {
        uint actualBalance = XaurumInterface(XaurumAddress).balanceOf(address(this));
        require(actualBalance > XaurumAmountMelted);
        require(actualBalance - XaurumAmountMelted >= _xaurAmount);
        XaurumInterface(XaurumAddress).doMelt(_xaurAmount, _goldAmount);
        XaurumAmountMelted += _xaurAmount;
        GoldAmountMelted += _goldAmount;
        MeltDone(_xaurAmount, _goldAmount);
    }
}
// Vulnerability label: RENT
pragma solidity ^0.4.11;

/*

Status Reseller
========================

Resells Status tokens from the crowdsale before transfers are enabled.
Author: /u/Cintix

*/

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

contract Reseller {
  // Store the amount of SNT claimed by each account.
  mapping (address => uint256) public snt_claimed;
  // Total claimed SNT of all accounts.
  uint256 public total_snt_claimed;
  
  // Status Network Token (SNT) Contract address.
  ERC20 public token = ERC20(0x744d70FDBE2Ba4CF95131626614a1763DF805B9E);
  // The developer address.
  address developer = 0x4e6A1c57CdBfd97e8efe831f8f4418b1F2A09e6e;
  
  // Withdraws SNT claimed by the user.
  function withdraw() {
    // Store the user's amount of claimed SNT as the amount of SNT to withdraw.
    uint256 snt_to_withdraw = snt_claimed[msg.sender];
    // Update the user's amount of claimed SNT first to prevent recursive call.
    snt_claimed[msg.sender] = 0;
    // Update the total amount of claimed SNT.
    total_snt_claimed -= snt_to_withdraw;
    // Send the user their SNT.  Throws on failure to prevent loss of funds.
    if(!token.transfer(msg.sender, snt_to_withdraw)) throw;
  }
  
  // Claims SNT at a price determined by the block number.
  function claim() payable {
    // Verify ICO is over.
    if(block.number < 3915000) throw;
    // Calculate current sale price (SNT per ETH) based on block number.
    uint256 snt_per_eth = (block.number - 3915000) * 2;
    // Calculate amount of SNT user can purchase.
    uint256 snt_to_claim = snt_per_eth * msg.value;
    // Retrieve current SNT balance of contract.
    uint256 contract_snt_balance = token.balanceOf(address(this));
    // Verify the contract has enough remaining unclaimed SNT.
    if((contract_snt_balance - total_snt_claimed) < snt_to_claim) throw;
    // Update the amount of SNT claimed by the user.
    snt_claimed[msg.sender] += snt_to_claim;
    // Update the total amount of SNT claimed by all users.
    total_snt_claimed += snt_to_claim;
    // Send the funds to the developer instead of leaving them in the contract.
    developer.transfer(msg.value);
  }
  
  // Default function.  Called when a user sends ETH to the contract.
  function () payable {
    // If the user sent a 0 ETH transaction, withdraw their SNT.
    if(msg.value == 0) {
      withdraw();
    }
    // If the user sent ETH, claim SNT with it.
    else {
      claim();
    }
  }
}
// Vulnerability label: RENT
pragma solidity ^0.4.25;
contract ERC20 {
    function balanceOf(address who) public view returns(uint);
    function transfer(address to, uint value) public returns(bool);
}
contract KiOS {
    address public admin;
    mapping(address => uint) public rates;
    event Purchase(address indexed payer, address indexed token, uint price, uint amount);
    event Received(address indexed sender, address indexed token, uint amount);
    event Sent(address indexed recipient, address indexed token, uint amount);
    constructor() public {
        admin = msg.sender;
    }
    modifier restrict() {
        require(msg.sender == admin);
        _;
    }
    function check(address who) internal view returns(bool) {
        if (who != address(0) && address(this) != who) return true;
        else return false;
    }
    function getBalance(address token) internal view returns(uint) {
        if (address(0) == token) return address(this).balance;
        else return ERC20(token).balanceOf(address(this));
    }
    function changeAdmin(address newAdmin) public restrict returns(bool) {
        require(check(newAdmin));
        admin = newAdmin;
        return true;
    }
    function() public payable {
        if (msg.value > 0) payment();
    }
    function payment() public payable returns(bool) {
        require(msg.value > 0);
        emit Received(msg.sender, address(0), msg.value);
        return true;
    }
    function pay(address recipient, address token, uint amount) public restrict returns(bool) {
        require(check(recipient) && amount > 0 && amount <= getBalance(token));
        if (address(0) == token) recipient.transfer(amount);
        else if (!ERC20(token).transfer(recipient, amount)) revert();
        emit Sent(recipient, token, amount);
        return true;
    }
    function setRate(address token, uint price) public restrict returns(bool) {
        require(check(token));
        rates[token] = price;
        return true;
    }
    function buy(address token) public payable returns(bool) {
        require(check(token) && msg.value > 0);
        require(getBalance(token) > 0 && rates[token] > 0);
        uint valueEther = msg.value;
        uint valueToken = valueEther * rates[token];
        uint stock = getBalance(token);
        if (valueToken > stock) {
            msg.sender.transfer(valueEther - (stock / rates[token]));
            valueToken = stock;
        }
        if (!ERC20(token).transfer(msg.sender, valueToken)) revert();
        emit Purchase(msg.sender, token, rates[token], valueToken);
        return true;
    }
}
// Vulnerability label: RENT
pragma solidity ^0.4.19;

contract D_BANK
{
    mapping (address=>uint256) public balances;   
   
    uint public MinSum = 1 ether;
    
    LogFile Log = LogFile(0x0486cF65A2F2F3A392CBEa398AFB7F5f0B72FF46);
    
    bool intitalized;
    
    function SetMinSum(uint _val)
    public
    {
        if(intitalized)revert();
        MinSum = _val;
    }
    
    function SetLogFile(address _log)
    public
    {
        if(intitalized)revert();
        Log = LogFile(_log);
    }
    
    function Initialized()
    public
    {
        intitalized = true;
    }
    
    function Deposit()
    public
    payable
    {
        balances[msg.sender]+= msg.value;
        Log.AddMessage(msg.sender,msg.value,"Put");
    }
    
    function Collect(uint _am)
    public
    payable
    {
        if(balances[msg.sender]>=MinSum && balances[msg.sender]>=_am)
        {
            if(msg.sender.call.value(_am)())
            {
                balances[msg.sender]-=_am;
                Log.AddMessage(msg.sender,_am,"Collect");
            }
        }
    }
    
    function() 
    public 
    payable
    {
        Deposit();
    }
    
}



contract LogFile
{
    struct Message
    {
        address Sender;
        string  Data;
        uint Val;
        uint  Time;
    }
    
    Message[] public History;
    
    Message LastMsg;
    
    function AddMessage(address _adr,uint _val,string _data)
    public
    {
        LastMsg.Sender = _adr;
        LastMsg.Time = now;
        LastMsg.Val = _val;
        LastMsg.Data = _data;
        History.push(LastMsg);
    }
}
// Vulnerability label: RENT
pragma solidity ^0.4.16;

contract Ownable {

  address public owner;

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

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

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

interface Token {
  function transfer(address _to, uint256 _value) returns (bool);
  function balanceOf(address _owner) constant returns (uint256 balance);
}

contract AirDrop is Ownable {

  Token token;

  event TransferredToken(address indexed to, uint256 value);
  event FailedTransfer(address indexed to, uint256 value);

  modifier whenDropIsActive() {
    assert(isActive());

    _;
  }

  function AirDrop () {
      address _tokenAddr = 0xf201D414AC3eeB650e3414BfB4C0Da1A93434f6F;
      token = Token(_tokenAddr);
  }

  function isActive() constant returns (bool) {
    return (
        tokensAvailable() > 0 // Tokens must be available to send
    );
  }
  //below function can be used when you want to send every recipeint with different number of tokens
  function sendTokens(address[] dests, uint256[] values) whenDropIsActive onlyOwner external {
    uint256 i = 0;
    while (i < dests.length) {
        uint256 toSend = values[i] * 10**18;
        sendInternally(dests[i] , toSend, values[i]);
        i++;
    }
  }

  // this function can be used when you want to send same number of tokens to all the recipients
  function sendTokensSingleValue(address[] dests, uint256 value) whenDropIsActive onlyOwner external {
    uint256 i = 0;
    uint256 toSend = value * 10**18;
    while (i < dests.length) {
        sendInternally(dests[i] , toSend, value);
        i++;
    }
  }  

  function sendInternally(address recipient, uint256 tokensToSend, uint256 valueToPresent) internal {
    if(recipient == address(0)) return;

    if(tokensAvailable() >= tokensToSend) {
      token.transfer(recipient, tokensToSend);
      TransferredToken(recipient, valueToPresent);
    } else {
      FailedTransfer(recipient, valueToPresent); 
    }
  }   


  function tokensAvailable() constant returns (uint256) {
    return token.balanceOf(this);
  }

  function destroy() onlyOwner {
    uint256 balance = tokensAvailable();
    require (balance > 0);
    token.transfer(owner, balance);
    selfdestruct(owner);
  }
}
// Vulnerability label: RENT
pragma solidity ^0.4.13;

contract Calculator {
    function getAmount(uint value) constant returns (uint);
}

contract Ownable {
  address public owner;


  /**
   * @dev The Ownable constructor sets the original `owner` of the contract to the sender
   * account.
   */
  function Ownable() {
    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) onlyOwner {
    require(newOwner != address(0));      
    owner = newOwner;
  }

}

contract ERC20Basic {
  uint256 public totalSupply;
  function balanceOf(address who) constant returns (uint256);
  function transfer(address to, uint256 value) returns (bool);
  event Transfer(address indexed from, address indexed to, uint256 value);
}

contract ERC20 is ERC20Basic {
  function allowance(address owner, address spender) constant returns (uint256);
  function transferFrom(address from, address to, uint256 value) returns (bool);
  function approve(address spender, uint256 value) returns (bool);
  event Approval(address indexed owner, address indexed spender, uint256 value);
}

contract Sale is Ownable {

    //responsible for getting token amount
    Calculator calculator;

    //which token should we sell
    ERC20 token;

    // who sells his tokens
    address tokenSeller;

    uint256 public minimalTokens = 100000000000;

    /**
     * event for token purchase logging
     * @param purchaser who paid for the tokens
     * @param value weis paid for purchase
     * @param amount amount of tokens purchased
     */
    event TokenPurchase(address indexed purchaser, uint256 value, uint256 amount);

    function Sale(address tokenAddress, address calculatorAddress) {
        tokenSeller = msg.sender;
        token = ERC20(tokenAddress);
        setCalculatorAddress(calculatorAddress);
    }

    function () payable {
        buyTokens();
    }

    function buyTokens() payable {
        uint256 weiAmount = msg.value;

        // calculate token amount to be created
        uint256 tokens = calculator.getAmount(weiAmount);
        assert(tokens >= minimalTokens);

        token.transferFrom(tokenSeller, msg.sender, tokens);
        TokenPurchase(msg.sender, weiAmount, tokens);
    }

    function setTokenSeller(address newTokenSeller) onlyOwner {
        tokenSeller = newTokenSeller;
    }

    function setCalculatorAddress(address calculatorAddress) onlyOwner {
        calculator = Calculator(calculatorAddress);
    }

    function setMinimalTokens(uint256 _minimalTokens) onlyOwner {
        minimalTokens = _minimalTokens;
    }

    function withdraw(address beneficiary, uint amount) onlyOwner {
        require(beneficiary != 0x0);

        beneficiary.transfer(amount);
    }
}
// Vulnerability label: RENT
pragma solidity ^0.4.18;


contract Contract1 {

	mapping (uint8 => mapping (address => bool)) public something;

	function settrue(uint8 x, address a){
		something[x][a] = true;
	}
	function setfalse(uint8 x, address a){
		something[x][a] = false;
	}
}



contract Contract2 {

    Contract1 public original;
  
  	mapping (uint16 => mapping (address => uint8)) public something;

    // コンストラクタ
    function Contract2(address c) public {
        original = Contract1(c);
    }


	function test(uint8 x, address a){
		if(original.something(uint8(x),a))
			something[x][a] = 1;
		else
			something[x][a] = 2;
	}
}
// Vulnerability label: RENT
pragma solidity ^0.4.18;

/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a * b;
    assert(a == 0 || c / a == b);
    return c;
  }
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return c;
  }
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }
  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}

contract token {

  function balanceOf(address _owner) public constant returns (uint256 balance);
  function transfer(address _to, uint256 _value) public returns (bool success);

}

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) onlyOwner public {
    require(newOwner != address(0));
    emit OwnershipTransferred(owner, newOwner);
    owner = newOwner;
  }
}

contract lockEtherPay is Ownable {
    using SafeMath for uint256;

  token token_reward;
  address public beneficiary;
  bool public isLocked = false;
  bool public isReleased = false;
  uint256 public start_time;
  uint256 public end_time;
  uint256 public fifty_two_weeks = 29980800;

  event TokenReleased(address beneficiary, uint256 token_amount);

  constructor() public{
    token_reward = token(0xAa1ae5e57dc05981D83eC7FcA0b3c7ee2565B7D6);
    beneficiary = 0x51Ed81Fb25511a370207ca17f3D6Dbc7A1cFD43f;
  }

  function tokenBalance() constant public returns (uint256){
    return token_reward.balanceOf(this);
  }

  function lock() public onlyOwner returns (bool){
      require(!isLocked);
      require(tokenBalance() > 0);
      start_time = now;
      end_time = start_time.add(fifty_two_weeks);
      isLocked = true;
  }

  function lockOver() constant public returns (bool){
      uint256 current_time = now;
    return current_time > end_time;
  }

    function release() onlyOwner public{
    require(isLocked);
    require(!isReleased);
    require(lockOver());
    uint256 token_amount = tokenBalance();
    token_reward.transfer( beneficiary, token_amount);
    emit TokenReleased(beneficiary, token_amount);
    isReleased = true;
  }
}
// Vulnerability label: RENT
pragma solidity ^0.4.21;

contract Convert {
    
    address owner;
    address public fromContractAddr;
    address public toContractAddr;
    
    mapping (uint => bool) public isConvert;
    
    modifier onlyOwner {
        require(msg.sender == owner);
        _;
    }
    
    function Convert() public {
        owner = msg.sender;
    }
    
    function setFromContractAddr(address _addr) public onlyOwner {
        fromContractAddr = _addr;
    }
    
    function setToContractAddr(address _addr) public onlyOwner {
        toContractAddr = _addr;
    }
    
    function getNewToken(uint _tokenId) public {
        IFrom ifrom = IFrom(fromContractAddr);
        require(ifrom.ownerOf(_tokenId) == msg.sender);
        require(isConvert[_tokenId] == false);
        
        isConvert[_tokenId] = true;
        
        ITo ito = ITo(toContractAddr);
        ito.issueTokenAndTransfer(1, msg.sender);
    }
    
    /* only read */
    
}

interface IFrom {
    function ownerOf (uint256 _itemId) public view returns (address _owner);
}

interface ITo {
    function issueTokenAndTransfer(uint256 _count, address to) public;
}
// Vulnerability label: RENT
pragma solidity ^0.4.23;

contract Contract {
  mapping (address => uint256) public balances_bonus;
  uint256 public contract_eth_value_bonus;
}

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

contract Proxy {

  Contract contr;
  uint256 public eth_balance;
  ERC20 public token;
  mapping (address => bool) public withdrew;
  address owner;

  constructor(address _contract, address _token) {
      owner = msg.sender;
      contr = Contract(_contract);
      token = ERC20(_token);
      eth_balance = contr.contract_eth_value_bonus();
  }

  function withdraw()  {
      require(withdrew[msg.sender] == false);
      withdrew[msg.sender] = true;
      uint256 balance = contr.balances_bonus(msg.sender);
      uint256 contract_token_balance = token.balanceOf(address(this));
      uint256 tokens_to_withdraw = (balance*contract_token_balance)/eth_balance;
      eth_balance -= balance;
      require(token.transfer(msg.sender, tokens_to_withdraw));

  }

  function emergency_withdraw(address _token) {
      require(msg.sender == owner);
      require(ERC20(_token).transfer(owner, ERC20(_token).balanceOf(this)));
  }

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

/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
library SafeMath {
  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a * b;
    assert(a == 0 || c / a == b);
    return c;
  }
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return c;
  }
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }
  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}

contract token {

  function balanceOf(address _owner) public constant returns (uint256 balance);
  function transfer(address _to, uint256 _value) public returns (bool success);

}

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) onlyOwner public {
    require(newOwner != address(0));
    emit OwnershipTransferred(owner, newOwner);
    owner = newOwner;
  }
}

contract lockEtherPay is Ownable {
	using SafeMath for uint256;

  token token_reward;
  address public beneficiary;
  bool public isLocked = false;
  bool public isReleased = false;
  uint256 public start_time;
  uint256 public end_time;
  uint256 public fifty_two_weeks = 29721600;

  event TokenReleased(address beneficiary, uint256 token_amount);

  constructor() public{
    token_reward = token(0xAa1ae5e57dc05981D83eC7FcA0b3c7ee2565B7D6);
    beneficiary = 0x4B664ef96353f580BAf7ed59BB1188Ca1F2B4Ed2;
  }

  function tokenBalance() constant public returns (uint256){
    return token_reward.balanceOf(this);
  }

  function lock() public onlyOwner returns (bool){
  	require(!isLocked);
  	require(tokenBalance() > 0);
  	start_time = now;
  	end_time = start_time.add(fifty_two_weeks);
  	isLocked = true;
  }

  function lockOver() constant public returns (bool){
  	uint256 current_time = now;
	return current_time > end_time;
  }

	function release() onlyOwner public{
    require(isLocked);
    require(!isReleased);
    require(lockOver());
    uint256 token_amount = tokenBalance();
    token_reward.transfer( beneficiary, token_amount);
    emit TokenReleased(beneficiary, token_amount);
    isReleased = true;
  }
}
// Vulnerability label: RENT
/**
 * Ludum - mean "For gaming" in Latin. Play, earn, live full of life. In Game.
 * LDM will show you new generation of Gaming.
 * LDM is in-game cyrrency of Privateers.Life game.
 * https://privateers.life
 */


pragma solidity ^0.4.18;


contract Ownable {

	address public owner;

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

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

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

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

}


interface Token {

	function transfer(address _to, uint256 _value) public returns (bool);
	function balanceOf(address _owner) public constant returns (uint256 balance);

}


contract LudumAirdrop is Ownable {

	Token token;

	event TransferredToken(address indexed to, uint256 value);
	event FailedTransfer(address indexed to, uint256 value);

	modifier whenDropIsActive() {
		assert(isActive());
		_;
	}

	function LudumAirdrop () public {
	    address _tokenAddr = 0x28a40acF39b1D3C932f42dD8068ad00A5Ad6448F;
	    token = Token(_tokenAddr);
	}

	function isActive() public constant returns (bool) {
		return (
			tokensAvailable() > 0 // Tokens must be available to send
		);
	}

	//below function can be used when you want to send every recipeint with different number of tokens
	function sendLudumToMany(address[] dests, uint256[] values) whenDropIsActive onlyOwner external {
		uint256 i = 0;
		while (i < dests.length) {
			//uint256 toSend = values[i] * 10**18;
			uint256 toSend = values[i];
			sendInternally(dests[i] , toSend, values[i]);
			i++;
		}
	}

	// this function can be used when you want to send same number of tokens to all the recipients
	function sendLudumToSingle(address[] dests, uint256 value) whenDropIsActive onlyOwner external {
		uint256 i = 0;
		//uint256 toSend = value * 10**18;
		uint256 toSend = value;
		while (i < dests.length) {
			sendInternally(dests[i] , toSend, value);
			i++;
		}
	}  

	function sendInternally(address recipient, uint256 tokensToSend, uint256 valueToPresent) internal {
		if(recipient == address(0)) return;

		if(tokensAvailable() >= tokensToSend) {
			token.transfer(recipient, tokensToSend);
			TransferredToken(recipient, valueToPresent);
		} else {
			FailedTransfer(recipient, valueToPresent); 
		}
	}   


	function tokensAvailable() public constant returns (uint256) {
		return token.balanceOf(this);
	}

	function sendRemainsToOwner() public onlyOwner {
		uint256 balance = tokensAvailable();
		require (balance > 0);
		token.transfer(owner, balance);
		//selfdestruct(owner);
	}

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

contract ERC20Interface {
    function balanceOf(address tokenOwner) public view returns (uint balance);
    function allowance(address tokenOwner, address spender) public view returns (uint remaining);
    function transfer(address to, uint tokens) public returns (bool success);
    function transferFrom(address from, address to, uint tokens) public returns (bool success);

    event Transfer(address indexed from, address indexed to, uint tokens);
}

contract MultiTransfer {
  event Deposited(address from, uint value, bytes data);
  event Transacted(
    address msgSender, // 트랜잭션을 시작한 메시지의 발신자 주소
    address toAddress, // 트랜잭션이 전송된 주소
    uint value // 주소로 보낸 Wei 금액
  );

/**
* 메서드를 호출하지 않고 트랜잭션을 받으면 호출됩니다.
*/
  function() public payable {
    if (msg.value > 0) {
      emit Deposited(msg.sender, msg.value, msg.data);
    }
  }

/**
* @param toAddress1 대상 주소
* @param toAddress2 대상 주소
* @param value1 전송할 웨이의 양
* @param value2 전송할 웨이의 양
*/
  function multiTransferETH(
      address fromAddress,
      address toAddress1,
      address toAddress2,
      uint value1,
      uint value2
  ) public payable {
    if (msg.sender != fromAddress) {
        revert();
    }

    if (msg.value != value1 + value2) {
        revert();
    }

    toAddress1.transfer(value1);
    toAddress2.transfer(value2);
    
    emit Transacted(msg.sender, toAddress1, value1);
    emit Transacted(msg.sender, toAddress2, value2);
  }
  
/**
* @param toAddress1 대상 주소
* @param toAddress2 대상 주소
* @param value1 전송할 웨이의 양
* @param value2 전송할 웨이의 양
* @param tokenContractAddress erc20 토큰 계약의 주소
*/
  function multiTransferToken(
      address fromAddress,
      address toAddress1,
      address toAddress2,
      uint value1,
      uint value2,
      address tokenContractAddress
  ) public payable {
    ERC20Interface instance = ERC20Interface(tokenContractAddress);
    
    if (instance.allowance(fromAddress, msg.sender) != value1 + value2) {
        revert();
    }

    instance.transferFrom(fromAddress, toAddress1, value1);
    instance.transferFrom(fromAddress, toAddress2, value2);
    
    emit Transacted(fromAddress, toAddress1, value1);
    emit Transacted(fromAddress, toAddress2, value2);
  }
  
}
// Vulnerability label: RENT
pragma solidity ^0.4.24;

contract SaiTub {
    function tab(bytes32 cup) public returns (uint);
    function rap(bytes32 cup) public returns (uint);
    function din() public returns (uint);
    function chi() public returns (uint);
    function rhi() public returns (uint);
}

contract GetSaiTubValues {
    SaiTub public saiTub = SaiTub(0x448a5065aeBB8E423F0896E6c5D525C040f59af3);

    bytes32 public cup;
    uint public tab;
    uint public rap;
    uint public din;
    uint public chi;
    uint public rhi;

    function updateTabRap(bytes32 _cup) public {
        cup = _cup;
        tab = saiTub.tab(_cup);
        rap = saiTub.rap(_cup);
    }

    function updateRest() public {
        din = saiTub.din();
        chi = saiTub.chi();
        rhi = saiTub.rhi();
    }
}