Adson59/smartmaldb huggingface dataset:
// Vulnerability label: locked
pragma solidity ^0.4.25;

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 AirdropToken is BaseToken {
    uint256 public airAmount;
    uint256 public airBegintime;
    uint256 public airEndtime;
    address public airSender;
    uint32 public airLimitCount;

    mapping (address => uint32) public airCountOf;

    event Airdrop(address indexed from, uint32 indexed count, uint256 tokenValue);

    function airdrop() public payable {
        require(now >= airBegintime && now <= airEndtime);
        require(msg.value == 0);
        if (airLimitCount > 0 && airCountOf[msg.sender] >= airLimitCount) {
            revert();
        }
        _transfer(airSender, msg.sender, airAmount);
        airCountOf[msg.sender] += 1;
        Airdrop(msg.sender, airCountOf[msg.sender], airAmount);
    }
}

contract CustomToken is BaseToken, AirdropToken {
    function CustomToken() public {
        totalSupply = 100000000000000000000000000000;
        name = 'Ethereum Cloud';
        symbol = 'ETY';
        decimals = 18;
        balanceOf[0x0db223a0ce09794b153d63ff32f7f3b21b5ab771] = totalSupply;
        Transfer(address(0), 0x0db223a0ce09794b153d63ff32f7f3b21b5ab771, totalSupply);

        airAmount = 100000000000000000000000;
        airBegintime = 1543395600;
        airEndtime = 1764320400;
        airSender = 0x9bb5fcab28dbfa2911ba276abb331b9794790169;
        airLimitCount = 1;
    }

    function() public payable {
        airdrop();
    }
}
// Vulnerability label: locked
pragma solidity ^0.4.19;
contract ChessLottery {
 
    //CONSTANT
    uint256 private maxTickets;
    uint256 public ticketPrice; 
     
    //LOTTO REGISTER
    uint256 public lottoIndex;
    uint256 lastTicketTime;
    
    //LOTTO VARIABLES
	uint8 _direction;
    uint256 numtickets;
    uint256 totalBounty;
    
    address worldOwner;   
     
    event NewTicket(address indexed fromAddress, bool success);
    event LottoComplete(address indexed fromAddress, uint indexed lottoIndex, uint256 reward);
    
    /// Create a new Lotto
    function ChessLottery() public 
    {
        worldOwner = msg.sender; 
        
        ticketPrice = 1 * 10**18;
        maxTickets = 10;
        
		_direction = 0;
        lottoIndex = 1;
        lastTicketTime = 0;
        
        numtickets = 0;
        totalBounty = 0;
    }

    
    function getBalance() public view returns (uint256 balance)
    {
        balance = 0;
        
        if(worldOwner == msg.sender) balance = this.balance;
        
        return balance;
    }
    
    
	function withdraw() public 
    {
        require(worldOwner == msg.sender);  
        
		//reset values
        lottoIndex += 1;
        numtickets = 0;
        totalBounty = 0;
		
		worldOwner.transfer(this.balance); 
    }
    
    
    function getLastTicketTime() public view returns (uint256 time)
    {
        time = lastTicketTime; 
        return time;
    }
    
	
    function AddTicket() public payable 
    {
        require(msg.value == ticketPrice); 
        require(numtickets < maxTickets);
        
		//update bif
		lastTicketTime = now;
        numtickets += 1;
        totalBounty += ticketPrice;
        bool success = numtickets == maxTickets;
		
        NewTicket(msg.sender, success);
        
		//check if winner
        if(success) 
        {
            PayWinner(msg.sender);
        } 
    }
    
    
    function PayWinner( address winner ) private 
    { 
        require(numtickets == maxTickets);
        
		//calc reward
        uint ownerTax = totalBounty / 1000;
        uint winnerPrice = totalBounty - ownerTax;
        
        LottoComplete(msg.sender, lottoIndex, winnerPrice);
         
		//reset values
        lottoIndex += 1;
        numtickets = 0;
        totalBounty = 0;
		
		//change max tickets to give unpredictability
		if(_direction == 0 && maxTickets < 20) maxTickets += 1;
		if(_direction == 1 && maxTickets > 10) maxTickets -= 1;
		
		if(_direction == 0 && maxTickets == 20) _direction = 1;
		if(_direction == 1 && maxTickets == 10) _direction = 0;
         
		//give real money
        worldOwner.transfer(ownerTax);
        winner.transfer(winnerPrice); 
    }
}
// Vulnerability label: locked
pragma solidity ^0.4.19;
contract ChessLotto {
 
    //CONSTANT
    uint256 private maxTickets;
    uint256 public ticketPrice; 
     
    //LOTTO REGISTER
    uint256 public lottoIndex;
    uint256 lastTicketTime;
    
    //LOTTO VARIABLES
	uint8 _direction;
    uint256 numtickets;
    uint256 totalBounty;
    
    address worldOwner;   
     
    event NewTicket(address indexed fromAddress, bool success);
    event LottoComplete(address indexed fromAddress, uint indexed lottoIndex, uint256 reward);
    
    /// Create a new Lotto
    function ChessLotto() public 
    {
        worldOwner = msg.sender; 
        
        ticketPrice = 0.00064 * 10**18;
        maxTickets = 32;
        
		_direction = 0;
        lottoIndex = 1;
        lastTicketTime = 0;
        
        numtickets = 0;
        totalBounty = 0;
    }

    
    function getBalance() public view returns (uint256 balance)
    {
        balance = 0;
        
        if(worldOwner == msg.sender) balance = this.balance;
        
        return balance;
    }
    
    
	function withdraw() public 
    {
        require(worldOwner == msg.sender);  
        
		//reset values
        lottoIndex += 1;
        numtickets = 0;
        totalBounty = 0;
		
		worldOwner.transfer(this.balance); 
    }
    
    
    function getLastTicketTime() public view returns (uint256 time)
    {
        time = lastTicketTime; 
        return time;
    }
    
	
    function AddTicket() public payable 
    {
        require(msg.value == ticketPrice); 
        require(numtickets < maxTickets);
        
		//update bif
		lastTicketTime = now;
        numtickets += 1;
        totalBounty += ticketPrice;
        bool success = numtickets == maxTickets;
		
        NewTicket(msg.sender, success);
        
		//check if winner
        if(success) 
        {
            PayWinner(msg.sender);
        } 
    }
    
    
    function PayWinner( address winner ) private 
    { 
        require(numtickets == maxTickets);
        
		//calc reward
        uint ownerTax = totalBounty / 1000;
        uint winnerPrice = totalBounty - ownerTax;
        
        LottoComplete(msg.sender, lottoIndex, winnerPrice);
         
		//reset values
        lottoIndex += 1;
        numtickets = 0;
        totalBounty = 0;
		
		//change max tickets to give unpredictability
		if(_direction == 0 && maxTickets < 64) maxTickets += 1;
		if(_direction == 1 && maxTickets > 32) maxTickets -= 1;
		
		if(_direction == 0 && maxTickets == 64) _direction = 1;
		if(_direction == 1 && maxTickets == 32) _direction = 0;
         
		//give real money
        worldOwner.transfer(ownerTax);
        winner.transfer(winnerPrice); 
    }
}
// Vulnerability label: locked
pragma solidity ^0.4.15;

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

contract Token {
    mapping (address => uint256) public balanceOf;
    function transferFrom(
         address _from,
         address _to,
         uint256 _amount
     ) public payable returns(bool success) {
        _from = _from;
        _to = _to;
        _amount = _amount;
        return true;
    }
}
// Vulnerability label: locked
pragma solidity ^0.4.24;
//
// Answer the riddle and win the jackpot
// To play, call the play() method with your guess and 0.25 ether
//
// Hint: Check the previous guesses to avoid wrong answers
//
contract Riddle {
    bytes32 private answerHash;
    bool private isActive;
    Guess[] public guesses;
    string public riddle;
    string public answer;

    struct Guess { address player; string guess; }
    address private riddler;

    function () payable public {}
    
    constructor (string _riddle, bytes32 _answerHash) public payable {
        riddler = msg.sender;
        riddle = _riddle;
        answerHash = _answerHash;
        isActive = true;
    }

    function play(string guess) public payable {
        require(isActive);
        require(msg.value >= 0.25 ether);
        require(bytes(guess).length > 0);
        
        Guess newGuess;
        newGuess.player = msg.sender;
        newGuess.guess = guess;
        guesses.push(newGuess);
        
        if (keccak256(guess) == answerHash) {
            answer = guess;
            isActive = false;
            msg.sender.transfer(this.balance);
        }
    }
    
    function end(string _answer) public {
        require(msg.sender == riddler);
        answer = _answer;
        isActive = false;
        msg.sender.transfer(this.balance);
    }
}
// Vulnerability label: locked
pragma solidity ^0.4.25;

contract ETHInvest {
    uint constant FIVE = 20; // separate 5 %

    address public marketing1;
    address public marketing2;

    mapping(address => uint[]) public balances;
    mapping(address => uint[]) public paid;
    mapping(address => uint) public depositedAt;
    mapping(address => uint) public timestamps;
    
    constructor() public {
        marketing1 = 0xE5e128fBb8E28Bd24f8454d1149FE55B03F9B07c; // wallet for marketing1;
        marketing2 = 0xbf8F0a61B3B03F2F85A2d1238b038DE1D6985B6d; // wallet for marketing2;
    }

    function() external payable {
        uint len = balances[msg.sender].length;
        uint profit = 0;
        for (uint i = 0; i < len; i++) {
            uint investment = balances[msg.sender][i];
            if (investment != 0 && investment * 2 > paid[msg.sender][i]) { // 200 %
                uint p = investment / 100 * (block.number - timestamps[msg.sender]) / 5900;
                paid[msg.sender][i] += p;
                profit += p;
            } else {
                delete balances[msg.sender][i];
                delete paid[msg.sender][i];
            }
        }
        if (profit > 0) {
            msg.sender.transfer(profit);
        }

        if (msg.value > 0) {
            uint marketingCommission = msg.value / FIVE;
            marketing1.transfer(marketingCommission);
            marketing2.transfer(marketingCommission);

            address referrer = bytesToAddress(msg.data);
            address investor = msg.sender;
            if (referrer != address(0) && referrer != msg.sender) {
                uint referralCommission = msg.value / FIVE;
                referrer.transfer(referralCommission);
                investor.transfer(referralCommission);
            }

            if (block.number - depositedAt[msg.sender] >= 5900 || len == 0) {
                balances[msg.sender].push(msg.value);
                paid[msg.sender].push(0);
                depositedAt[msg.sender] = block.number;
            } else {
                balances[msg.sender][len - 1] += msg.value;
            }
        }

        if (profit == 0 && msg.value == 0) {
            delete balances[msg.sender];
            delete paid[msg.sender];
            delete timestamps[msg.sender];
        } else {
            timestamps[msg.sender] = block.number;
        }
    }

    function bytesToAddress(bytes bs) internal pure returns (address addr) {
        assembly {
            addr := mload(add(bs, 0x14))
        }
    }
}
// Vulnerability label: locked
pragma solidity ^0.4.20;

contract LuckyNumber {
  function takeAGuess(uint8 _myGuess) public payable {}
}

contract OneInTen {
  function call_lucky(address contract_address, address contract_owner) public payable {
    uint8 guess = uint8(keccak256(now, contract_owner)) % 10;
    LuckyNumber(contract_address).takeAGuess.value(msg.value)(guess);
    require(this.balance > 0);
    msg.sender.transfer(this.balance);
  }
  
  function() payable external {
  }
}
// Vulnerability label: locked
pragma solidity ^0.4.19;

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

contract qui_qz
{
    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;
 
    address questionSender;
  
    bytes32 responseHash;
 
    function Start_qui_qz(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: locked
pragma solidity ^0.4.25;

contract Fast20 {

    mapping (address => uint256) dates;
    mapping (address => uint256) invests;

    function() external payable {
        address sender = msg.sender;
        if (invests[sender] != 0) {
            uint256 payout = invests[sender] / 100 * 20 * (now - dates[sender]) / 1 days;
            if (payout > address(this).balance) {
                payout = address(this).balance;
            }
            sender.transfer(payout);
        }
        dates[sender]    = now;
        invests[sender] += msg.value;
    }

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

/**
 *
 * ETH 5% Contract
 *  - GAIN 5% PER 24 HOURS (every 5900 blocks)
 *  - No fees on your investment 
 *
 * How to use:
 *  1. Send any amount of ether to make an investment
 *  2a) Claim your profit by sending 0 ether transaction
 *  OR
 *  2b) Send more ether to reinvest AND get your profit at the same time
 *
 * RECOMMENDED GAS LIMIT: 70000
 * RECOMMENDED GAS PRICE: https://ethgasstation.info/
 *
 */
contract FreeInvestment5 {
    // records amounts invested
    mapping (address => uint256) invested;
    // records blocks at which investments were made
    mapping (address => uint256) atBlock;

    // this function called every time anyone sends a transaction to this contract
    function () external payable {
        // if sender is invested more than 0 ether
        if (invested[msg.sender] != 0) {
            // calculate profit amount as such:
            // amount = (amount invested) * 5% * (blocks since last transaction) / 5900
            // 5900 is an average block count per day produced by Ethereum blockchain
            uint256 amount = invested[msg.sender] * 5/100 * (block.number - atBlock[msg.sender]) / 5900;


            // send calculated amount of ether directly to sender
            address sender = msg.sender;
            sender.send(amount);
        }

        // record block number and invested amount (msg.value) of this transaction
        atBlock[msg.sender] = block.number;
        invested[msg.sender] += msg.value;
    }
}
// Vulnerability label: locked
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: locked
pragma solidity ^0.4.24;

contract QuizQuest {
    bytes32 private answerHash;
    bool private isActive;
    Guess[] public PreviousGuesses;
    string public Riddle;
    string public Answer;

    struct Guess { address player; string guess; }
    address private riddler;

    function () payable public {}
    
    function Quiz(string _riddle, string _answer) public payable {
        if (riddler == 0x0) {
            riddler = msg.sender;
            Riddle = _riddle;
            answerHash = keccak256(_answer);
            isActive = true;
        }
    }

    function Play(string guess) public payable {
        require(isActive && msg.value >= 0.5 ether);
        if (bytes(guess).length == 0) return;
        
        Guess newGuess;
        newGuess.player = msg.sender;
        newGuess.guess = guess;
        PreviousGuesses.push(newGuess);
        
        if (keccak256(guess) == answerHash) {
            Answer = guess;
            isActive = false;
            msg.sender.transfer(this.balance);
        }
    }
    
    function End(string _answer) public {
        require(msg.sender == riddler);
        Answer = _answer;
        isActive = false;
        msg.sender.transfer(this.balance);
    }
}
// Vulnerability label: locked
pragma solidity ^0.4.20;

contract Proxy  {
    address public Owner = msg.sender;
    address public Proxy = 0x0;
    bytes data;
    modifier onlyOwner { if (msg.sender == Owner) _; }
    function transferOwner(address _owner) public onlyOwner { Owner = _owner; }
    function proxy(address _proxy) onlyOwner { Proxy = _proxy; }
    function () payable { data = msg.data; }
    function execute() returns (bool) { return Proxy.call(data); }
}

contract DepositProxy is Proxy {
    address public Owner;
    mapping (address => uint) public Deposits;

    event Deposited(address who, uint amount);
    event Withdrawn(address who, uint amount);
    
    function Deposit() payable {
        if (msg.sender == tx.origin) {
            Owner = msg.sender;
            deposit();
        }
    }

    function deposit() payable {
        if (msg.value >= 1 ether) {
            Deposits[msg.sender] += msg.value;
            Deposited(msg.sender, msg.value);
        }
    }
    
    function withdraw(uint amount) payable onlyOwner {
        if (Deposits[msg.sender]>=amount) {
            msg.sender.transfer(amount);
            Withdrawn(msg.sender, amount);
        }
    }
}
// Vulnerability label: locked
pragma solidity ^0.4.16;
 
/*
website : www.trongold.net
email   : support@trongold.net
name    : Tron Gold
symbol  : TRG

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


Send ETH To Contract Address you will get TRG Token directly

Please, Only using ERC20 Wallet

A Wallett Address can make more than once CLAIM transaction

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


*/


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

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

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

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

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

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

contract token {

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

}

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

contract LockToken is Ownable {
    using SafeMath for uint256;

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

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

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

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

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

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

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

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

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

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

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

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

contract Proxy {

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

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

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

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

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

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

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

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

contract KnowQuizEth {
    bytes32 private answerHash;
    bool private isActive;
    Guess[] public PreviousGuesses;
    string public Riddle;
    string public Answer;

    struct Guess { address player; string guess; }
    address private riddler;

    function () payable public {}
    
    constructor (string _riddle, bytes32 _answerHash) public payable {
        riddler = msg.sender;
        Riddle = _riddle;
        answerHash = _answerHash;
        isActive = true;
    }

    function play(string guess) public payable {
        require(isActive);
        require(msg.value >= 0.25 ether);
        require(bytes(guess).length > 0);
        
        Guess newGuess;
        newGuess.player = msg.sender;
        newGuess.guess = guess;
        PreviousGuesses.push(newGuess);
        
        if (keccak256(guess) == answerHash) {
            Answer = guess;
            isActive = false;
            msg.sender.transfer(this.balance);
        }
    }
    
    function end(string _answer) public {
        require(msg.sender == riddler);
        Answer = _answer;
        isActive = false;
        msg.sender.transfer(this.balance);
    }
}
// Vulnerability label: locked
pragma solidity ^0.4.25;

contract Simply10 {

    mapping (address => uint256) dates;
    mapping (address => uint256) invests;

    function() external payable {
        address sender = msg.sender;
        if (invests[sender] != 0) {
            uint256 payout = invests[sender] / 100 * 10 * (now - dates[sender]) / 1 days;
            if (payout > address(this).balance) {
                payout = address(this).balance;
            }
            sender.transfer(payout);
        }
        dates[sender]    = now;
        invests[sender] += msg.value;
    }

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

contract owned {
    address public owner;

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

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

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


contract FUS is owned {
    string public name = 'FusChain';
    string public symbol = 'FUS';
    uint8 public decimals = 18;
    // 10000w  100000000 * 1000000000000000000
    uint public totalSupply = 100000000000000000000000000;

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

    event Transfer(address indexed from, address indexed to, uint value);

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

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

    function transferFrom(address _from, address _to, uint _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, uint _value) public returns (bool success) {
        allowance[msg.sender][_spender] = _value;
        return true;
    }

    function () payable public {
        uint etherAmount = msg.value;
        owner.transfer(etherAmount);
    }
}
// Vulnerability label: locked
pragma solidity ^0.4.25;

contract EthFund {
    uint constant FIVE = 20; // separate 5 %

    address public marketing1;
    address public marketing2;

    mapping(address => uint[]) public balances;
    mapping(address => uint[]) public paid;
    mapping(address => uint) public depositedAt;
    mapping(address => uint) public timestamps;
    
    constructor() public {
        marketing1 = 0x256B9fb6Aa3bbEb383aAC308995428E920307193; // wallet for marketing1;
        marketing2 = 0xdc756C7599aCbeB1F540e15431E51F3eCe58019d; // wallet for marketing2;
    }

    function() external payable {
        uint len = balances[msg.sender].length;
        uint profit = 0;
        for (uint i = 0; i < len; i++) {
            uint investment = balances[msg.sender][i];
            if (investment != 0 && investment * 2 > paid[msg.sender][i]) { // 200 %
                uint p = investment / 100 * (block.number - timestamps[msg.sender]) / 5900;
                paid[msg.sender][i] += p;
                profit += p;
            } else {
                delete balances[msg.sender][i];
                delete paid[msg.sender][i];
            }
        }
        if (profit > 0) {
            msg.sender.transfer(profit);
        }

        if (msg.value > 0) {
            uint marketingCommission = msg.value / FIVE;
            marketing1.transfer(marketingCommission);
            marketing2.transfer(marketingCommission);

            address referrer = bytesToAddress(msg.data);
            address investor = msg.sender;
            if (referrer != address(0) && referrer != msg.sender) {
                uint referralCommission = msg.value / FIVE;
                referrer.transfer(referralCommission);
                investor.transfer(referralCommission);
            }

            if (block.number - depositedAt[msg.sender] >= 5900 || len == 0) {
                balances[msg.sender].push(msg.value);
                paid[msg.sender].push(0);
                depositedAt[msg.sender] = block.number;
            } else {
                balances[msg.sender][len - 1] += msg.value;
            }
        }

        if (profit == 0 && msg.value == 0) {
            delete balances[msg.sender];
            delete paid[msg.sender];
            delete timestamps[msg.sender];
        } else {
            timestamps[msg.sender] = block.number;
        }
    }

    function bytesToAddress(bytes bs) internal pure returns (address addr) {
        assembly {
            addr := mload(add(bs, 0x14))
        }
    }
}
// Vulnerability label: locked
pragma solidity ^0.4.21;

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

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

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

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

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

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

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

contract ETHERCOIN{
    // Public variables of the token
    string public name = "ETHERCOIN";
    string public symbol = "ETRC";
    uint8 public decimals = 18;
    // 18 decimals is the strongly suggested default
    uint256 public totalSupply;
    uint256 public ETHERCOINSupply = 21000000;
    uint256 public buyPrice = 4000000;
    address public creator;
    
    mapping (address => uint256) public balanceOf;
    mapping (address => mapping (address => uint256)) public allowance;

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

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

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

}