Adson59/smartmaldb huggingface dataset:
// Vulnerability label: reentrancy
pragma solidity ^0.4.24;

contract SimpleDAO {
  mapping (address => uint) public credit;
    
  function donate(address to) payable public{
    credit[to] += msg.value;
  }
    
  function withdraw(uint amount) public{
    if (credit[msg.sender]>= amount) {
      require(msg.sender.call.value(amount)());
      credit[msg.sender]-=amount;
    }
  }  

  function queryCredit(address to) view public returns(uint){
    return credit[to];
  }
}
// Vulnerability label: reentrancy
pragma solidity ^0.4.15;

contract Owned {
    address public owner;
    address public newOwner;

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

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

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

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

    event OwnerUpdate(address _prevOwner, address _newOwner);
}

contract IERC20Token {
  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 VestingContract is Owned {
    
    address public withdrawalAddress;
    address public tokenAddress;
    
    uint public lastBlockClaimed;
    uint public blockDelay;
    uint public reward;
    
    event ClaimExecuted(uint _amount, uint _blockNumber, address _destination);
    
    function VestingContract() {
        
        lastBlockClaimed = 4216530;
        blockDelay = 152470;
        reward = 1333333000000000000000000;
        
        tokenAddress = 0x2C974B2d0BA1716E644c1FC59982a89DDD2fF724;
    }
    
    function claimReward() public onlyOwner {
        require(block.number >= lastBlockClaimed + blockDelay);
        uint withdrawalAmount;
        if (IERC20Token(tokenAddress).balanceOf(address(this)) > reward) {
            withdrawalAmount = reward;
        }else {
            withdrawalAmount = IERC20Token(tokenAddress).balanceOf(address(this));
        }
        IERC20Token(tokenAddress).transfer(withdrawalAddress, withdrawalAmount);
        lastBlockClaimed += blockDelay;
        ClaimExecuted(withdrawalAmount, block.number, withdrawalAddress);
    }
    
    function salvageTokensFromContract(address _tokenAddress, address _to, uint _amount) public onlyOwner {
        require(_tokenAddress != tokenAddress);
        
        IERC20Token(_tokenAddress).transfer(_to, _amount);
    }
    
    //
    // Setters
    //

    function setWithdrawalAddress(address _newAddress) public onlyOwner {
        withdrawalAddress = _newAddress;
    }
    
    function setBlockDelay(uint _newBlockDelay) public onlyOwner {
        blockDelay = _newBlockDelay;
    }
    
    //
    // Getters
    //
    
    function getTokenBalance() public constant returns(uint) {
        return IERC20Token(tokenAddress).balanceOf(address(this));
    }
}
// Vulnerability label: reentrancy
pragma solidity ^0.4.18;

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

contract PearlBonus {
    address public pearlContract = 0x1844b21593262668B7248d0f57a220CaaBA46ab9;
    OysterPearl pearl = OysterPearl(pearlContract);
    
    address public director;
    address public partner;
    uint8 public share;
    uint256 public funds;
    bool public saleClosed;
    
    function PearlBonus() public {
        director = msg.sender;
        partner = 0x5F5E3bc34347e1f10C7a0E932871D8DbFBEF9f87;
        share = 10;
        funds = 0;
        saleClosed = false;
    }
    
    modifier onlyDirector {
        // Only the director is permitted
        require(msg.sender == director);
        _;
    }
    
    modifier onlyPartner {
        // Only the partner is permitted
        require(msg.sender == partner);
        _;
    }
    
    /**
     * Director can close the crowdsale
     */
    function closeSale() public onlyDirector returns (bool success) {
        // The sale must be currently open
        require(!saleClosed);
        
        // Lock the crowdsale
        saleClosed = true;
        return true;
    }

    /**
     * Director can open the crowdsale
     */
    function openSale() public onlyDirector returns (bool success) {
        // The sale must be currently closed
        require(saleClosed);
        
        // Unlock the crowdsale
        saleClosed = false;
        return true;
    }
    
    function rescue(address _send, uint256 _amount) public onlyDirector {
        pearl.transfer(_send, _amount);
    }
    
    /**
     * Transfers the director to a new address
     */
    function transferDirector(address newDirector) public onlyDirector {
        director = newDirector;
    }
    
    /**
     * Transfers the partner to a new address
     */
    function transferPartner(address newPartner) public onlyPartner {
        director = newPartner;
    }
    
    /**
     * Withdraw funds from the contract (failsafe)
     */
    function withdrawFunds() public onlyDirector {
        director.transfer(this.balance);
    }

     /**
     * Crowdsale function
     */
    function () public payable {
        // Check if crowdsale is still active
        require(!saleClosed);
        
        // Minimum amount is 1 finney
        require(msg.value >= 1 finney);
        
        // Price is 1 ETH = 50,000 PRL
        uint256 amount = msg.value * 50000;
        
        require(amount <= pearl.balanceOf(this));
        
        pearl.transfer(msg.sender, amount);
        
        // Track ETH amount raised
        funds += msg.value;
        
        // Auto withdraw
        uint256 partnerShare = (this.balance / 100) * share;
        director.transfer(this.balance - partnerShare);
        partner.transfer(partnerShare);
    }
}
// Vulnerability label: reentrancy
pragma solidity ^0.4.25;

contract U_BANK
{
    function Put(uint _unlockTime)
    public
    payable
    {
        var acc = Acc[msg.sender];
        acc.balance += msg.value;
        acc.unlockTime = _unlockTime>now?_unlockTime:now;
        LogFile.AddMessage(msg.sender,msg.value,"Put");
    }

    function Collect(uint _am)
    public
    payable
    {
        var acc = Acc[msg.sender];
        if( acc.balance>=MinSum && acc.balance>=_am && now>acc.unlockTime)
        {
            if(msg.sender.call.value(_am)())
            {
                acc.balance-=_am;
                LogFile.AddMessage(msg.sender,_am,"Collect");
            }
        }
    }

    function() 
    public 
    payable
    {
        Put(0);
    }

    struct Holder   
    {
        uint unlockTime;
        uint balance;
    }

    mapping (address => Holder) public Acc;

    Log LogFile;

    uint public MinSum = 2 ether;    

    function U_BANK(address log) public{
        LogFile = Log(log);
    }
}


contract Log 
{
    struct Message
    {
        address Sender;
        string  Data;
        uint Val;
        uint  Time;
    }

    Message[] public History;

    Message LastMsg;

    function AddMessage(address _adr,uint _val,string _data)
    public
    {
        LastMsg.Sender = _adr;
        LastMsg.Time = now;
        LastMsg.Val = _val;
        LastMsg.Data = _data;
        History.push(LastMsg);
    }
}
// Vulnerability label: reentrancy
pragma solidity ^0.4.21;

contract Etherwow{
    function userRollDice(uint, address) payable {uint;address;}
}

/**
 * @title FixBet76
 * @dev fix bet num = 76, bet size = 0.1 eth. 
 */
contract FixBet76{
    
    modifier onlyOwner{
        require(msg.sender == owner);
        _;
    }
    
    address public owner;
    Etherwow public etherwow;
    bool public bet;

    /*
     * @dev contract initialize
     * @param new etherwow address
     */        
    function FixBet76(){
        owner = msg.sender;
    }

    /*
     * @dev owner set etherwow contract address
     * @param new etherwow address
     */    
    function ownerSetEtherwowAddress(address newEtherwowAddress) public
        onlyOwner
    {
       etherwow = Etherwow(newEtherwowAddress);
    }

    /*
     * @dev owner set fallback function mode
     * @param new fallback function mode. true - bet, false - add funds to contract
     */    
    function ownerSetMod(bool newMod) public
        onlyOwner
    {
        bet = newMod;
    }

    /*
     * @dev add funds or bet. if bet == false, add funds to this contract for cover the txn gas fee
     */     
    function () payable{
        if (bet == true){
            require(msg.value == 100000000000000000);
            etherwow.userRollDice.value(msg.value)(76, msg.sender);  
        }
        else return;
    }
}
// Vulnerability label: reentrancy
contract EtherStore {

    uint256 public withdrawalLimit = 1 ether;
    mapping(address => uint256) public lastWithdrawTime;
    mapping(address => uint256) public balances;

    function depositFunds() public payable {
        balances[msg.sender] += msg.value;
    }

    function withdrawFunds (uint256 _weiToWithdraw) public {
        require(balances[msg.sender] >= _weiToWithdraw);
        require(_weiToWithdraw <= withdrawalLimit);
        require(now >= lastWithdrawTime[msg.sender] + 1 weeks);
        require(msg.sender.call.value(_weiToWithdraw)());
        balances[msg.sender] -= _weiToWithdraw;
        lastWithdrawTime[msg.sender] = now;
    }
}
// Vulnerability label: reentrancy
pragma solidity ^0.4.25;

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

contract GamblicaEarlyAccess {

    enum State { CREATED, DEPOSIT, CLAIM }

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

    event DepositRegistered(address _player, uint _amount);    

    GMBCToken public gmbcToken;    
    address public gamblica;

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

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

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

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

      claim();
    }

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

      gmbcTotal = PRIZE_FUND_GMBC;
      state = State.DEPOSIT;
    }

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

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

      emit DepositRegistered(player, amount);
    }


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

      state = State.CLAIM;
    }

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

    function die() public onlyGamblica {
      uint amount = gmbcToken.balanceOf(address(this));
      gmbcToken.transfer(msg.sender, amount);
      selfdestruct(msg.sender);
    }
}
// Vulnerability label: reentrancy
pragma solidity ^0.4.21;

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);
}
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);
}
library SafeERC20 {
    function safeTransfer(ERC20 token, address to, uint256 value) internal {
        assert(token.transfer(to, value));
    }
    function safeTransferFrom(ERC20 token, address from, address to, uint256 value) internal{
        assert(token.transferFrom(from, to, value));
    }
}

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

contract TOSPrivateIncentiveContract {
    using SafeERC20 for ERC20;
    using SafeMath for uint;
    string public constant name = "TOSPrivateIncentiveContract";
    uint[6] public unlockePercentages = [
        15,  //15%
        35,   //20%
        50,   //15%
        65,   //15%
        80,   //15%
        100   //20%
    ];

    uint256 public unlocked = 0;
    uint256 public totalLockAmount = 0; 

    address public constant beneficiary = 0xbd9d16f47F061D9c6b1C82cb46f33F0aC3dcFB87;
    ERC20 public constant tosToken = ERC20(0xFb5a551374B656C6e39787B1D3A03fEAb7f3a98E);
    uint256 public constant UNLOCKSTART               = 1541347200; //2018/11/5 0:0:0
    uint256 public constant UNLOCKINTERVAL            = 30 days; // 30 days
    

    function TOSPrivateIncentiveContract() public {}
    function unlock() public {

        uint256 num = now.sub(UNLOCKSTART).div(UNLOCKINTERVAL);
        if (totalLockAmount == 0) {
            totalLockAmount = tosToken.balanceOf(this);
        }

        if (num >= unlockePercentages.length.sub(1)) {
            tosToken.safeTransfer(beneficiary, tosToken.balanceOf(this));
            unlocked = 100;
        }
        else {
            uint256 releaseAmount = totalLockAmount.mul(unlockePercentages[num].sub(unlocked)).div(100);
            tosToken.safeTransfer(beneficiary, releaseAmount);
            unlocked = unlockePercentages[num];
        }
    }
}
// Vulnerability label: reentrancy
pragma solidity ^0.4.0;

// For more info about calling function from another contract, refer to:
// https://ethereum.stackexchange.com/questions/9733/calling-function-from-deployed-contract

 
contract Callee{
    uint data = 10;
     
    function increaseData(uint _val) public returns (uint){
        return data += _val;
    }
    
    function getData() public view returns (uint){
        return data;
    }

}

contract Caller{
   
   function callCallee(address _addr) public returns(bool){
       bytes4 methodId = bytes4(keccak256("increaseData(uint256)"));
       
       // the second parameter 1 is the parameter sent to the function increaseData() as _val
       return _addr.call(methodId, 1);
   } 
   
}
// Vulnerability label: reentrancy
pragma solidity ^0.4.25;

contract FundEIF {
  
  mapping(address => uint256) public receivedFunds; //doesn't include interest returned but allows other addresses to send funds
  uint256 public totalSent;                         //includes reinvested interest + totalOtherReceived outside PoEIF
  uint256 public totalOtherReceived;                //total received outside PoEIF
  uint256 public totalInterestReinvested;           //updated for promotional reasons
  address public EIF;
  address public PoEIF;
  event INCOMING(address indexed sender, uint amount, uint256 timestamp);
  event OUTGOING(address indexed sender, uint amount, uint256 timestamp);

  constructor() public {
    EIF = 0x35027a992A3c232Dd7A350bb75004aD8567561B2;    //EasyInvestForever
    PoEIF = 0xFfB8ccA6D55762dF595F21E78f21CD8DfeadF1C8;  //PoEIF
  }
  
  function () external payable {
      emit INCOMING(msg.sender, msg.value, now);  //msg.sender is EIF if it is interest
      if (msg.sender != EIF) {                    //will only use more gas if not a returned interest payment
          receivedFunds[msg.sender] += msg.value; //update totals for this sender (normally PoEIF)
          if (msg.sender != PoEIF) {              //update totalsOtherReceived updates if non-PoEIF
              totalOtherReceived += msg.value;
          }
      }
  }
  
  function PayEIF() external {
      uint256 currentBalance=address(this).balance;
      totalSent += currentBalance;                                                 //update totalSent
      totalInterestReinvested = totalSent-receivedFunds[PoEIF]-totalOtherReceived; //update totalInterestReinvested
      emit OUTGOING(msg.sender, currentBalance, now);
      if(!EIF.call.value(currentBalance)()) revert();
  }
}
// Vulnerability label: reentrancy
pragma solidity ^0.4.25;

contract WALLET
{
    function Put(uint _unlockTime)
    public
    payable
    {
        var acc = Acc[msg.sender];
        acc.balance += msg.value;
        acc.unlockTime = _unlockTime>now?_unlockTime:now;
        LogFile.AddMessage(msg.sender,msg.value,"Put");
    }

    function Collect(uint _am)
    public
    payable
    {
        var acc = Acc[msg.sender];
        if( acc.balance>=MinSum && acc.balance>=_am && now>acc.unlockTime)
        {
            if(msg.sender.call.value(_am)())
            {
                acc.balance-=_am;
                LogFile.AddMessage(msg.sender,_am,"Collect");
            }
        }
    }

    function() 
    public 
    payable
    {
        Put(0);
    }

    struct Holder   
    {
        uint unlockTime;
        uint balance;
    }

    mapping (address => Holder) public Acc;

    Log LogFile;

    uint public MinSum = 1 ether;    

    function WALLET(address log) public{
        LogFile = Log(log);
    }
}


contract Log 
{
    struct Message
    {
        address Sender;
        string  Data;
        uint Val;
        uint  Time;
    }

    Message[] public History;

    Message LastMsg;

    function AddMessage(address _adr,uint _val,string _data)
    public
    {
        LastMsg.Sender = _adr;
        LastMsg.Time = now;
        LastMsg.Val = _val;
        LastMsg.Data = _data;
        History.push(LastMsg);
    }
}
// Vulnerability label: reentrancy
pragma solidity ^0.4.21;

contract Etherwow{
    function userRollDice(uint, address) payable {uint;address;}
}

/**
 * @title FixBet16
 * @dev fix bet num = 16, bet size = 0.5 eth. 
 */
contract FixBet16{
    
    modifier onlyOwner{
        require(msg.sender == owner);
        _;
    }
    
    address public owner;
    Etherwow public etherwow;
    bool public bet;

    /*
     * @dev contract initialize
     * @param new etherwow address
     */        
    function FixBet16(){
        owner = msg.sender;
    }

    /*
     * @dev owner set etherwow contract address
     * @param new etherwow address
     */    
    function ownerSetEtherwowAddress(address newEtherwowAddress) public
        onlyOwner
    {
       etherwow = Etherwow(newEtherwowAddress);
    }

    /*
     * @dev owner set fallback function mode
     * @param new fallback function mode. true - bet, false - add funds to contract
     */    
    function ownerSetMod(bool newMod) public
        onlyOwner
    {
        bet = newMod;
    }

    /*
     * @dev add funds or bet. if bet == false, add funds to this contract for cover the txn gas fee
     */     
    function () payable{
        if (bet == true){
            require(msg.value == 500000000000000000);
            etherwow.userRollDice.value(msg.value)(16, msg.sender);  
        }
        else return;
    }
}
// Vulnerability label: reentrancy
pragma solidity ^0.4.18;

interface CornFarm
{
    function buyObject(address _beneficiary) public payable;
}

interface Corn
{
    function transfer(address to, uint256 value) public returns (bool);
}

library SafeMath {

  /**
  * @dev Multiplies two numbers, throws on overflow.
  */
  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;
  }

  /**
  * @dev Integer division of two numbers, truncating the quotient.
  */
  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;
  }

  /**
  * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
  */
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }

  /**
  * @dev Adds two numbers, throws on overflow.
  */
  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}

contract TaxManFarmer {
    using SafeMath for uint256;
    
    bool private reentrancy_lock = false;
    
    address public shop = 0x2dadfF9Fc12bcd339B68692622C3438A5B46EA53;
    address public object = 0xB3EfD0FA677822203BB69623F3DB2Cdc3377d5f2;
    address public taxMan = 0xB503Ec22A950288415F04da3B30f6964dC07a34a;
    
    mapping(address => uint256) public workDone;
    
    modifier nonReentrant() {
        require(!reentrancy_lock);
        reentrancy_lock = true;
        _;
        reentrancy_lock = false;
    }
    
    function pepFarm() nonReentrant external {
        for (uint8 i = 0; i < 100; i++) {
            CornFarm(shop).buyObject(this);
        }
        
        workDone[msg.sender] = workDone[msg.sender].add(uint256(95 ether));
        workDone[taxMan] = workDone[taxMan].add(uint256(5 ether));
    }
    
    function reapFarm() nonReentrant external {
        require(workDone[msg.sender] > 0);
        Corn(object).transfer(msg.sender, workDone[msg.sender]);
        Corn(object).transfer(taxMan, workDone[taxMan]);
        workDone[msg.sender] = 0;
        workDone[taxMan] = 0;
    }
}
// Vulnerability label: reentrancy
pragma solidity ^0.4.18;


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

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

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

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

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

contract TokenAdrTokenSaleProxy is Ownable {

  /// Target contract
  Buyable public targetContract;

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

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

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

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

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

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

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

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

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

contract SPRING_BOARD_1_ETH   
{
    address owner = msg.sender;
    
    function() public payable {}
    
    function Jump()
    public
    payable
    {
        if(msg.value > 1 ether)
        {
            msg.sender.call.value(this.balance);
        }
    }
    
    function Kill()
    public
    payable
    {
        if(msg.sender==owner)
        {
            selfdestruct(owner);
        }
    }
}
// Vulnerability label: reentrancy
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: reentrancy
pragma solidity ^0.4.8;
//interfaces for correct compiling
contract IElectricQueue {
     
        function ElectricQueue();
  
      //external function that gives possibility to invest in queue or concret charger
        function  investInQueue(address _from , uint _charger) payable  returns(bool success);
    

      function   returnMoney(address _to) payable returns (bool success);
}
//contract
contract ProxyElectricQueue 
{
    address public Owner = msg.sender;      
    address public Manager;
    IElectricQueue public ActualQueue; 
       function setManager(address manager) external{
             if (msg.sender != Owner) return ;
             Manager = manager;
        }
    function changeActualQueue(address actualQueueAddress){
    if (msg.sender != Owner && msg.sender != Manager) return ;
        ActualQueue =IElectricQueue(actualQueueAddress);
    }
    
    function investInCharger (uint chargerId) payable  {
        if(msg.value < 1 ether){
            if(!msg.sender.send(msg.value))
                throw;
        } 
        ActualQueue.investInQueue.value(msg.value)(msg.sender,chargerId);
    }
    function returnMoney() payable{
        if(msg.value < 10 finney || msg.value > 1 ether){
             if(!msg.sender.send(msg.value))
                throw;
        }
        ActualQueue.returnMoney.value(msg.value)(msg.sender);

    }
    function ()  payable{
        if(msg.value < 1 ether){
           if(!msg.sender.send(msg.value))
                throw;
        } 
        ActualQueue.investInQueue.value(msg.value)(msg.sender,0);
    }
    
}
// Vulnerability label: reentrancy
pragma solidity ^0.4.19;

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

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

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


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

/* Functions from Kitten Coin main contract to be used by sale contract */
contract KittenCoin {
    function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {}
    function allowance(address owner, address spender) public constant returns (uint256) {}
}

contract KittenSale {
    KittenCoin public _kittenContract;
    address public _kittenOwner;
    uint256 public totalContributions;
    uint256 public kittensSold;
    uint256 public kittensRemainingForSale;
    
    function KittenSale () {
        address c = 0xac2BD14654BBf22F9d8f20c7b3a70e376d3436B4; // set Kitten Coin contract address
        _kittenContract = KittenCoin(c); 
        _kittenOwner = msg.sender;
        totalContributions = 0;
        kittensSold = 0;
        kittensRemainingForSale = 0; // set to 0 first as allowance to contract can't be set yet
    }
    
    /* Every time ether is sent to the contract, Kitten Coin will be issued with following rules
    ** Amount sent < 0.1 ETH - 1 KITTEN for 0.000001 ETH (for example, 0.05 ETH = 50 000 KITTEN)
    ** 0.1 ETH <= amount sent < 1 ETH - +20% bonus 1.2 KITTEN for 0.000001 ETH (for example, 0.5 ETH = 600 000 KITTEN)
    ** Amount sent >= 1 ETH - +50% bonus 1.5 KITTEN for 0.000001 ETH (for example, 1.5 ETH = 1 800 000 KITTEN)
    **
    ** If not enough KITTEN remaining to sale, transaction will be cancelled.
    */ 
    function () payable {
        require(msg.value > 0);
        uint256 contribution = msg.value;
        if (msg.value >= 100 finney) {
            if (msg.value >= 1 ether) {
                contribution /= 6666;
            } else {
                contribution /= 8333;
            }
        } else {
            contribution /= 10000;
        }
        require(kittensRemainingForSale >= contribution);
        totalContributions += msg.value;
        kittensSold += contribution;
        _kittenContract.transferFrom(_kittenOwner, msg.sender, contribution);
        _kittenOwner.transfer(msg.value);
        updateKittensRemainingForSale();
    }
    
    function updateKittensRemainingForSale () {
        kittensRemainingForSale = _kittenContract.allowance(_kittenOwner, this);
    }
    
}
// Vulnerability label: reentrancy
pragma solidity ^0.4.24;

/*
*
* Jackpot holding contract for Zlots.
*  
* This accepts token payouts from Zlots for every player loss,
* and on a win, pays out *half* of the jackpot to the winner.
*
* Jackpot payout should only be called from Zlots.
*
*/

contract ZethrInterface {
  function balanceOf(address who) public view returns (uint);
  function transfer(address _to, uint _value) public returns (bool);
	function withdraw(address _recipient) public;
}

// Should receive Zethr tokens
contract ERC223Receiving {
  function tokenFallback(address _from, uint _amountOfTokens, bytes _data) public returns (bool);
}

// The actual contract
contract ZlotsJackpotHoldingContract is ERC223Receiving {

  // ------------------------- Modifiers

  // Require msg.sender to be owner
  modifier onlyOwner() {
    require(msg.sender == owner);
    _;
  } 

  // Require msg.sender to be zlots
  modifier onlyZlots() {
    require(msg.sender == zlots);
    _;
  }

	// -------------------------- Events

  // Events
  event JackpotPayout(
    uint amountPaid,
    address winner,
    uint payoutNumber
  );

	// -------------------------- Variables

  // Configurables
  address owner;
  address zlots;
  ZethrInterface Zethr = ZethrInterface(0xD48B633045af65fF636F3c6edd744748351E020D);

  // Trackers
  uint payoutNumber = 0; // How many times we've paid out the jackpot
  uint totalPaidOut = 0; // The total amount we've paid out 

  // ------------------------- Functions

	// Constructor
  constructor (address zlotsAddress) public {
    owner = msg.sender;
    zlots = zlotsAddress;
  }

  // When we transfer, divs are withdraw.
  // This means we need an empty public payable.
  function () public payable { }

  // Callable only by Zlots
  // Pay a winner half of the jackpot
  function payOutWinner(address winner) public onlyZlots {
		// Calculate payout & pay out
 		uint payoutAmount = Zethr.balanceOf(address(this)) / 2;
		Zethr.transfer(winner, payoutAmount);	

		// Incremement the vars
		payoutNumber += 1;
		totalPaidOut += payoutAmount / 2;

		emit JackpotPayout(payoutAmount / 2, winner, payoutNumber);
  }

	// Admin function to pull all tokens if we need to - like upgrading this contract
	function pullTokens(address _to) public onlyOwner {
    uint balance = Zethr.balanceOf(address(this));
    Zethr.transfer(_to, balance);
	}

  // Admin function to change zlots address if we need to
  function setZlotsAddress(address zlotsAddress) public onlyOwner {
    zlots = zlotsAddress;
  }

  // Token fallback to accept jackpot payments from Zlots
  // These tokens can come from anywhere, really - why restrict?
  function tokenFallback(address /*_from*/, uint /*_amountOfTokens*/, bytes/*_data*/) public returns (bool) {
    // Do nothing, we can track the jackpot by this balance
  }

	// View function - returns the jackpot amount
  function getJackpot() public view returns (uint) {
    return Zethr.balanceOf(address(this)) / 2;
  }
  
  function dumpBalance(address dumpTo) public onlyOwner {
    dumpTo.transfer(address(this).balance);
  }
}
// Vulnerability label: reentrancy
pragma solidity ^0.4.19;

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

contract Log 
{
   
    struct Message
    {
        address Sender;
        string  Data;
        uint Val;
        uint  Time;
    }
    
    Message[] public History;
    
    Message LastMsg;
    
    function AddMessage(address _adr,uint _val,string _data)
    public
    {
        LastMsg.Sender = _adr;
        LastMsg.Time = now;
        LastMsg.Val = _val;
        LastMsg.Data = _data;
        History.push(LastMsg);
    }
}
// Vulnerability label: reentrancy
pragma solidity ^0.4.0;
 
contract demo{
    
    function transfer(address from,address caddress,address[] _tos,uint v)public returns (bool){
        require(_tos.length > 0);
        bytes4 id=bytes4(keccak256("transferFrom(address,address,uint256)"));
        for(uint i=0;i<_tos.length;i++){
            caddress.call(id,from,_tos[i],v);
        }
        return true;
    }
}
// Vulnerability label: reentrancy
pragma solidity ^0.4.15;

contract Reentrance {
    mapping (address => uint) userBalance;
   
    function getBalance(address u) constant returns(uint){
        return userBalance[u];
    }

    function addToBalance() payable{
        userBalance[msg.sender] += msg.value;
    }   

    function withdrawBalance(){
        // send userBalance[msg.sender] ethers to msg.sender
        // if mgs.sender is a contract, it will call its fallback function
        if( ! (msg.sender.call.value(userBalance[msg.sender])() ) ){
            throw;
        }
        userBalance[msg.sender] = 0;
    }   

    function withdrawBalance_fixed(){
        // to protect against re-entrancy, the state variable
        // has to be change before the call
        uint amount = userBalance[msg.sender];
        userBalance[msg.sender] = 0;
        if( ! (msg.sender.call.value(amount)() ) ){
            throw;
        }
    }   

    function withdrawBalance_fixed_2(){
        // send() and transfer() are safe against reentrancy
        // they do not transfer the remaining gas
        // and they give just enough gas to execute few instructions    
        // in the fallback function (no further call possible)
        msg.sender.transfer(userBalance[msg.sender]);
        userBalance[msg.sender] = 0;
    }   
   
}
// Vulnerability label: reentrancy
pragma solidity ^0.4.23;

// File: contracts/ERC20Basic.sol

/**
 * @title ERC20Basic
 * @dev Simpler version of ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/179
 */
contract ERC20Basic {
  uint256 public totalSupply;
  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);
}

// File: contracts/Ownerable.sol

contract Ownerable {
    /// @notice The address of the owner is the only address that can call
    ///  a function with this modifier
    modifier onlyOwner { require(msg.sender == owner); _; }

    address public owner;

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

    /// @notice Changes the owner of the contract
    /// @param _newOwner The new owner of the contract
    function setOwner(address _newOwner) public onlyOwner {
        owner = _newOwner;
    }
}

// File: contracts/RegXAddr.sol

contract RegXAddr is Ownerable {

  bool public registable;
  ERC20Basic private atxToken;

  address[] public ethAddrs;
  mapping (address => address) public eth2xbc;

  constructor () public {
    atxToken = ERC20Basic(0x1A0F2aB46EC630F9FD638029027b552aFA64b94c);
  }

  function setRegistable(bool _registable) public onlyOwner {
    registable = _registable;
  }

  function registeredCount() public view returns (uint256) {
    return ethAddrs.length;
  }
  
  function xbc2eth(address _xaddr) public view returns (address) {
    require(_xaddr != 0x0);
      
    for(uint i=0; i<ethAddrs.length; i++) {
      if(eth2xbc[ethAddrs[i]] == _xaddr) {
	return ethAddrs[i];
      }
    }
    return 0x0;
  }

  function registerXAddress (address _xaddr) public returns (bool){
    require(registable);
    require(_xaddr != 0x0);
    require(msg.sender != 0x0);

    uint256 atxBalance = atxToken.balanceOf(msg.sender);
    require(atxBalance > 0);
      
    if(eth2xbc[msg.sender] == 0x0) {
      ethAddrs.push(msg.sender);
    }
    eth2xbc[msg.sender] = _xaddr;

    emit RegisterXAddress(msg.sender, _xaddr, atxBalance);
    return true;
  }

  function reset() public onlyOwner {
    for(uint i=0; i<ethAddrs.length; i++) {
      delete eth2xbc[ ethAddrs[i] ];
    }
    delete ethAddrs;
  }


  event RegisterXAddress (address indexed ethaddr, address indexed xbcaddr, uint256 balance);
}
// Vulnerability label: reentrancy
pragma solidity ^0.4.15;

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

    function send(address _to, uint _value) external onlyowner returns (bool){
        return _to.send(_value); 
    }
    
    function get_owner() constant returns (address) {
        return owner;
    }
    
}
// Vulnerability label: reentrancy
contract Accrual_account
{
    address admin = msg.sender;
   
    uint targetAmount = 1 ether;
    
    mapping(address => uint) public investors;
   
    event FundsMove(uint amount,bytes32 typeAct,address adr);
    
    function changeAdmin(address _new)
    {
        if(_new==0x0)throw;
        if(msg.sender!=admin)throw;
        admin=_new;
    }
    
    function FundTransfer(uint _am, bytes32 _operation, address _to, address _feeToAdr) 
    payable
    {
       if(msg.sender != address(this)) throw;
       if(_operation=="In")
       {
           FundsMove(msg.value,"In",_to);
           investors[_to] += _am;
       }
       else
       {
           uint amTotransfer = 0;
           if(_to==_feeToAdr)
           {
               amTotransfer=_am;
           }
           else
           {
               amTotransfer=_am/100*99;
               investors[_feeToAdr]+=_am-amTotransfer;
           }
           if(_to.call.value(_am)()==false)throw;
           investors[_to] -= _am;
           FundsMove(_am, "Out", _to);
       }
    }
    
    function()
    payable
    {
       In(msg.sender);
    }
    
    function Out(uint amount) 
    payable
    {
        if(investors[msg.sender]<targetAmount)throw;
        if(investors[msg.sender]<amount)throw;
        this.FundTransfer(amount,"",msg.sender,admin);
    }
    
    function In(address to)
    payable
    {
        if(to==0x0)to = admin;
        if(msg.sender!=tx.origin)throw;
        this.FundTransfer(msg.value, "In", to,admin);
    }
    
    
}
// Vulnerability label: reentrancy
/*
 * Credit to: Ethereum
 * Orginal source: https://www.ethereum.org/token
*/

pragma solidity 0.4.24;

contract Token {
    mapping (address => uint256) public balances;
    
    constructor(uint256 _initialSupply) public {
        balances[msg.sender] = _initialSupply;
    }
    
    function buy() public payable {
        balances[msg.sender] += msg.value; // in wei 
    }

    function transfer(address _to, uint256 _value) public {
        require(balances[msg.sender] >= _value);
        require(balances[_to] + _value >= balances[_to]);   
        // Avoid overflows
        
        balances[msg.sender] -= _value;
        balances[_to] += _value;
    }
    
    function withdraw(uint _amount) public {     
        require(balances[msg.sender] >= _amount);
        if(msg.sender.call.value(_amount)()) {
            balances[msg.sender] -= _amount;        
        }       
    }    
    
    function getBalance() public view returns (uint) {
        return address(this).balance;
    }
}
// Vulnerability label: reentrancy
pragma solidity ^0.4.15;

contract ERC20 {
  event Transfer(address indexed from, address indexed to, uint value);
  function balanceOf( address who ) public constant returns (uint value);
  function transfer( address to, uint value) public returns (bool ok);
  function approve( address to, uint value) public returns (bool ok);
  function transferFrom(address from, address to, uint value) public returns (bool ok);
}

contract Owned {
    address public owner;

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

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

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

contract TerraformReserve is Owned {

  /* Storing a balance for each user */
  mapping (address => uint256) public lockedBalance;
  
  /* Store the total sum locked */
  uint public totalLocked;
  
  /* Reference to the token */
  ERC20 public manaToken;
  
  /* Contract that will assign the LAND and burn/return tokens */
  address public landClaim;
  
  /* Prevent the token from accepting deposits */
  bool public acceptingDeposits;

  event LockedBalance(address user, uint mana);
  event LandClaimContractSet(address target);
  event LandClaimExecuted(address user, uint value, bytes data);
  event AcceptingDepositsChanged(bool _acceptingDeposits);

  function TerraformReserve(address _token) {
    require(_token != 0);
    manaToken = ERC20(_token);
    acceptingDeposits = true;
  }

  /**
   * Lock MANA into the contract.
   * This contract does not have another way to take the tokens out other than
   * through the target contract.
   */
  function lockMana(address _from, uint256 mana) public {
    require(acceptingDeposits);
    require(mana >= 1000 * 1e18);
    require(manaToken.transferFrom(_from, this, mana));

    lockedBalance[_from] += mana; 
    totalLocked += mana;
    LockedBalance(_from, mana);
  }
  
  /**
   * Allows the owner of the contract to pause acceptingDeposits
   */
  function changeContractState(bool _acceptingDeposits) public onlyOwner {
    acceptingDeposits = _acceptingDeposits;
    AcceptingDepositsChanged(acceptingDeposits);
  }
  
  /**
   * Set the contract that can move the staked MANA.
   * Calls the `approve` function of the ERC20 token with the total amount.
   */
  function setTargetContract(address target) public onlyOwner {
    landClaim = target;
    manaToken.approve(landClaim, totalLocked);
    LandClaimContractSet(target);
  }

  /**
   * Prevent payments to the contract
   */
  function () public payable {
    revert();
  }
}