ETH Price: $3,391.66 (-1.30%)
Gas: 3 Gwei

Contract

0xa17f2bc6b11b4Dd60ab38C94E7784634646749c9
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Burn Remaining T...53810052018-04-04 20:15:072277 days ago1522872907IN
0xa17f2bc6...4646749c9
0 ETH0.000066712.5
Withdraw Balance53810012018-04-04 20:14:252277 days ago1522872865IN
0xa17f2bc6...4646749c9
0 ETH0.000075962.5
Change Stage53809952018-04-04 20:13:322277 days ago1522872812IN
0xa17f2bc6...4646749c9
0 ETH0.00007022.5
Finalize Investo...53808492018-04-04 19:39:272277 days ago1522870767IN
0xa17f2bc6...4646749c9
0 ETH0.002808552.5
Finalize Investo...53808472018-04-04 19:39:082277 days ago1522870748IN
0xa17f2bc6...4646749c9
0 ETH0.006456072.5
Finalize Investo...53808452018-04-04 19:38:212277 days ago1522870701IN
0xa17f2bc6...4646749c9
0 ETH0.006493332.5
Finalize Investo...53808442018-04-04 19:38:152277 days ago1522870695IN
0xa17f2bc6...4646749c9
0 ETH0.006494212.5
Finalize Investo...53808422018-04-04 19:37:362277 days ago1522870656IN
0xa17f2bc6...4646749c9
0 ETH0.006512562.5
Add Whitelist Ad...53802732018-04-04 17:21:292277 days ago1522862489IN
0xa17f2bc6...4646749c9
0 ETH0.002586932.5
Add Whitelist Ad...53802632018-04-04 17:19:232277 days ago1522862363IN
0xa17f2bc6...4646749c9
0 ETH0.005939752.5
Add Whitelist Ad...53802602018-04-04 17:18:132277 days ago1522862293IN
0xa17f2bc6...4646749c9
0 ETH0.005939272.5
Add Whitelist Ad...53802522018-04-04 17:16:032277 days ago1522862163IN
0xa17f2bc6...4646749c9
0 ETH0.005941032.5
Add Whitelist Ad...53801712018-04-04 16:51:442277 days ago1522860704IN
0xa17f2bc6...4646749c9
0 ETH0.005940232.5
Change Stage52175612018-03-08 8:43:292305 days ago1520498609IN
0xa17f2bc6...4646749c9
0 ETH0.000168486
__callback52171512018-03-08 7:04:332305 days ago1520492673IN
0xa17f2bc6...4646749c9
0 ETH0.000352696.5
__callback52171112018-03-08 6:53:502305 days ago1520492030IN
0xa17f2bc6...4646749c9
0 ETH0.000643586.5
__callback52170642018-03-08 6:43:072305 days ago1520491387IN
0xa17f2bc6...4646749c9
0 ETH0.000643586.5
__callback52170212018-03-08 6:32:412305 days ago1520490761IN
0xa17f2bc6...4646749c9
0 ETH0.000643586.5
__callback52169832018-03-08 6:21:272305 days ago1520490087IN
0xa17f2bc6...4646749c9
0 ETH0.000643586.5
__callback52169342018-03-08 6:10:402305 days ago1520489440IN
0xa17f2bc6...4646749c9
0 ETH0.000643166.5
__callback52168822018-03-08 5:59:402305 days ago1520488780IN
0xa17f2bc6...4646749c9
0 ETH0.000643586.5
__callback52168412018-03-08 5:48:342305 days ago1520488114IN
0xa17f2bc6...4646749c9
0 ETH0.000643586.5
__callback52167912018-03-08 5:36:462305 days ago1520487406IN
0xa17f2bc6...4646749c9
0 ETH0.000643586.5
__callback52167402018-03-08 5:26:082305 days ago1520486768IN
0xa17f2bc6...4646749c9
0 ETH0.000643166.5
__callback52166932018-03-08 5:15:262305 days ago1520486126IN
0xa17f2bc6...4646749c9
0 ETH0.000643586.5
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To Value
53810012018-04-04 20:14:252277 days ago1522872865
0xa17f2bc6...4646749c9
0.5461216 ETH
52171152018-03-08 6:55:112305 days ago1520492111
0xa17f2bc6...4646749c9
1 ETH
52171152018-03-08 6:55:112305 days ago1520492111
0xa17f2bc6...4646749c9
1 ETH
52171112018-03-08 6:53:502305 days ago1520492030
0xa17f2bc6...4646749c9
0.0009543 ETH
52170642018-03-08 6:43:072305 days ago1520491387
0xa17f2bc6...4646749c9
0.0009543 ETH
52170212018-03-08 6:32:412305 days ago1520490761
0xa17f2bc6...4646749c9
0.0009543 ETH
52169832018-03-08 6:21:272305 days ago1520490087
0xa17f2bc6...4646749c9
0.0009543 ETH
52169342018-03-08 6:10:402305 days ago1520489440
0xa17f2bc6...4646749c9
0.0009543 ETH
52168822018-03-08 5:59:402305 days ago1520488780
0xa17f2bc6...4646749c9
0.0009543 ETH
52168412018-03-08 5:48:342305 days ago1520488114
0xa17f2bc6...4646749c9
0.0009543 ETH
52167912018-03-08 5:36:462305 days ago1520487406
0xa17f2bc6...4646749c9
0.0009543 ETH
52167912018-03-08 5:36:462305 days ago1520487406
0xa17f2bc6...4646749c9
1 ETH
52167912018-03-08 5:36:462305 days ago1520487406
0xa17f2bc6...4646749c9
1 ETH
52167402018-03-08 5:26:082305 days ago1520486768
0xa17f2bc6...4646749c9
0.0009543 ETH
52166932018-03-08 5:15:262305 days ago1520486126
0xa17f2bc6...4646749c9
0.0009543 ETH
52166552018-03-08 5:04:512305 days ago1520485491
0xa17f2bc6...4646749c9
0.0009543 ETH
52165782018-03-08 4:42:192305 days ago1520484139
0xa17f2bc6...4646749c9
0.0009543 ETH
52165272018-03-08 4:30:112305 days ago1520483411
0xa17f2bc6...4646749c9
0.0009543 ETH
52164812018-03-08 4:19:362305 days ago1520482776
0xa17f2bc6...4646749c9
0.0009543 ETH
52164392018-03-08 4:09:012305 days ago1520482141
0xa17f2bc6...4646749c9
0.0009543 ETH
52163892018-03-08 3:58:362305 days ago1520481516
0xa17f2bc6...4646749c9
0.0009543 ETH
52163422018-03-08 3:47:522305 days ago1520480872
0xa17f2bc6...4646749c9
0.0009543 ETH
52163012018-03-08 3:37:242305 days ago1520480244
0xa17f2bc6...4646749c9
0.0009543 ETH
52162532018-03-08 3:27:002305 days ago1520479620
0xa17f2bc6...4646749c9
0.0009543 ETH
52162092018-03-08 3:16:232305 days ago1520478983
0xa17f2bc6...4646749c9
0.0009543 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PreIco

Compiler Version
v0.4.19+commit.c4cbbb05

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2018-02-28
*/

pragma solidity ^0.4.18;

/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
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;
  }
}

/// @title Base Token contract - Functions to be implemented by token contracts.
contract Token {
    /*
     * Implements ERC 20 standard.
     * https://github.com/ethereum/EIPs/blob/f90864a3d2b2b45c4decf95efd26b3f0c276051a/EIPS/eip-20-token-standard.md
     * https://github.com/ethereum/EIPs/issues/20
     *
     *  Added support for the ERC 223 "tokenFallback" method in a "transfer" function with a payload.
     *  https://github.com/ethereum/EIPs/issues/223
     */

    /*
     * ERC 20
     */
    function balanceOf(address _owner) public constant returns (uint256 balance);
    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);
    function allowance(address _owner, address _spender) public constant returns (uint256 remaining);
    function burn(uint num) public;

    /*
     * ERC 223
     */
    function transfer(address _to, uint256 _value, bytes _data) public returns (bool success);

    /*
     * Events
     */
    event Transfer(address indexed _from, address indexed _to, uint256 _value);
    event Approval(address indexed _owner, address indexed _spender, uint256 _value);
    event Burn(address indexed _burner, uint _value);

    // There is no ERC223 compatible Transfer event, with `_data` included.
}

// <ORACLIZE_API>
/*
Copyright (c) 2015-2016 Oraclize SRL
Copyright (c) 2016 Oraclize LTD



Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:



The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.



THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

// This api is currently targeted at 0.4.18, please import oraclizeAPI_pre0.4.sol or oraclizeAPI_0.4 where necessary
pragma solidity ^0.4.18;

contract OraclizeI {
    address public cbAddress;
    function query(uint _timestamp, string _datasource, string _arg) external payable returns (bytes32 _id);
    function query_withGasLimit(uint _timestamp, string _datasource, string _arg, uint _gaslimit) external payable returns (bytes32 _id);
    function query2(uint _timestamp, string _datasource, string _arg1, string _arg2) public payable returns (bytes32 _id);
    function query2_withGasLimit(uint _timestamp, string _datasource, string _arg1, string _arg2, uint _gaslimit) external payable returns (bytes32 _id);
    function queryN(uint _timestamp, string _datasource, bytes _argN) public payable returns (bytes32 _id);
    function queryN_withGasLimit(uint _timestamp, string _datasource, bytes _argN, uint _gaslimit) external payable returns (bytes32 _id);
    function getPrice(string _datasource) public returns (uint _dsprice);
    function getPrice(string _datasource, uint gaslimit) public returns (uint _dsprice);
    function setProofType(byte _proofType) external;
    function setCustomGasPrice(uint _gasPrice) external;
    function randomDS_getSessionPubKeyHash() external constant returns(bytes32);
}
contract OraclizeAddrResolverI {
    function getAddress() public returns (address _addr);
}
contract usingOraclize {
    uint constant day = 60*60*24;
    uint constant week = 60*60*24*7;
    uint constant month = 60*60*24*30;
    byte constant proofType_NONE = 0x00;
    byte constant proofType_TLSNotary = 0x10;
    byte constant proofType_Android = 0x20;
    byte constant proofType_Ledger = 0x30;
    byte constant proofType_Native = 0xF0;
    byte constant proofStorage_IPFS = 0x01;
    uint8 constant networkID_auto = 0;
    uint8 constant networkID_mainnet = 1;
    uint8 constant networkID_testnet = 2;
    uint8 constant networkID_morden = 2;
    uint8 constant networkID_consensys = 161;

    OraclizeAddrResolverI OAR;

    OraclizeI oraclize;
    modifier oraclizeAPI {
        if((address(OAR)==0)||(getCodeSize(address(OAR))==0))
            oraclize_setNetwork(networkID_auto);

        if(address(oraclize) != OAR.getAddress())
            oraclize = OraclizeI(OAR.getAddress());

        _;
    }
    modifier coupon(string code){
        oraclize = OraclizeI(OAR.getAddress());
        _;
    }

    function oraclize_setNetwork(uint8 networkID) internal returns(bool){
      return oraclize_setNetwork();
      networkID; // silence the warning and remain backwards compatible
    }
    function oraclize_setNetwork() internal returns(bool){
        if (getCodeSize(0x1d3B2638a7cC9f2CB3D298A3DA7a90B67E5506ed)>0){ //mainnet
            OAR = OraclizeAddrResolverI(0x1d3B2638a7cC9f2CB3D298A3DA7a90B67E5506ed);
            oraclize_setNetworkName("eth_mainnet");
            return true;
        }
        if (getCodeSize(0xc03A2615D5efaf5F49F60B7BB6583eaec212fdf1)>0){ //ropsten testnet
            OAR = OraclizeAddrResolverI(0xc03A2615D5efaf5F49F60B7BB6583eaec212fdf1);
            oraclize_setNetworkName("eth_ropsten3");
            return true;
        }
        if (getCodeSize(0xB7A07BcF2Ba2f2703b24C0691b5278999C59AC7e)>0){ //kovan testnet
            OAR = OraclizeAddrResolverI(0xB7A07BcF2Ba2f2703b24C0691b5278999C59AC7e);
            oraclize_setNetworkName("eth_kovan");
            return true;
        }
        if (getCodeSize(0x146500cfd35B22E4A392Fe0aDc06De1a1368Ed48)>0){ //rinkeby testnet
            OAR = OraclizeAddrResolverI(0x146500cfd35B22E4A392Fe0aDc06De1a1368Ed48);
            oraclize_setNetworkName("eth_rinkeby");
            return true;
        }
        if (getCodeSize(0x6f485C8BF6fc43eA212E93BBF8ce046C7f1cb475)>0){ //ethereum-bridge
            OAR = OraclizeAddrResolverI(0x6f485C8BF6fc43eA212E93BBF8ce046C7f1cb475);
            return true;
        }
        if (getCodeSize(0x20e12A1F859B3FeaE5Fb2A0A32C18F5a65555bBF)>0){ //ether.camp ide
            OAR = OraclizeAddrResolverI(0x20e12A1F859B3FeaE5Fb2A0A32C18F5a65555bBF);
            return true;
        }
        if (getCodeSize(0x51efaF4c8B3C9AfBD5aB9F4bbC82784Ab6ef8fAA)>0){ //browser-solidity
            OAR = OraclizeAddrResolverI(0x51efaF4c8B3C9AfBD5aB9F4bbC82784Ab6ef8fAA);
            return true;
        }
        return false;
    }

    function __callback(bytes32 myid, string result) public {
        __callback(myid, result, new bytes(0));
    }
    function __callback(bytes32 myid, string result, bytes proof) public {
      return;
      myid; result; proof; // Silence compiler warnings
    }

    function oraclize_getPrice(string datasource) oraclizeAPI internal returns (uint){
        return oraclize.getPrice(datasource);
    }

    function oraclize_getPrice(string datasource, uint gaslimit) oraclizeAPI internal returns (uint){
        return oraclize.getPrice(datasource, gaslimit);
    }

    function oraclize_query(string datasource, string arg) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource);
        if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
        return oraclize.query.value(price)(0, datasource, arg);
    }
    function oraclize_query(uint timestamp, string datasource, string arg) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource);
        if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
        return oraclize.query.value(price)(timestamp, datasource, arg);
    }
    function oraclize_query(uint timestamp, string datasource, string arg, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource, gaslimit);
        if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price
        return oraclize.query_withGasLimit.value(price)(timestamp, datasource, arg, gaslimit);
    }
    function oraclize_query(string datasource, string arg, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource, gaslimit);
        if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price
        return oraclize.query_withGasLimit.value(price)(0, datasource, arg, gaslimit);
    }
    function oraclize_query(string datasource, string arg1, string arg2) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource);
        if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
        return oraclize.query2.value(price)(0, datasource, arg1, arg2);
    }
    function oraclize_query(uint timestamp, string datasource, string arg1, string arg2) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource);
        if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
        return oraclize.query2.value(price)(timestamp, datasource, arg1, arg2);
    }
    function oraclize_query(uint timestamp, string datasource, string arg1, string arg2, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource, gaslimit);
        if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price
        return oraclize.query2_withGasLimit.value(price)(timestamp, datasource, arg1, arg2, gaslimit);
    }
    function oraclize_query(string datasource, string arg1, string arg2, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource, gaslimit);
        if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price
        return oraclize.query2_withGasLimit.value(price)(0, datasource, arg1, arg2, gaslimit);
    }
    function oraclize_query(string datasource, string[] argN) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource);
        if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
        bytes memory args = stra2cbor(argN);
        return oraclize.queryN.value(price)(0, datasource, args);
    }
    function oraclize_query(uint timestamp, string datasource, string[] argN) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource);
        if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
        bytes memory args = stra2cbor(argN);
        return oraclize.queryN.value(price)(timestamp, datasource, args);
    }
    function oraclize_query(uint timestamp, string datasource, string[] argN, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource, gaslimit);
        if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price
        bytes memory args = stra2cbor(argN);
        return oraclize.queryN_withGasLimit.value(price)(timestamp, datasource, args, gaslimit);
    }
    function oraclize_query(string datasource, string[] argN, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource, gaslimit);
        if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price
        bytes memory args = stra2cbor(argN);
        return oraclize.queryN_withGasLimit.value(price)(0, datasource, args, gaslimit);
    }
    function oraclize_query(string datasource, string[1] args) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](1);
        dynargs[0] = args[0];
        return oraclize_query(datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, string[1] args) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](1);
        dynargs[0] = args[0];
        return oraclize_query(timestamp, datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, string[1] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](1);
        dynargs[0] = args[0];
        return oraclize_query(timestamp, datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, string[1] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](1);
        dynargs[0] = args[0];
        return oraclize_query(datasource, dynargs, gaslimit);
    }

    function oraclize_query(string datasource, string[2] args) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](2);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        return oraclize_query(datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, string[2] args) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](2);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        return oraclize_query(timestamp, datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, string[2] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](2);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        return oraclize_query(timestamp, datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, string[2] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](2);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        return oraclize_query(datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, string[3] args) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](3);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        return oraclize_query(datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, string[3] args) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](3);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        return oraclize_query(timestamp, datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, string[3] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](3);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        return oraclize_query(timestamp, datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, string[3] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](3);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        return oraclize_query(datasource, dynargs, gaslimit);
    }

    function oraclize_query(string datasource, string[4] args) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](4);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        return oraclize_query(datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, string[4] args) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](4);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        return oraclize_query(timestamp, datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, string[4] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](4);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        return oraclize_query(timestamp, datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, string[4] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](4);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        return oraclize_query(datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, string[5] args) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](5);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        dynargs[4] = args[4];
        return oraclize_query(datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, string[5] args) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](5);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        dynargs[4] = args[4];
        return oraclize_query(timestamp, datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, string[5] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](5);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        dynargs[4] = args[4];
        return oraclize_query(timestamp, datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, string[5] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](5);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        dynargs[4] = args[4];
        return oraclize_query(datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, bytes[] argN) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource);
        if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
        bytes memory args = ba2cbor(argN);
        return oraclize.queryN.value(price)(0, datasource, args);
    }
    function oraclize_query(uint timestamp, string datasource, bytes[] argN) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource);
        if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
        bytes memory args = ba2cbor(argN);
        return oraclize.queryN.value(price)(timestamp, datasource, args);
    }
    function oraclize_query(uint timestamp, string datasource, bytes[] argN, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource, gaslimit);
        if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price
        bytes memory args = ba2cbor(argN);
        return oraclize.queryN_withGasLimit.value(price)(timestamp, datasource, args, gaslimit);
    }
    function oraclize_query(string datasource, bytes[] argN, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource, gaslimit);
        if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price
        bytes memory args = ba2cbor(argN);
        return oraclize.queryN_withGasLimit.value(price)(0, datasource, args, gaslimit);
    }
    function oraclize_query(string datasource, bytes[1] args) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](1);
        dynargs[0] = args[0];
        return oraclize_query(datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, bytes[1] args) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](1);
        dynargs[0] = args[0];
        return oraclize_query(timestamp, datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, bytes[1] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](1);
        dynargs[0] = args[0];
        return oraclize_query(timestamp, datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, bytes[1] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](1);
        dynargs[0] = args[0];
        return oraclize_query(datasource, dynargs, gaslimit);
    }

    function oraclize_query(string datasource, bytes[2] args) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](2);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        return oraclize_query(datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, bytes[2] args) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](2);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        return oraclize_query(timestamp, datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, bytes[2] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](2);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        return oraclize_query(timestamp, datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, bytes[2] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](2);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        return oraclize_query(datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, bytes[3] args) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](3);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        return oraclize_query(datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, bytes[3] args) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](3);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        return oraclize_query(timestamp, datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, bytes[3] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](3);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        return oraclize_query(timestamp, datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, bytes[3] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](3);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        return oraclize_query(datasource, dynargs, gaslimit);
    }

    function oraclize_query(string datasource, bytes[4] args) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](4);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        return oraclize_query(datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, bytes[4] args) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](4);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        return oraclize_query(timestamp, datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, bytes[4] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](4);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        return oraclize_query(timestamp, datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, bytes[4] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](4);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        return oraclize_query(datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, bytes[5] args) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](5);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        dynargs[4] = args[4];
        return oraclize_query(datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, bytes[5] args) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](5);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        dynargs[4] = args[4];
        return oraclize_query(timestamp, datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, bytes[5] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](5);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        dynargs[4] = args[4];
        return oraclize_query(timestamp, datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, bytes[5] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](5);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        dynargs[4] = args[4];
        return oraclize_query(datasource, dynargs, gaslimit);
    }

    function oraclize_cbAddress() oraclizeAPI internal returns (address){
        return oraclize.cbAddress();
    }
    function oraclize_setProof(byte proofP) oraclizeAPI internal {
        return oraclize.setProofType(proofP);
    }
    function oraclize_setCustomGasPrice(uint gasPrice) oraclizeAPI internal {
        return oraclize.setCustomGasPrice(gasPrice);
    }

    function oraclize_randomDS_getSessionPubKeyHash() oraclizeAPI internal returns (bytes32){
        return oraclize.randomDS_getSessionPubKeyHash();
    }

    function getCodeSize(address _addr) constant internal returns(uint _size) {
        assembly {
            _size := extcodesize(_addr)
        }
    }

    function parseAddr(string _a) internal pure returns (address){
        bytes memory tmp = bytes(_a);
        uint160 iaddr = 0;
        uint160 b1;
        uint160 b2;
        for (uint i=2; i<2+2*20; i+=2){
            iaddr *= 256;
            b1 = uint160(tmp[i]);
            b2 = uint160(tmp[i+1]);
            if ((b1 >= 97)&&(b1 <= 102)) b1 -= 87;
            else if ((b1 >= 65)&&(b1 <= 70)) b1 -= 55;
            else if ((b1 >= 48)&&(b1 <= 57)) b1 -= 48;
            if ((b2 >= 97)&&(b2 <= 102)) b2 -= 87;
            else if ((b2 >= 65)&&(b2 <= 70)) b2 -= 55;
            else if ((b2 >= 48)&&(b2 <= 57)) b2 -= 48;
            iaddr += (b1*16+b2);
        }
        return address(iaddr);
    }

    function strCompare(string _a, string _b) internal pure returns (int) {
        bytes memory a = bytes(_a);
        bytes memory b = bytes(_b);
        uint minLength = a.length;
        if (b.length < minLength) minLength = b.length;
        for (uint i = 0; i < minLength; i ++)
            if (a[i] < b[i])
                return -1;
            else if (a[i] > b[i])
                return 1;
        if (a.length < b.length)
            return -1;
        else if (a.length > b.length)
            return 1;
        else
            return 0;
    }

    function indexOf(string _haystack, string _needle) internal pure returns (int) {
        bytes memory h = bytes(_haystack);
        bytes memory n = bytes(_needle);
        if(h.length < 1 || n.length < 1 || (n.length > h.length))
            return -1;
        else if(h.length > (2**128 -1))
            return -1;
        else
        {
            uint subindex = 0;
            for (uint i = 0; i < h.length; i ++)
            {
                if (h[i] == n[0])
                {
                    subindex = 1;
                    while(subindex < n.length && (i + subindex) < h.length && h[i + subindex] == n[subindex])
                    {
                        subindex++;
                    }
                    if(subindex == n.length)
                        return int(i);
                }
            }
            return -1;
        }
    }

    function strConcat(string _a, string _b, string _c, string _d, string _e) internal pure returns (string) {
        bytes memory _ba = bytes(_a);
        bytes memory _bb = bytes(_b);
        bytes memory _bc = bytes(_c);
        bytes memory _bd = bytes(_d);
        bytes memory _be = bytes(_e);
        string memory abcde = new string(_ba.length + _bb.length + _bc.length + _bd.length + _be.length);
        bytes memory babcde = bytes(abcde);
        uint k = 0;
        for (uint i = 0; i < _ba.length; i++) babcde[k++] = _ba[i];
        for (i = 0; i < _bb.length; i++) babcde[k++] = _bb[i];
        for (i = 0; i < _bc.length; i++) babcde[k++] = _bc[i];
        for (i = 0; i < _bd.length; i++) babcde[k++] = _bd[i];
        for (i = 0; i < _be.length; i++) babcde[k++] = _be[i];
        return string(babcde);
    }

    function strConcat(string _a, string _b, string _c, string _d) internal pure returns (string) {
        return strConcat(_a, _b, _c, _d, "");
    }

    function strConcat(string _a, string _b, string _c) internal pure returns (string) {
        return strConcat(_a, _b, _c, "", "");
    }

    function strConcat(string _a, string _b) internal pure returns (string) {
        return strConcat(_a, _b, "", "", "");
    }

    // parseInt
    function parseInt(string _a) internal pure returns (uint) {
        return parseInt(_a, 0);
    }

    // parseInt(parseFloat*10^_b)
    function parseInt(string _a, uint _b) internal pure returns (uint) {
        bytes memory bresult = bytes(_a);
        uint mint = 0;
        bool decimals = false;
        for (uint i=0; i<bresult.length; i++){
            if ((bresult[i] >= 48)&&(bresult[i] <= 57)){
                if (decimals){
                   if (_b == 0) break;
                    else _b--;
                }
                mint *= 10;
                mint += uint(bresult[i]) - 48;
            } else if (bresult[i] == 46) decimals = true;
        }
        if (_b > 0) mint *= 10**_b;
        return mint;
    }

    function uint2str(uint i) internal pure returns (string){
        if (i == 0) return "0";
        uint j = i;
        uint len;
        while (j != 0){
            len++;
            j /= 10;
        }
        bytes memory bstr = new bytes(len);
        uint k = len - 1;
        while (i != 0){
            bstr[k--] = byte(48 + i % 10);
            i /= 10;
        }
        return string(bstr);
    }

    function stra2cbor(string[] arr) internal pure returns (bytes) {
            uint arrlen = arr.length;

            // get correct cbor output length
            uint outputlen = 0;
            bytes[] memory elemArray = new bytes[](arrlen);
            for (uint i = 0; i < arrlen; i++) {
                elemArray[i] = (bytes(arr[i]));
                outputlen += elemArray[i].length + (elemArray[i].length - 1)/23 + 3; //+3 accounts for paired identifier types
            }
            uint ctr = 0;
            uint cborlen = arrlen + 0x80;
            outputlen += byte(cborlen).length;
            bytes memory res = new bytes(outputlen);

            while (byte(cborlen).length > ctr) {
                res[ctr] = byte(cborlen)[ctr];
                ctr++;
            }
            for (i = 0; i < arrlen; i++) {
                res[ctr] = 0x5F;
                ctr++;
                for (uint x = 0; x < elemArray[i].length; x++) {
                    // if there's a bug with larger strings, this may be the culprit
                    if (x % 23 == 0) {
                        uint elemcborlen = elemArray[i].length - x >= 24 ? 23 : elemArray[i].length - x;
                        elemcborlen += 0x40;
                        uint lctr = ctr;
                        while (byte(elemcborlen).length > ctr - lctr) {
                            res[ctr] = byte(elemcborlen)[ctr - lctr];
                            ctr++;
                        }
                    }
                    res[ctr] = elemArray[i][x];
                    ctr++;
                }
                res[ctr] = 0xFF;
                ctr++;
            }
            return res;
        }

    function ba2cbor(bytes[] arr) internal pure returns (bytes) {
            uint arrlen = arr.length;

            // get correct cbor output length
            uint outputlen = 0;
            bytes[] memory elemArray = new bytes[](arrlen);
            for (uint i = 0; i < arrlen; i++) {
                elemArray[i] = (bytes(arr[i]));
                outputlen += elemArray[i].length + (elemArray[i].length - 1)/23 + 3; //+3 accounts for paired identifier types
            }
            uint ctr = 0;
            uint cborlen = arrlen + 0x80;
            outputlen += byte(cborlen).length;
            bytes memory res = new bytes(outputlen);

            while (byte(cborlen).length > ctr) {
                res[ctr] = byte(cborlen)[ctr];
                ctr++;
            }
            for (i = 0; i < arrlen; i++) {
                res[ctr] = 0x5F;
                ctr++;
                for (uint x = 0; x < elemArray[i].length; x++) {
                    // if there's a bug with larger strings, this may be the culprit
                    if (x % 23 == 0) {
                        uint elemcborlen = elemArray[i].length - x >= 24 ? 23 : elemArray[i].length - x;
                        elemcborlen += 0x40;
                        uint lctr = ctr;
                        while (byte(elemcborlen).length > ctr - lctr) {
                            res[ctr] = byte(elemcborlen)[ctr - lctr];
                            ctr++;
                        }
                    }
                    res[ctr] = elemArray[i][x];
                    ctr++;
                }
                res[ctr] = 0xFF;
                ctr++;
            }
            return res;
        }


    string oraclize_network_name;
    function oraclize_setNetworkName(string _network_name) internal {
        oraclize_network_name = _network_name;
    }

    function oraclize_getNetworkName() internal view returns (string) {
        return oraclize_network_name;
    }

    function oraclize_newRandomDSQuery(uint _delay, uint _nbytes, uint _customGasLimit) internal returns (bytes32){
        require((_nbytes > 0) && (_nbytes <= 32));
        bytes memory nbytes = new bytes(1);
        nbytes[0] = byte(_nbytes);
        bytes memory unonce = new bytes(32);
        bytes memory sessionKeyHash = new bytes(32);
        bytes32 sessionKeyHash_bytes32 = oraclize_randomDS_getSessionPubKeyHash();
        assembly {
            mstore(unonce, 0x20)
            mstore(add(unonce, 0x20), xor(blockhash(sub(number, 1)), xor(coinbase, timestamp)))
            mstore(sessionKeyHash, 0x20)
            mstore(add(sessionKeyHash, 0x20), sessionKeyHash_bytes32)
        }
        bytes[3] memory args = [unonce, nbytes, sessionKeyHash];
        bytes32 queryId = oraclize_query(_delay, "random", args, _customGasLimit);
        oraclize_randomDS_setCommitment(queryId, keccak256(bytes8(_delay), args[1], sha256(args[0]), args[2]));
        return queryId;
    }

    function oraclize_randomDS_setCommitment(bytes32 queryId, bytes32 commitment) internal {
        oraclize_randomDS_args[queryId] = commitment;
    }

    mapping(bytes32=>bytes32) oraclize_randomDS_args;
    mapping(bytes32=>bool) oraclize_randomDS_sessionKeysHashVerified;

    function verifySig(bytes32 tosignh, bytes dersig, bytes pubkey) internal returns (bool){
        bool sigok;
        address signer;

        bytes32 sigr;
        bytes32 sigs;

        bytes memory sigr_ = new bytes(32);
        uint offset = 4+(uint(dersig[3]) - 0x20);
        sigr_ = copyBytes(dersig, offset, 32, sigr_, 0);
        bytes memory sigs_ = new bytes(32);
        offset += 32 + 2;
        sigs_ = copyBytes(dersig, offset+(uint(dersig[offset-1]) - 0x20), 32, sigs_, 0);

        assembly {
            sigr := mload(add(sigr_, 32))
            sigs := mload(add(sigs_, 32))
        }


        (sigok, signer) = safer_ecrecover(tosignh, 27, sigr, sigs);
        if (address(keccak256(pubkey)) == signer) return true;
        else {
            (sigok, signer) = safer_ecrecover(tosignh, 28, sigr, sigs);
            return (address(keccak256(pubkey)) == signer);
        }
    }

    function oraclize_randomDS_proofVerify__sessionKeyValidity(bytes proof, uint sig2offset) internal returns (bool) {
        bool sigok;

        // Step 6: verify the attestation signature, APPKEY1 must sign the sessionKey from the correct ledger app (CODEHASH)
        bytes memory sig2 = new bytes(uint(proof[sig2offset+1])+2);
        copyBytes(proof, sig2offset, sig2.length, sig2, 0);

        bytes memory appkey1_pubkey = new bytes(64);
        copyBytes(proof, 3+1, 64, appkey1_pubkey, 0);

        bytes memory tosign2 = new bytes(1+65+32);
        tosign2[0] = byte(1); //role
        copyBytes(proof, sig2offset-65, 65, tosign2, 1);
        bytes memory CODEHASH = hex"fd94fa71bc0ba10d39d464d0d8f465efeef0a2764e3887fcc9df41ded20f505c";
        copyBytes(CODEHASH, 0, 32, tosign2, 1+65);
        sigok = verifySig(sha256(tosign2), sig2, appkey1_pubkey);

        if (sigok == false) return false;


        // Step 7: verify the APPKEY1 provenance (must be signed by Ledger)
        bytes memory LEDGERKEY = hex"7fb956469c5c9b89840d55b43537e66a98dd4811ea0a27224272c2e5622911e8537a2f8e86a46baec82864e98dd01e9ccc2f8bc5dfc9cbe5a91a290498dd96e4";

        bytes memory tosign3 = new bytes(1+65);
        tosign3[0] = 0xFE;
        copyBytes(proof, 3, 65, tosign3, 1);

        bytes memory sig3 = new bytes(uint(proof[3+65+1])+2);
        copyBytes(proof, 3+65, sig3.length, sig3, 0);

        sigok = verifySig(sha256(tosign3), sig3, LEDGERKEY);

        return sigok;
    }

    modifier oraclize_randomDS_proofVerify(bytes32 _queryId, string _result, bytes _proof) {
        // Step 1: the prefix has to match 'LP\x01' (Ledger Proof version 1)
        require((_proof[0] == "L") && (_proof[1] == "P") && (_proof[2] == 1));

        bool proofVerified = oraclize_randomDS_proofVerify__main(_proof, _queryId, bytes(_result), oraclize_getNetworkName());
        require(proofVerified);

        _;
    }

    function oraclize_randomDS_proofVerify__returnCode(bytes32 _queryId, string _result, bytes _proof) internal returns (uint8){
        // Step 1: the prefix has to match 'LP\x01' (Ledger Proof version 1)
        if ((_proof[0] != "L")||(_proof[1] != "P")||(_proof[2] != 1)) return 1;

        bool proofVerified = oraclize_randomDS_proofVerify__main(_proof, _queryId, bytes(_result), oraclize_getNetworkName());
        if (proofVerified == false) return 2;

        return 0;
    }

    function matchBytes32Prefix(bytes32 content, bytes prefix, uint n_random_bytes) internal pure returns (bool){
        bool match_ = true;
        

        for (uint256 i=0; i< n_random_bytes; i++) {
            if (content[i] != prefix[i]) match_ = false;
        }

        return match_;
    }

    function oraclize_randomDS_proofVerify__main(bytes proof, bytes32 queryId, bytes result, string context_name) internal returns (bool){

        // Step 2: the unique keyhash has to match with the sha256 of (context name + queryId)
        uint ledgerProofLength = 3+65+(uint(proof[3+65+1])+2)+32;
        bytes memory keyhash = new bytes(32);
        copyBytes(proof, ledgerProofLength, 32, keyhash, 0);
        if (!(keccak256(keyhash) == keccak256(sha256(context_name, queryId)))) return false;

        bytes memory sig1 = new bytes(uint(proof[ledgerProofLength+(32+8+1+32)+1])+2);
        copyBytes(proof, ledgerProofLength+(32+8+1+32), sig1.length, sig1, 0);

        // Step 3: we assume sig1 is valid (it will be verified during step 5) and we verify if 'result' is the prefix of sha256(sig1)
        if (!matchBytes32Prefix(sha256(sig1), result, uint(proof[ledgerProofLength+32+8]))) return false;

        // Step 4: commitment match verification, keccak256(delay, nbytes, unonce, sessionKeyHash) == commitment in storage.
        // This is to verify that the computed args match with the ones specified in the query.
        bytes memory commitmentSlice1 = new bytes(8+1+32);
        copyBytes(proof, ledgerProofLength+32, 8+1+32, commitmentSlice1, 0);

        bytes memory sessionPubkey = new bytes(64);
        uint sig2offset = ledgerProofLength+32+(8+1+32)+sig1.length+65;
        copyBytes(proof, sig2offset-64, 64, sessionPubkey, 0);

        bytes32 sessionPubkeyHash = sha256(sessionPubkey);
        if (oraclize_randomDS_args[queryId] == keccak256(commitmentSlice1, sessionPubkeyHash)){ //unonce, nbytes and sessionKeyHash match
            delete oraclize_randomDS_args[queryId];
        } else return false;


        // Step 5: validity verification for sig1 (keyhash and args signed with the sessionKey)
        bytes memory tosign1 = new bytes(32+8+1+32);
        copyBytes(proof, ledgerProofLength, 32+8+1+32, tosign1, 0);
        if (!verifySig(sha256(tosign1), sig1, sessionPubkey)) return false;

        // verify if sessionPubkeyHash was verified already, if not.. let's do it!
        if (oraclize_randomDS_sessionKeysHashVerified[sessionPubkeyHash] == false){
            oraclize_randomDS_sessionKeysHashVerified[sessionPubkeyHash] = oraclize_randomDS_proofVerify__sessionKeyValidity(proof, sig2offset);
        }

        return oraclize_randomDS_sessionKeysHashVerified[sessionPubkeyHash];
    }

    // the following function has been written by Alex Beregszaszi (@axic), use it under the terms of the MIT license
    function copyBytes(bytes from, uint fromOffset, uint length, bytes to, uint toOffset) internal pure returns (bytes) {
        uint minLength = length + toOffset;

        // Buffer too small
        require(to.length >= minLength); // Should be a better way?

        // NOTE: the offset 32 is added to skip the `size` field of both bytes variables
        uint i = 32 + fromOffset;
        uint j = 32 + toOffset;

        while (i < (32 + fromOffset + length)) {
            assembly {
                let tmp := mload(add(from, i))
                mstore(add(to, j), tmp)
            }
            i += 32;
            j += 32;
        }

        return to;
    }

    // the following function has been written by Alex Beregszaszi (@axic), use it under the terms of the MIT license
    // Duplicate Solidity's ecrecover, but catching the CALL return value
    function safer_ecrecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal returns (bool, address) {
        // We do our own memory management here. Solidity uses memory offset
        // 0x40 to store the current end of memory. We write past it (as
        // writes are memory extensions), but don't update the offset so
        // Solidity will reuse it. The memory used here is only needed for
        // this context.

        // FIXME: inline assembly can't access return values
        bool ret;
        address addr;

        assembly {
            let size := mload(0x40)
            mstore(size, hash)
            mstore(add(size, 32), v)
            mstore(add(size, 64), r)
            mstore(add(size, 96), s)

            // NOTE: we can reuse the request memory because we deal with
            //       the return code
            ret := call(3000, 1, 0, size, 128, size, 32)
            addr := mload(size)
        }

        return (ret, addr);
    }

    // the following function has been written by Alex Beregszaszi (@axic), use it under the terms of the MIT license
    function ecrecovery(bytes32 hash, bytes sig) internal returns (bool, address) {
        bytes32 r;
        bytes32 s;
        uint8 v;

        if (sig.length != 65)
          return (false, 0);

        // The signature format is a compact form of:
        //   {bytes32 r}{bytes32 s}{uint8 v}
        // Compact means, uint8 is not padded to 32 bytes.
        assembly {
            r := mload(add(sig, 32))
            s := mload(add(sig, 64))

            // Here we are loading the last 32 bytes. We exploit the fact that
            // 'mload' will pad with zeroes if we overread.
            // There is no 'mload8' to do this, but that would be nicer.
            v := byte(0, mload(add(sig, 96)))

            // Alternative solution:
            // 'byte' is not working due to the Solidity parser, so lets
            // use the second best option, 'and'
            // v := and(mload(add(sig, 65)), 255)
        }

        // albeit non-transactional signatures are not specified by the YP, one would expect it
        // to match the YP range of [27, 28]
        //
        // geth uses [0, 1] and some clients have followed. This might change, see:
        //  https://github.com/ethereum/go-ethereum/issues/2053
        if (v < 27)
          v += 27;

        if (v != 27 && v != 28)
            return (false, 0);

        return safer_ecrecover(hash, v, r, s);
    }

}
// </ORACLIZE_API>

/**
 * @title pre-ico
 * @dev pre-ico is a base contract for managing a token crowdsale.
 * Crowdsales
 */
contract PreIco is usingOraclize {
  using SafeMath for uint256;

  /**
   * Section 1
   * - Variables
   */
  /* Section 1.1 crowdsale key variables */
  // The token being sold
  Token public token;

  // start and end timestamps where investments are allowed (both inclusive)
  uint256 public startTime;
  uint256 public endTime;

  // address where ETH funds are sent
  address public wallet;

  // owner of this contract
  address public owner;
  // How many PHI tokens to sell (in sphi)
  uint256 public MAX_TOKENS = 3524578 * 10**18;
  // Keep track of sold tokens
  uint256 public tokensSold = 0;
  // Keep track of tokens sent to whitelisted addresses
  uint256 public tokensFinalized = 0;
  // Keep track of enabled addresses
  mapping(address => bool) public reservationContracts;

  /* Section 1.2 rate/price variables */
  // ETH/USD rate
  uint256 public ethUsd;
  /**
    * Phi rate in USD multiplied by 10**18
    * because of Solidity float limitations,
    * see http://solidity.readthedocs.io/en/v0.4.19/types.html?highlight=Fixed%20Point%20Numbers#fixed-point-numbers
    */
  uint256 public phiRate = 1278246852100000000; // pre-ico fixed price (1,61803399 * 21%) * 10**18

  /* Section 1.3 oracle related variables */
  // keep track of the last ETH/USD update
  uint256 public lastOracleUpdate;
  // set default ETH/USD update interval (in seconds)
  uint256 public intervalUpdate;
  // custom oraclize_query gas cost (wei), expected gas usage is ~110k
  uint256 public ORACLIZE_GAS_LIMIT = 145000;

  /* Section 1.4 variables to keep KYC and balance state */
  // amount of raised money in wei
  uint256 public weiRaised;
  // keep track of addresses that are allowed to keep tokens
  mapping(address => bool) public isWhitelisted;
  // keep track of investors (token balance)
  mapping(address => uint256) public balancesToken;
  // keep track of invested amount (wei balance)
  mapping(address => uint256) public balancesWei;

  /**
   * Section 2
   * - Enums
   */
  // Describes current crowdsale stage
  enum Stage
  {
    ToInitialize, // [0] pre-ico has not been initialized
    Waiting,      // [1] pre-ico is waiting start time
    Running,      // [2] pre-ico is running (between start time and end time)
    Paused,       // [3] pre-ico has been paused
    Finished,     // [4] pre-ico has been finished (but not finalized)
    Finalized     // [5] pre-ico has been finalized
  }
  Stage public currentStage = Stage.ToInitialize;

  /**
   * Section 3
   * - Events
   */
  /**
   * event for token purchase logging
   * @param purchaser who paid for the tokens
   * @param beneficiary who got the tokens
   * @param value weis paid for purchase
   * @param amount amount of tokens purchased
   */
  event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);

  /**
   * event to emit when a new rate is received from Oraclize
   * @param newRate Rate received in WEI
   * @param timeRecv When the rate was received
   */
  event LogRateUpdate(uint newRate, uint timeRecv);

  /**
   * event to emit in case the contract needs balance (for Oraclize queries)
   */
  event LogBalanceRequired();

  /**
   * event to notify initialize
   */
   event LogCrowdsaleInit();

  /**
   * Section 4
   * - Modifiers
   */
  /*
    Check if a purchase can be made, check startTime, endTime
    and update Stage if so
  */
  modifier validPurchase {
    bool withinPeriod = now >= startTime && now <= endTime;
    require(msg.value > 0 && withinPeriod && startTime != 0);
    /*
      Update current stage only if the previous stage is `Waiting`
      and we are within the crowdsale period, used to automatically
      update the stage by an investor
    */
    if (withinPeriod == true && currentStage == Stage.Waiting) {
      currentStage = Stage.Running;
    }
    _;
  }
  // Allow only the owner of this contract
  modifier onlyOwner {
    require(msg.sender == owner);
    _;
  }

  // Allow only if is close to start time or if is it running
  modifier closeOrDuringCrowdsale {
    require(now >= startTime - intervalUpdate);
    require(currentStage == Stage.Running || currentStage == Stage.Waiting);
    _;
  }

  // Check if the provided stage is the current one
  modifier mustBeAtStage (Stage stageNeeded) {
    require(stageNeeded == currentStage);
    _;
  }

  // Allow only to proxy from reservation contract
  modifier onlyFromRc () {
    require(reservationContracts[msg.sender] == true);
    _;
  }

  /**
   * @dev Constructor
   * @param _wallet Where to send ETH collected from the pre-ico
   */
  function PreIco(address _wallet) public {
    require(phiRate > 0 && startTime == 0);
    require(_wallet != address(0));

    // update global variable
    wallet = _wallet;
    owner = msg.sender;

    currentStage = Stage.ToInitialize;

    // set Oraclize gas price (for __callback)
    oraclize_setCustomGasPrice(2500000000); // 2.5 gwei instead of 20 gwei
  }

  /**
   * @dev Used to init crowdsale, set start-end time, start usd rate update
   * @notice You must send some ETH to cover the oraclize_query fees
   * @param _startTime Start of the crowdsale (UNIX timestamp)
   * @param _endTime End of the crowdsale (UNIX timestamp)
   * @param _token Address of the PHI ERC223 Token
   */
  function initializeCrowdsale(
    uint256 _startTime,
    uint256 _endTime,
    address _token,
    uint256 _intervalUpdate
  )
    public
    payable
    onlyOwner
    mustBeAtStage(Stage.ToInitialize)
  {
    require(_startTime >= now);
    require(_endTime >= _startTime);
    require(_token != address(0));
    require(msg.value > 0);
    require(isContract(_token) == true);

    // interval update must be above or equal to 5 seconds
    require(_intervalUpdate >= 5);

    // update global variables
    startTime = _startTime;
    endTime = _endTime;
    token = Token(_token);
    intervalUpdate = _intervalUpdate;

    // update stage
    currentStage = Stage.Waiting;

    /*
      start to fetch ETH/USD price `intervalUpdate` before the `startTime`,
      30 seconds is added because Oraclize takes time to call the __callback
    */
    updateEthRateWithDelay(startTime - (intervalUpdate + 30));

    LogCrowdsaleInit();

    // check amount of tokens held by this contract matches MAX_TOKENS
    assert(token.balanceOf(address(this)) == MAX_TOKENS);
  }

  /**
   * @dev Allow a new reservation contract to invest in the pre-ico
   * @notice Call this before the startTime to avoid delays
   * @param newRcAddr Address of the reservation contract
   * you want to enable (must be a contract)
   */
   function addNewReservContract (address newRcAddr) public onlyOwner {
    require(isContract(newRcAddr) == true);
    require(newRcAddr != 0x0 && newRcAddr != address(this) && newRcAddr != address(token));
    require(reservationContracts[newRcAddr] == false);
    reservationContracts[newRcAddr] = true;
   }

  /**
   * @dev Remove a reservation contract
   * @param toRemove Address of the reservation contract
   * you want to remove
   */
   function removeReservContract (address toRemove) public onlyOwner {
    require(reservationContracts[toRemove] == true);
    reservationContracts[toRemove] = false;
   }

  /* Oraclize related functions */
  /**
   * @dev Callback function used by Oraclize to update the price.
   * @notice ETH/USD rate is receivd and converted to wei, this
   * functions is used also to automatically update the stage status
   * @param myid Unique identifier for Oraclize queries
   * @param result Result of the requested query
   */
  function __callback(
    bytes32 myid,
    string result
  ) 
    public
    closeOrDuringCrowdsale
  {
    if (msg.sender != oraclize_cbAddress()) revert();
    // parse to int and multiply by 10**18 to allow math operations
    uint256 usdRate = parseInt(result, 18);
    // do not allow 0
    require(usdRate > 0);

    ethUsd = usdRate;

    LogRateUpdate(ethUsd, now);

    // check if time is over
    if (hasEnded() == true) {
      currentStage = Stage.Finished;
    } else {
      updateEthRate();
      lastOracleUpdate = now;
    }
  }

  /**
   * @dev Update ETH/USD rate manually in case Oraclize is not
   * calling by our contract
   * @notice An integer is required (e.g. 870, 910), this function
   * will also multiplicate by 10**18
   * @param _newEthUsd New ETH/USD rate integer
   */
  function updateEthUsdManually (uint _newEthUsd) public onlyOwner {
    require(_newEthUsd > 0);
    uint256 newRate = _newEthUsd.mul(10**18);
    require(newRate > 0);
    ethUsd = newRate;
  } 

  /**
   * @dev Used to recursively call the oraclize query 
   * @notice This function will not throw in case the
   * interval update is exceeded, in this way the latest
   * update made to the ETH/USD rate is kept 
   */
  function updateEthRate () internal {
    // prevent multiple updates
    if(intervalUpdate > (now - lastOracleUpdate)) {}
    else {
      updateEthRateWithDelay(intervalUpdate);
    }
  }

  /**
   * @dev Change interval update
   * @param newInterval New interval rate (in seconds)
   */
  function changeIntervalUpdate (uint newInterval) public onlyOwner {
    require(newInterval >= 5);
    intervalUpdate = newInterval;
  }

  /**
   * @dev Helper function around oraclize_query
   * @notice Call oraclize_query with a delay in seconds
   * @param delay Delay in seconds 
   */
  function updateEthRateWithDelay (uint delay) internal {
    // delay cannot be below 5 seconds (too fast)
    require(delay >= 5);
    if (oraclize_getPrice("URL", ORACLIZE_GAS_LIMIT) > this.balance) {
      // Notify that we need a top up 
      LogBalanceRequired();
    } else {
        // Get ETH/USD rate from kraken API
        oraclize_query(
          delay,
          "URL",
          "json(https://api.kraken.com/0/public/Ticker?pair=ETHUSD).result.XETHZUSD.c.0",
          ORACLIZE_GAS_LIMIT
        );
    }
  }

  /**
   * @dev Allow owner to force rate update
   * @param delay Delay in seconds of oraclize_query, can be set to 5 (minimum)
   */
  function forceOraclizeUpdate (uint256 delay) public onlyOwner {
    updateEthRateWithDelay(delay);
  }

  /**
   * @dev Change Oraclize gas limit (used in oraclize_query)
   * @notice To be used in case the default gas cost is too low
   * @param newGas New gas to use (in wei)
   */
  function changeOraclizeGas(uint newGas) public onlyOwner {
    require(newGas > 0 && newGas <= 4000000);
    ORACLIZE_GAS_LIMIT = newGas;
  }

  /**
   * @dev Change Oraclize gas price
   * @notice To be used in case the default gas price is too low
   * @param _gasPrice Gas price in wei
   */
  function changeOraclizeGasPrice(uint _gasPrice) public onlyOwner {
    require(_gasPrice >= 1000000000); // minimum 1 gwei
    oraclize_setCustomGasPrice(_gasPrice);
  }

  /**
   * @dev Top up balance
   * @notice This function must be used **only if 
   * this contract balance is too low for oraclize_query
   * to be executed**
   * @param verifyCode Used only to allow people that read
   * the notice (not accidental)
   */
  function topUpBalance (uint verifyCode) public payable mustBeAtStage(Stage.Running) {
    // value is required
    require(msg.value > 0);
    // make sure only the people that read
    // this can use the function
    require(verifyCode == 28391728448);
  }

  /**
   * @dev Withdraw balance of this contract to the `wallet` address
   * @notice Used only if there are some leftover
   * funds (because of topUpBalance)
  */
  function withdrawBalance() public mustBeAtStage(Stage.Finalized) {
    wallet.transfer(this.balance);
  }

  /* Invest related functions */
  /**
   * @dev Low level function to purchase function on behalf of a beneficiary
   * @notice If you call directly this function your are buying for someone else
   * @param beneficiary Where tokens should be sent
   */
  function buyTokens(address beneficiary) public onlyFromRc validPurchase mustBeAtStage(Stage.Running) payable {
    require(beneficiary != address(0));
    require(beneficiary != address(this));
    require(msg.value >= 1 ether);

    uint256 weiAmount = msg.value;

    // calculate token amount to be transfered
    uint256 tokens = getTokenAmount(weiAmount);

    require(tokens > 0);
    // check if we are below MAX_TOKENS
    require(tokensSold.add(tokens) <= MAX_TOKENS);

    // update tokens sold
    tokensSold = tokensSold.add(tokens);

    // update total wei counter
    weiRaised = weiRaised.add(weiAmount);

    // update balance of the beneficiary
    balancesToken[beneficiary] = balancesToken[beneficiary].add(tokens);
    balancesWei[beneficiary] = balancesWei[beneficiary].add(weiAmount);

    TokenPurchase(msg.sender, beneficiary, weiAmount, tokens);

    // forward ETH
    forwardFunds();
  }

  /**
   * @dev send ether to the fund collection wallet
   */
  function forwardFunds() internal {
    wallet.transfer(msg.value);
  }

  /* Finalize/whitelist functions */

  /**
   * @dev Add multiple whitelisted addresses
   * @notice Must be called after the crowdsale has finished
   * @param investors Array or investors to enable
   */ 
  function addWhitelistAddrByList (address[] investors) public onlyOwner mustBeAtStage(Stage.Finished) {
    for(uint256 i = 0; i < investors.length; i++) {
      addWhitelistAddress(investors[i]);
    }
  }

  /**
   * @dev Whitelist a specific address
   * @notice This is mainly an helper function but can be useful in
   * case the `addWhitelistAddrs` loop has issues
   * @param investor Investor to whitelist
   */ 
  function addWhitelistAddress (address investor) public onlyOwner mustBeAtStage(Stage.Finished) {
    require(investor != address(0) && investor != address(this));
    require(isWhitelisted[investor] == false);
    require(balancesToken[investor] > 0);
    isWhitelisted[investor] = true;
  }

  /**
   * @dev Remove an address from whitelist
   */
  function removeWhitelistedAddress (address toRemove) public onlyOwner mustBeAtStage(Stage.Finished) {
    require(isWhitelisted[toRemove] == true);
    isWhitelisted[toRemove] = false;
  }

  /**
   * @dev Finalize crowdsale with investors array
   * @notice Transfers tokens to whitelisted addresses
   */
  function finalizeInvestorsByList(address[] investors) public onlyOwner mustBeAtStage(Stage.Finished) {
    for(uint256 i = 0; i < investors.length; i++) {
      finalizeSingleInvestor(investors[i]);
    }
  }

  /**
   * @dev Finalize a specific investor
   * @notice This is mainly an helper function to `finalize` but
   * can be used if `finalize` has issues with the loop
   * @param investorAddr Address to finalize
   */
  function finalizeSingleInvestor(address investorAddr) public onlyOwner mustBeAtStage(Stage.Finished) {
    require(investorAddr != address(0) && investorAddr != address(this));
    require(balancesToken[investorAddr] > 0);
    require(isWhitelisted[investorAddr] == true);
    // save data into variables
    uint256 balanceToTransfer = balancesToken[investorAddr];
    // reset current state
    balancesToken[investorAddr] = 0;
    isWhitelisted[investorAddr] = false;
    // transfer token to the investor address and the balance
    // that we have recorded before
    require(token.transfer(investorAddr, balanceToTransfer));
    // update tokens sent
    tokensFinalized = tokensFinalized.add(balanceToTransfer);
    assert(tokensFinalized <= MAX_TOKENS);
  }

  /**
   * @dev Burn unsold tokens
   * @notice Call this function after finalizing
   */
  function burnRemainingTokens() public onlyOwner mustBeAtStage(Stage.Finalized) {
    // should always be true
    require(MAX_TOKENS >= tokensFinalized);
    uint unsold = MAX_TOKENS.sub(tokensFinalized);
    if (unsold > 0) {
      token.burn(unsold);
    }
  }

  /**
   * @dev Burn all remaining tokens held by this contract
   * @notice Get the token balance of this contract and burns all tokens
   */
  function burnAllTokens() public onlyOwner mustBeAtStage(Stage.Finalized) {
    uint thisTokenBalance = token.balanceOf(address(this));
    if (thisTokenBalance > 0) {
      token.burn(thisTokenBalance);
    }
  }

  /**
   * @dev Allow to change the current stage
   * @param newStage New stage
   */
  function changeStage (Stage newStage) public onlyOwner {
    currentStage = newStage;
  }

  /**
   * @dev pre-ico status (based only on time)
   * @return true if crowdsale event has ended
   */
  function hasEnded() public constant returns (bool) {
    return now > endTime && startTime != 0;
  }

  /* Price functions */
  /**
   * @dev Get current ETH/PHI rate (1 ETH = getEthPhiRate() PHI)
   * @notice It divides (ETH/USD rate) / (PHI/USD rate), use the
   * custom function `getEthPhiRate(false)` if you want a more
   * accurate rate
   * @return ETH/PHI rate
   */
  function getEthPhiRate () public constant returns (uint) {
    // 1/(ETH/PHI rate) * (ETH/USD rate) should return PHI rate
    // multiply by 1000 to keep decimals from the division
    return ethUsd.div(phiRate);
  }

  /**
   * @dev Get current kETH/PHI rate (1000 ETH = getkEthPhiRate() PHI)
   * used to get a more accurate rate (by not truncating decimals)
   * @notice It divides (ETH/USD rate) / (PHI/USD rate)
   * @return kETH/PHI rate
   */
  function getkEthPhiRate () public constant returns (uint) {
    // 1/(kETH/PHI rate) * (ETH/USD rate) should return PHI rate
    // multiply by 1000 to keep decimals from the division, and return kEth/PHI rate
    return ethUsd.mul(1000).div(phiRate);
  }

  /**
   * @dev Calculate amount of token based on wei amount
   * @param weiAmount Amount of wei
   * @return Amount of PHI tokens
   */
  function getTokenAmount(uint256 weiAmount) public constant returns(uint256) {
    // get kEth rate to keep decimals
    uint currentKethRate = getkEthPhiRate();
    // divide by 1000 to revert back the multiply
    return currentKethRate.mul(weiAmount).div(1000);
  }

  /* Helper functions for token balance */
  /**
   * @dev Returns how many tokens an investor has
   * @param investor Investor to look for
   * @return Balance of the investor
   */
  function getInvestorBalance(address investor) external constant returns (uint) {
    return balancesToken[investor];
  }

  /**
   * @dev Returns how many wei an investor has invested
   * @param investor Investor to look for
   * @return Balance of the investor
   */
  function getInvestorWeiBalance(address investor) external constant returns (uint) {
    return balancesWei[investor];
  }

  /**
   * @dev Check if an address is a contract
   * @param addr Address to check
   * @return True if is a contract
   */
  function isContract(address addr) public constant returns (bool) {
    uint size;
    assembly { size := extcodesize(addr) }
    return size > 0;
  }

  /* Ico engine compatible functions */
  /**
   * @dev Return `started` state
   * false if the crowdsale is not started,
   * true if the crowdsale is started and running,
   * true if the crowdsale is completed
   * @return crowdsale state
   */
  function started() public view returns(bool) {
    if ((uint8(currentStage) >= 2 || now >= startTime && now <= endTime) && uint8(currentStage) != 3) return true;
    return false;
  }

  /**
   * @dev Return if crowdsale ended
   * false if the crowdsale is not started,
   * false if the crowdsale is started and running,
   * true if the crowdsale is completed
   * @return ended state
   */
  function ended() public view returns(bool) {
    if (tokensSold == MAX_TOKENS) return true;
    if (uint8(currentStage) >= 4) return true;
    return hasEnded();
  }

  /**
   * @dev returns the total number of the tokens available for the sale,
   * must not change when the crowdsale is started
   * @return total tokens in sphi
   */
  function totalTokens() public view returns(uint) {
    return MAX_TOKENS;
  }
  
  /**
   * @dev returns the number of the tokens available for the crowdsale.
   * At the moment that the crowdsale starts it must be equal to totalTokens(),
   * then it will decrease. It is used to calculate the
   * percentage of sold tokens as remainingTokens() / totalTokens()
   * @return Remaining tokens in sphi
   */
  function remainingTokens() public view returns(uint) {
    return MAX_TOKENS.sub(tokensSold);
  }

  /**
   * @dev return the price as number of tokens released for each ether
   * @return amount in sphi for 1 ether
   */
  function price() public view returns(uint) {
    return getTokenAmount(1 ether);
  }
}

Contract Security Audit

Contract ABI

[{"constant":false,"inputs":[{"name":"newRcAddr","type":"address"}],"name":"addNewReservContract","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"ended","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"tokensFinalized","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"isContract","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"started","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"myid","type":"bytes32"},{"name":"result","type":"string"}],"name":"__callback","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"endTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"investors","type":"address[]"}],"name":"finalizeInvestorsByList","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"myid","type":"bytes32"},{"name":"result","type":"string"},{"name":"proof","type":"bytes"}],"name":"__callback","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"isWhitelisted","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"weiRaised","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ORACLIZE_GAS_LIMIT","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"tokensSold","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"wallet","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"investors","type":"address[]"}],"name":"addWhitelistAddrByList","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"toRemove","type":"address"}],"name":"removeWhitelistedAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"investor","type":"address"}],"name":"getInvestorWeiBalance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ethUsd","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"currentStage","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"investor","type":"address"}],"name":"getInvestorBalance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newGas","type":"uint256"}],"name":"changeOraclizeGas","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"withdrawBalance","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getkEthPhiRate","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"investorAddr","type":"address"}],"name":"finalizeSingleInvestor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"startTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"reservationContracts","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalTokens","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"burnRemainingTokens","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newEthUsd","type":"uint256"}],"name":"updateEthUsdManually","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_startTime","type":"uint256"},{"name":"_endTime","type":"uint256"},{"name":"_token","type":"address"},{"name":"_intervalUpdate","type":"uint256"}],"name":"initializeCrowdsale","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balancesWei","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"investor","type":"address"}],"name":"addWhitelistAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"price","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newInterval","type":"uint256"}],"name":"changeIntervalUpdate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"verifyCode","type":"uint256"}],"name":"topUpBalance","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"getEthPhiRate","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"lastOracleUpdate","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newStage","type":"uint8"}],"name":"changeStage","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"remainingTokens","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_gasPrice","type":"uint256"}],"name":"changeOraclizeGasPrice","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"burnAllTokens","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"weiAmount","type":"uint256"}],"name":"getTokenAmount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"phiRate","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"toRemove","type":"address"}],"name":"removeReservContract","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"intervalUpdate","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"delay","type":"uint256"}],"name":"forceOraclizeUpdate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"beneficiary","type":"address"}],"name":"buyTokens","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"hasEnded","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAX_TOKENS","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"token","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balancesToken","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_wallet","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"purchaser","type":"address"},{"indexed":true,"name":"beneficiary","type":"address"},{"indexed":false,"name":"value","type":"uint256"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"TokenPurchase","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newRate","type":"uint256"},{"indexed":false,"name":"timeRecv","type":"uint256"}],"name":"LogRateUpdate","type":"event"},{"anonymous":false,"inputs":[],"name":"LogBalanceRequired","type":"event"},{"anonymous":false,"inputs":[],"name":"LogCrowdsaleInit","type":"event"}]

60606040526a02ea5bc198996c82480000600a556000600b819055600c556711bd3ebd52ae8900600f55620236686012556017805460ff1916905534156200004657600080fd5b6040516020806200316683398101604052808051600f549092506000901190508015620000735750600654155b15156200007f57600080fd5b600160a060020a03811615156200009557600080fd5b60088054600160a060020a03838116600160a060020a0319928316179092556009805433909316929091169190911790556017805460ff19169055620000ed639502f90064010000000062001e14620000f482021704565b50620007be565b600054600160a060020a031615806200012f57506000546200012d90600160a060020a031664010000000062001fdf620002ff82021704565b155b1562000151576200014f600064010000000062001fe36200030382021704565b505b60008054600160a060020a0316906338cc483190604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515620001b457600080fd5b6102c65a03f11515620001c657600080fd5b5050506040518051600154600160a060020a039081169116149050620002855760008054600160a060020a0316906338cc483190604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156200024957600080fd5b6102c65a03f115156200025b57600080fd5b505050604051805160018054600160a060020a031916600160a060020a0392909216919091179055505b600154600160a060020a031663ca6ad1e4826040517c010000000000000000000000000000000000000000000000000000000063ffffffff84160281526004810191909152602401600060405180830381600087803b1515620002e757600080fd5b6102c65a03f11515620002f957600080fd5b50505050565b3b90565b60006200031d640100000000620025916200032382021704565b92915050565b60008062000353731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed64010000000062001fdf620002ff82021704565b1115620003d55760008054600160a060020a031916731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed179055620003cc60408051908101604052600b81527f6574685f6d61696e6e65740000000000000000000000000000000000000000006020820152640100000000620028af6200070382021704565b50600162000700565b60006200040473c03a2615d5efaf5f49f60b7bb6583eaec212fdf164010000000062001fdf620002ff82021704565b11156200047d5760008054600160a060020a03191673c03a2615d5efaf5f49f60b7bb6583eaec212fdf1179055620003cc60408051908101604052600c81527f6574685f726f707374656e3300000000000000000000000000000000000000006020820152640100000000620028af6200070382021704565b6000620004ac73b7a07bcf2ba2f2703b24c0691b5278999c59ac7e64010000000062001fdf620002ff82021704565b1115620005255760008054600160a060020a03191673b7a07bcf2ba2f2703b24c0691b5278999c59ac7e179055620003cc60408051908101604052600981527f6574685f6b6f76616e00000000000000000000000000000000000000000000006020820152640100000000620028af6200070382021704565b60006200055473146500cfd35b22e4a392fe0adc06de1a1368ed4864010000000062001fdf620002ff82021704565b1115620005cd5760008054600160a060020a03191673146500cfd35b22e4a392fe0adc06de1a1368ed48179055620003cc60408051908101604052600b81527f6574685f72696e6b6562790000000000000000000000000000000000000000006020820152640100000000620028af6200070382021704565b6000620005fc736f485c8bf6fc43ea212e93bbf8ce046c7f1cb47564010000000062001fdf620002ff82021704565b111562000632575060008054600160a060020a031916736f485c8bf6fc43ea212e93bbf8ce046c7f1cb475179055600162000700565b6000620006617320e12a1f859b3feae5fb2a0a32c18f5a65555bbf64010000000062001fdf620002ff82021704565b111562000697575060008054600160a060020a0319167320e12a1f859b3feae5fb2a0a32c18f5a65555bbf179055600162000700565b6000620006c67351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa64010000000062001fdf620002ff82021704565b1115620006fc575060008054600160a060020a0319167351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa179055600162000700565b5060005b90565b6002818051620007189291602001906200071c565b5050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200075f57805160ff19168380011785556200078f565b828001600101855582156200078f579182015b828111156200078f57825182559160200191906001019062000772565b506200079d929150620007a1565b5090565b6200070091905b808211156200079d5760008155600101620007a8565b61299880620007ce6000396000f3006060604052600436106102575763ffffffff60e060020a6000350416622854de811461025c57806312fa6feb1461027d57806313040bc1146102a457806316279055146102c95780631f2698ab146102e857806327dc297e146102fb5780633197cbb614610351578063364595a71461036457806338bbfa50146103b35780633af32abf1461044b5780634042b66f1461046a5780634eb8ffb41461047d578063518ab2a814610490578063521eb273146104a35780635262b0a0146104d2578063530cd5ab1461052157806358c1c355146105405780635a9602161461055f5780635bf5d54c146105725780635ea63913146105a95780635eb572ad146105c85780635fd8c710146105de5780636a470988146105f157806372efba451461060457806378e97925146106235780637904bd09146106365780637e1c0c091461065557806383408d73146106685780638a99cdc71461067b5780638b5f37ee146106915780638c328dbf146106ae5780638da5cb5b146106cd57806394a7ef15146106e0578063a035b1fe146106ff578063a1d50cb914610712578063a635392d14610728578063b14debe414610733578063b609d0e614610746578063b9172dec14610759578063bf58390314610772578063c0c1b10714610785578063c17e2aa11461079b578063c2507ac1146107ae578063c30d0ee4146107c4578063d3db4cb0146107d7578063e067f631146107f6578063e2cf55e614610809578063ec8ac4d81461081f578063ecb70fb714610833578063f47c84c514610846578063fc0c546a14610859578063fc9960381461086c575b600080fd5b341561026757600080fd5b61027b600160a060020a036004351661088b565b005b341561028857600080fd5b610290610956565b604051901515815260200160405180910390f35b34156102af57600080fd5b6102b761099e565b60405190815260200160405180910390f35b34156102d457600080fd5b610290600160a060020a03600435166109a4565b34156102f357600080fd5b6102906109ac565b341561030657600080fd5b61027b600480359060446024803590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610a1595505050505050565b341561035c57600080fd5b6102b7610b1c565b341561036f57600080fd5b61027b6004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843750949650610b2295505050505050565b34156103be57600080fd5b61027b600480359060446024803590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650610b1795505050505050565b341561045657600080fd5b610290600160a060020a0360043516610ba1565b341561047557600080fd5b6102b7610bb6565b341561048857600080fd5b6102b7610bbc565b341561049b57600080fd5b6102b7610bc2565b34156104ae57600080fd5b6104b6610bc8565b604051600160a060020a03909116815260200160405180910390f35b34156104dd57600080fd5b61027b6004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843750949650610bd795505050505050565b341561052c57600080fd5b61027b600160a060020a0360043516610c56565b341561054b57600080fd5b6102b7600160a060020a0360043516610ce7565b341561056a57600080fd5b6102b7610d02565b341561057d57600080fd5b610585610d08565b6040518082600581111561059557fe5b60ff16815260200191505060405180910390f35b34156105b457600080fd5b6102b7600160a060020a0360043516610d11565b34156105d357600080fd5b61027b600435610d2c565b34156105e957600080fd5b61027b610d6a565b34156105fc57600080fd5b6102b7610dcf565b341561060f57600080fd5b61027b600160a060020a0360043516610dfa565b341561062e57600080fd5b6102b7610f9c565b341561064157600080fd5b610290600160a060020a0360043516610fa2565b341561066057600080fd5b6102b7610fb7565b341561067357600080fd5b61027b610fbd565b341561068657600080fd5b61027b600435611096565b61027b600435602435600160a060020a03604435166064356110ee565b34156106b957600080fd5b6102b7600160a060020a0360043516611286565b34156106d857600080fd5b6104b6611298565b34156106eb57600080fd5b61027b600160a060020a03600435166112a7565b341561070a57600080fd5b6102b761138f565b341561071d57600080fd5b61027b6004356113a2565b61027b6004356113d0565b341561073e57600080fd5b6102b7611418565b341561075157600080fd5b6102b7611431565b341561076457600080fd5b61027b60ff60043516611437565b341561077d57600080fd5b6102b7611473565b341561079057600080fd5b61027b60043561148c565b34156107a657600080fd5b61027b6114c1565b34156107b957600080fd5b6102b76004356115ce565b34156107cf57600080fd5b6102b76115f8565b34156107e257600080fd5b61027b600160a060020a03600435166115fe565b341561080157600080fd5b6102b7611664565b341561081457600080fd5b61027b60043561166a565b61027b600160a060020a036004351661168e565b341561083e57600080fd5b6102906118e6565b341561085157600080fd5b6102b76118fd565b341561086457600080fd5b6104b6611903565b341561087757600080fd5b6102b7600160a060020a0360043516611912565b60095433600160a060020a039081169116146108a657600080fd5b6108af816109a4565b15156001146108bd57600080fd5b600160a060020a038116158015906108e7575030600160a060020a031681600160a060020a031614155b80156109015750600554600160a060020a03828116911614155b151561090c57600080fd5b600160a060020a0381166000908152600d602052604090205460ff161561093257600080fd5b600160a060020a03166000908152600d60205260409020805460ff19166001179055565b6000600a54600b54141561096c5750600161099b565b60175460049060ff16600581111561098057fe5b60ff16106109905750600161099b565b6109986118e6565b90505b90565b600c5481565b6000903b1190565b60175460009060029060ff1660058111156109c357fe5b60ff161015806109e2575060065442101580156109e257506007544211155b8015610a02575060175460ff1660058111156109fa57fe5b60ff16600314155b15610a0f5750600161099b565b50600090565b6000601154600654034210151515610a2c57600080fd5b600260175460ff166005811115610a3f57fe5b1480610a5b5750600160175460ff166005811115610a5957fe5b145b1515610a6657600080fd5b610a6e611924565b600160a060020a031633600160a060020a0316141515610a8d57600080fd5b610a98826012611ac4565b905060008111610aa757600080fd5b600e8190557fd8146a2ee5244febd04c1d4a4fda43b447702db87a6d57f44d1c04600248a01e814260405191825260208201526040908101905180910390a1610aee6118e6565b151560011415610b0a576017805460ff19166004179055610b17565b610b12611c32565b426010555b505050565b60075481565b60095460009033600160a060020a03908116911614610b4057600080fd5b60175460049060ff166005811115610b5457fe5b816005811115610b6057fe5b14610b6a57600080fd5b600091505b8251821015610b1757610b96838381518110610b8757fe5b90602001906020020151610dfa565b600190910190610b6f565b60146020526000908152604090205460ff1681565b60135481565b60125481565b600b5481565b600854600160a060020a031681565b60095460009033600160a060020a03908116911614610bf557600080fd5b60175460049060ff166005811115610c0957fe5b816005811115610c1557fe5b14610c1f57600080fd5b600091505b8251821015610b1757610c4b838381518110610c3c57fe5b906020019060200201516112a7565b600190910190610c24565b60095433600160a060020a03908116911614610c7157600080fd5b60175460049060ff166005811115610c8557fe5b816005811115610c9157fe5b14610c9b57600080fd5b600160a060020a03821660009081526014602052604090205460ff161515600114610cc557600080fd5b50600160a060020a03166000908152601460205260409020805460ff19169055565b600160a060020a031660009081526016602052604090205490565b600e5481565b60175460ff1681565b600160a060020a031660009081526015602052604090205490565b60095433600160a060020a03908116911614610d4757600080fd5b600081118015610d5a5750623d09008111155b1515610d6557600080fd5b601255565b60175460059060ff1681811115610d7d57fe5b816005811115610d8957fe5b14610d9357600080fd5b600854600160a060020a039081169030163180156108fc0290604051600060405180830381858888f193505050501515610dcc57600080fd5b50565b6000610998600f54610dee6103e8600e54611c5290919063ffffffff16565b9063ffffffff611c8816565b60095460009033600160a060020a03908116911614610e1857600080fd5b60175460049060ff166005811115610e2c57fe5b816005811115610e3857fe5b14610e4257600080fd5b600160a060020a03831615801590610e6c575030600160a060020a031683600160a060020a031614155b1515610e7757600080fd5b600160a060020a03831660009081526015602052604081205411610e9a57600080fd5b600160a060020a03831660009081526014602052604090205460ff161515600114610ec457600080fd5b600160a060020a0380841660009081526015602090815260408083208054908490556014909252808320805460ff1916905560055491955092169163a9059cbb918691869190516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610f5257600080fd5b6102c65a03f11515610f6357600080fd5b505050604051805190501515610f7857600080fd5b600c54610f8b908363ffffffff611c9f16565b600c819055600a54901115610b1757fe5b60065481565b600d6020526000908152604090205460ff1681565b600a5490565b60095460009033600160a060020a03908116911614610fdb57600080fd5b60175460059060ff1681811115610fee57fe5b816005811115610ffa57fe5b1461100457600080fd5b600c54600a54101561101557600080fd5b600c54600a5461102a9163ffffffff611cae16565b9150600082111561109257600554600160a060020a03166342966c688360405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b151561107d57600080fd5b6102c65a03f1151561108e57600080fd5b5050505b5050565b60095460009033600160a060020a039081169116146110b457600080fd5b600082116110c157600080fd5b6110d982670de0b6b3a764000063ffffffff611c5216565b9050600081116110e857600080fd5b600e5550565b60095433600160a060020a0390811691161461110957600080fd5b60175460009060ff16600581111561111d57fe5b81600581111561112957fe5b1461113357600080fd5b4285101561114057600080fd5b8484101561114d57600080fd5b600160a060020a038316151561116257600080fd5b6000341161116f57600080fd5b611178836109a4565b151560011461118657600080fd5b600582101561119457600080fd5b6006859055600784905560058054600160a060020a031916600160a060020a03851617905560118290556017805460ff191660011790556111da828603601d1901611cc0565b7f9e953e39084a678c098e2b3a77bf0809ac2f84c6597505f3f21c4ae8809ff7a060405160405180910390a1600a54600554600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561126257600080fd5b6102c65a03f1151561127357600080fd5b5050506040518051905014151561108e57fe5b60166020526000908152604090205481565b600954600160a060020a031681565b60095433600160a060020a039081169116146112c257600080fd5b60175460049060ff1660058111156112d657fe5b8160058111156112e257fe5b146112ec57600080fd5b600160a060020a03821615801590611316575030600160a060020a031682600160a060020a031614155b151561132157600080fd5b600160a060020a03821660009081526014602052604090205460ff161561134757600080fd5b600160a060020a0382166000908152601560205260408120541161136a57600080fd5b50600160a060020a03166000908152601460205260409020805460ff19166001179055565b6000610998670de0b6b3a76400006115ce565b60095433600160a060020a039081169116146113bd57600080fd5b60058110156113cb57600080fd5b601155565b60175460029060ff1660058111156113e457fe5b8160058111156113f057fe5b146113fa57600080fd5b6000341161140757600080fd5b64069c476540821461109257600080fd5b6000610998600f54600e54611c8890919063ffffffff16565b60105481565b60095433600160a060020a0390811691161461145257600080fd5b6017805482919060ff1916600183600581111561146b57fe5b021790555050565b6000610998600b54600a54611cae90919063ffffffff16565b60095433600160a060020a039081169116146114a757600080fd5b633b9aca008110156114b857600080fd5b610dcc81611e14565b60095460009033600160a060020a039081169116146114df57600080fd5b60175460059060ff16818111156114f257fe5b8160058111156114fe57fe5b1461150857600080fd5b600554600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561156157600080fd5b6102c65a03f1151561157257600080fd5b5050506040518051925050600082111561109257600554600160a060020a03166342966c688360405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b151561107d57600080fd5b6000806115d9610dcf565b90506115f16103e8610dee838663ffffffff611c5216565b9392505050565b600f5481565b60095433600160a060020a0390811691161461161957600080fd5b600160a060020a0381166000908152600d602052604090205460ff16151560011461164357600080fd5b600160a060020a03166000908152600d60205260409020805460ff19169055565b60115481565b60095433600160a060020a0390811691161461168557600080fd5b610dcc81611cc0565b600160a060020a0333166000908152600d6020526040812054819060ff1615156001146116ba57600080fd5b600060065442101580156116d057506007544211155b90506000341180156116df5750805b80156116ec575060065415155b15156116f757600080fd5b60018115151480156117195750600160175460ff16600581111561171757fe5b145b1561172c576017805460ff191660021790555b60175460029060ff16600581111561174057fe5b81600581111561174c57fe5b1461175657600080fd5b600160a060020a038516151561176b57600080fd5b30600160a060020a031685600160a060020a03161415151561178c57600080fd5b670de0b6b3a76400003410156117a157600080fd5b3493506117ad846115ce565b9250600083116117bc57600080fd5b600a54600b546117d2908563ffffffff611c9f16565b11156117dd57600080fd5b600b546117f0908463ffffffff611c9f16565b600b55601354611806908563ffffffff611c9f16565b601355600160a060020a038516600090815260156020526040902054611832908463ffffffff611c9f16565b600160a060020a038616600090815260156020908152604080832093909355601690522054611867908563ffffffff611c9f16565b6016600087600160a060020a0316600160a060020a031681526020019081526020016000208190555084600160a060020a031633600160a060020a03167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad18868660405191825260208201526040908101905180910390a361108e611fab565b600060075442118015610998575050600654151590565b600a5481565b600554600160a060020a031681565b60156020526000908152604090205481565b60008054600160a060020a0316158061194f575060005461194d90600160a060020a0316611fdf565b155b156119605761195e6000611fe3565b505b60008054600160a060020a0316906338cc483190604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156119a957600080fd5b6102c65a03f115156119ba57600080fd5b5050506040518051600154600160a060020a039081169116149050611a5d5760008054600160a060020a0316906338cc483190604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515611a2257600080fd5b6102c65a03f11515611a3357600080fd5b505050604051805160018054600160a060020a031916600160a060020a0392909216919091179055505b600154600160a060020a031663c281d19e6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515611aa557600080fd5b6102c65a03f11515611ab657600080fd5b505050604051805191505090565b6000611ace6128c2565b5082600080805b8351811015611c15577f3000000000000000000000000000000000000000000000000000000000000000848281518110611b0b57fe5b016020015160f860020a900460f860020a02600160f860020a03191610158015611b7c57507f3900000000000000000000000000000000000000000000000000000000000000848281518110611b5d57fe5b016020015160f860020a900460f860020a02600160f860020a03191611155b15611bd2578115611b9b57851515611b9357611c15565b600019909501945b600a830292506030848281518110611baf57fe5b016020015160f860020a900460f860020a0260f860020a90040383019250611c0d565b838181518110611bde57fe5b016020015160f860020a900460f860020a02600160f860020a031916602e60f860020a021415611c0d57600191505b600101611ad5565b6000861115611c275785600a0a830292505b509095945050505050565b60105442036011541115611c4557611c50565b611c50601154611cc0565b565b600080831515611c655760009150611c81565b50828202828482811515611c7557fe5b0414611c7d57fe5b8091505b5092915050565b6000808284811515611c9657fe5b04949350505050565b600082820183811015611c7d57fe5b600082821115611cba57fe5b50900390565b6005811015611cce57600080fd5b30600160a060020a031631611d1860408051908101604052600381527f55524c00000000000000000000000000000000000000000000000000000000006020820152601254611ff3565b1115611d4f577ff2eff06c8f21dbd6382ac5d1c81874a74bd3b442413581e0ffaaa2a97c6be08660405160405180910390a1610dcc565b611092816040805190810160405280600381526020017f55524c0000000000000000000000000000000000000000000000000000000000815250608060405190810160405280604c81526020017f6a736f6e2868747470733a2f2f6170692e6b72616b656e2e636f6d2f302f707581526020017f626c69632f5469636b65723f706169723d455448555344292e726573756c742e81526020017f584554485a5553442e632e30000000000000000000000000000000000000000081525060125461220a565b600054600160a060020a03161580611e3e5750600054611e3c90600160a060020a0316611fdf565b155b15611e4f57611e4d6000611fe3565b505b60008054600160a060020a0316906338cc483190604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515611e9857600080fd5b6102c65a03f11515611ea957600080fd5b5050506040518051600154600160a060020a039081169116149050611f4c5760008054600160a060020a0316906338cc483190604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515611f1157600080fd5b6102c65a03f11515611f2257600080fd5b505050604051805160018054600160a060020a031916600160a060020a0392909216919091179055505b600154600160a060020a031663ca6ad1e48260405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b1515611f9457600080fd5b6102c65a03f11515611fa557600080fd5b50505050565b600854600160a060020a03163480156108fc0290604051600060405180830381858888f193505050501515611c5057600080fd5b3b90565b6000611fed612591565b92915050565b60008054600160a060020a0316158061201e575060005461201c90600160a060020a0316611fdf565b155b1561202f5761202d6000611fe3565b505b60008054600160a060020a0316906338cc483190604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561207857600080fd5b6102c65a03f1151561208957600080fd5b5050506040518051600154600160a060020a03908116911614905061212c5760008054600160a060020a0316906338cc483190604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156120f157600080fd5b6102c65a03f1151561210257600080fd5b505050604051805160018054600160a060020a031916600160a060020a0392909216919091179055505b600154600160a060020a0316632ef3accc84846000604051602001526040518363ffffffff1660e060020a0281526004018080602001838152602001828103825284818151815260200191508051906020019080838360005b8381101561219d578082015183820152602001612185565b50505050905090810190601f1680156121ca5780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b15156121e957600080fd5b6102c65a03f115156121fa57600080fd5b5050506040518051949350505050565b600080548190600160a060020a03161580612237575060005461223590600160a060020a0316611fdf565b155b15612248576122466000611fe3565b505b60008054600160a060020a0316906338cc483190604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561229157600080fd5b6102c65a03f115156122a257600080fd5b5050506040518051600154600160a060020a0390811691161490506123455760008054600160a060020a0316906338cc483190604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561230a57600080fd5b6102c65a03f1151561231b57600080fd5b505050604051805160018054600160a060020a031916600160a060020a0392909216919091179055505b600154600160a060020a0316632ef3accc86856000604051602001526040518363ffffffff1660e060020a0281526004018080602001838152602001828103825284818151815260200191508051906020019080838360005b838110156123b657808201518382015260200161239e565b50505050905090810190601f1680156123e35780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b151561240257600080fd5b6102c65a03f1151561241357600080fd5b5050506040518051915050670de0b6b3a76400003a84020181111561243b5760009150612588565b600154600160a060020a031663c51be90f82888888886000604051602001526040518663ffffffff1660e060020a028152600401808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156124b95780820151838201526020016124a1565b50505050905090810190601f1680156124e65780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b8381101561251c578082015183820152602001612504565b50505050905090810190601f1680156125495780820380516001836020036101000a031916815260200191505b5096505050505050506020604051808303818588803b151561256a57600080fd5b6125ee5a03f1151561257b57600080fd5b5050505060405180519250505b50949350505050565b6000806125b1731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed611fdf565b11156126215760008054600160a060020a031916731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed17905561261960408051908101604052600b81527f6574685f6d61696e6e657400000000000000000000000000000000000000000060208201526128af565b50600161099b565b600061264073c03a2615d5efaf5f49f60b7bb6583eaec212fdf1611fdf565b11156126a85760008054600160a060020a03191673c03a2615d5efaf5f49f60b7bb6583eaec212fdf117905561261960408051908101604052600c81527f6574685f726f707374656e33000000000000000000000000000000000000000060208201526128af565b60006126c773b7a07bcf2ba2f2703b24c0691b5278999c59ac7e611fdf565b111561272f5760008054600160a060020a03191673b7a07bcf2ba2f2703b24c0691b5278999c59ac7e17905561261960408051908101604052600981527f6574685f6b6f76616e000000000000000000000000000000000000000000000060208201526128af565b600061274e73146500cfd35b22e4a392fe0adc06de1a1368ed48611fdf565b11156127b65760008054600160a060020a03191673146500cfd35b22e4a392fe0adc06de1a1368ed4817905561261960408051908101604052600b81527f6574685f72696e6b65627900000000000000000000000000000000000000000060208201526128af565b60006127d5736f485c8bf6fc43ea212e93bbf8ce046c7f1cb475611fdf565b1115612809575060008054600160a060020a031916736f485c8bf6fc43ea212e93bbf8ce046c7f1cb475179055600161099b565b60006128287320e12a1f859b3feae5fb2a0a32c18f5a65555bbf611fdf565b111561285c575060008054600160a060020a0319167320e12a1f859b3feae5fb2a0a32c18f5a65555bbf179055600161099b565b600061287b7351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa611fdf565b1115610a0f575060008054600160a060020a0319167351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa179055600161099b565b60028180516110929291602001906128d4565b60206040519081016040526000815290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061291557805160ff1916838001178555612942565b82800160010185558215612942579182015b82811115612942578251825591602001919060010190612927565b5061294e929150612952565b5090565b61099b91905b8082111561294e57600081556001016129585600a165627a7a723058209e95dfac0cd2bd05a5029d045c95ab79e40cb8241e6a1908bc1b3efd2c5fbec8002900000000000000000000000019f996f3e0ed68fae971676a1815fafde1198676

Deployed Bytecode

0x6060604052600436106102575763ffffffff60e060020a6000350416622854de811461025c57806312fa6feb1461027d57806313040bc1146102a457806316279055146102c95780631f2698ab146102e857806327dc297e146102fb5780633197cbb614610351578063364595a71461036457806338bbfa50146103b35780633af32abf1461044b5780634042b66f1461046a5780634eb8ffb41461047d578063518ab2a814610490578063521eb273146104a35780635262b0a0146104d2578063530cd5ab1461052157806358c1c355146105405780635a9602161461055f5780635bf5d54c146105725780635ea63913146105a95780635eb572ad146105c85780635fd8c710146105de5780636a470988146105f157806372efba451461060457806378e97925146106235780637904bd09146106365780637e1c0c091461065557806383408d73146106685780638a99cdc71461067b5780638b5f37ee146106915780638c328dbf146106ae5780638da5cb5b146106cd57806394a7ef15146106e0578063a035b1fe146106ff578063a1d50cb914610712578063a635392d14610728578063b14debe414610733578063b609d0e614610746578063b9172dec14610759578063bf58390314610772578063c0c1b10714610785578063c17e2aa11461079b578063c2507ac1146107ae578063c30d0ee4146107c4578063d3db4cb0146107d7578063e067f631146107f6578063e2cf55e614610809578063ec8ac4d81461081f578063ecb70fb714610833578063f47c84c514610846578063fc0c546a14610859578063fc9960381461086c575b600080fd5b341561026757600080fd5b61027b600160a060020a036004351661088b565b005b341561028857600080fd5b610290610956565b604051901515815260200160405180910390f35b34156102af57600080fd5b6102b761099e565b60405190815260200160405180910390f35b34156102d457600080fd5b610290600160a060020a03600435166109a4565b34156102f357600080fd5b6102906109ac565b341561030657600080fd5b61027b600480359060446024803590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610a1595505050505050565b341561035c57600080fd5b6102b7610b1c565b341561036f57600080fd5b61027b6004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843750949650610b2295505050505050565b34156103be57600080fd5b61027b600480359060446024803590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650610b1795505050505050565b341561045657600080fd5b610290600160a060020a0360043516610ba1565b341561047557600080fd5b6102b7610bb6565b341561048857600080fd5b6102b7610bbc565b341561049b57600080fd5b6102b7610bc2565b34156104ae57600080fd5b6104b6610bc8565b604051600160a060020a03909116815260200160405180910390f35b34156104dd57600080fd5b61027b6004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843750949650610bd795505050505050565b341561052c57600080fd5b61027b600160a060020a0360043516610c56565b341561054b57600080fd5b6102b7600160a060020a0360043516610ce7565b341561056a57600080fd5b6102b7610d02565b341561057d57600080fd5b610585610d08565b6040518082600581111561059557fe5b60ff16815260200191505060405180910390f35b34156105b457600080fd5b6102b7600160a060020a0360043516610d11565b34156105d357600080fd5b61027b600435610d2c565b34156105e957600080fd5b61027b610d6a565b34156105fc57600080fd5b6102b7610dcf565b341561060f57600080fd5b61027b600160a060020a0360043516610dfa565b341561062e57600080fd5b6102b7610f9c565b341561064157600080fd5b610290600160a060020a0360043516610fa2565b341561066057600080fd5b6102b7610fb7565b341561067357600080fd5b61027b610fbd565b341561068657600080fd5b61027b600435611096565b61027b600435602435600160a060020a03604435166064356110ee565b34156106b957600080fd5b6102b7600160a060020a0360043516611286565b34156106d857600080fd5b6104b6611298565b34156106eb57600080fd5b61027b600160a060020a03600435166112a7565b341561070a57600080fd5b6102b761138f565b341561071d57600080fd5b61027b6004356113a2565b61027b6004356113d0565b341561073e57600080fd5b6102b7611418565b341561075157600080fd5b6102b7611431565b341561076457600080fd5b61027b60ff60043516611437565b341561077d57600080fd5b6102b7611473565b341561079057600080fd5b61027b60043561148c565b34156107a657600080fd5b61027b6114c1565b34156107b957600080fd5b6102b76004356115ce565b34156107cf57600080fd5b6102b76115f8565b34156107e257600080fd5b61027b600160a060020a03600435166115fe565b341561080157600080fd5b6102b7611664565b341561081457600080fd5b61027b60043561166a565b61027b600160a060020a036004351661168e565b341561083e57600080fd5b6102906118e6565b341561085157600080fd5b6102b76118fd565b341561086457600080fd5b6104b6611903565b341561087757600080fd5b6102b7600160a060020a0360043516611912565b60095433600160a060020a039081169116146108a657600080fd5b6108af816109a4565b15156001146108bd57600080fd5b600160a060020a038116158015906108e7575030600160a060020a031681600160a060020a031614155b80156109015750600554600160a060020a03828116911614155b151561090c57600080fd5b600160a060020a0381166000908152600d602052604090205460ff161561093257600080fd5b600160a060020a03166000908152600d60205260409020805460ff19166001179055565b6000600a54600b54141561096c5750600161099b565b60175460049060ff16600581111561098057fe5b60ff16106109905750600161099b565b6109986118e6565b90505b90565b600c5481565b6000903b1190565b60175460009060029060ff1660058111156109c357fe5b60ff161015806109e2575060065442101580156109e257506007544211155b8015610a02575060175460ff1660058111156109fa57fe5b60ff16600314155b15610a0f5750600161099b565b50600090565b6000601154600654034210151515610a2c57600080fd5b600260175460ff166005811115610a3f57fe5b1480610a5b5750600160175460ff166005811115610a5957fe5b145b1515610a6657600080fd5b610a6e611924565b600160a060020a031633600160a060020a0316141515610a8d57600080fd5b610a98826012611ac4565b905060008111610aa757600080fd5b600e8190557fd8146a2ee5244febd04c1d4a4fda43b447702db87a6d57f44d1c04600248a01e814260405191825260208201526040908101905180910390a1610aee6118e6565b151560011415610b0a576017805460ff19166004179055610b17565b610b12611c32565b426010555b505050565b60075481565b60095460009033600160a060020a03908116911614610b4057600080fd5b60175460049060ff166005811115610b5457fe5b816005811115610b6057fe5b14610b6a57600080fd5b600091505b8251821015610b1757610b96838381518110610b8757fe5b90602001906020020151610dfa565b600190910190610b6f565b60146020526000908152604090205460ff1681565b60135481565b60125481565b600b5481565b600854600160a060020a031681565b60095460009033600160a060020a03908116911614610bf557600080fd5b60175460049060ff166005811115610c0957fe5b816005811115610c1557fe5b14610c1f57600080fd5b600091505b8251821015610b1757610c4b838381518110610c3c57fe5b906020019060200201516112a7565b600190910190610c24565b60095433600160a060020a03908116911614610c7157600080fd5b60175460049060ff166005811115610c8557fe5b816005811115610c9157fe5b14610c9b57600080fd5b600160a060020a03821660009081526014602052604090205460ff161515600114610cc557600080fd5b50600160a060020a03166000908152601460205260409020805460ff19169055565b600160a060020a031660009081526016602052604090205490565b600e5481565b60175460ff1681565b600160a060020a031660009081526015602052604090205490565b60095433600160a060020a03908116911614610d4757600080fd5b600081118015610d5a5750623d09008111155b1515610d6557600080fd5b601255565b60175460059060ff1681811115610d7d57fe5b816005811115610d8957fe5b14610d9357600080fd5b600854600160a060020a039081169030163180156108fc0290604051600060405180830381858888f193505050501515610dcc57600080fd5b50565b6000610998600f54610dee6103e8600e54611c5290919063ffffffff16565b9063ffffffff611c8816565b60095460009033600160a060020a03908116911614610e1857600080fd5b60175460049060ff166005811115610e2c57fe5b816005811115610e3857fe5b14610e4257600080fd5b600160a060020a03831615801590610e6c575030600160a060020a031683600160a060020a031614155b1515610e7757600080fd5b600160a060020a03831660009081526015602052604081205411610e9a57600080fd5b600160a060020a03831660009081526014602052604090205460ff161515600114610ec457600080fd5b600160a060020a0380841660009081526015602090815260408083208054908490556014909252808320805460ff1916905560055491955092169163a9059cbb918691869190516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610f5257600080fd5b6102c65a03f11515610f6357600080fd5b505050604051805190501515610f7857600080fd5b600c54610f8b908363ffffffff611c9f16565b600c819055600a54901115610b1757fe5b60065481565b600d6020526000908152604090205460ff1681565b600a5490565b60095460009033600160a060020a03908116911614610fdb57600080fd5b60175460059060ff1681811115610fee57fe5b816005811115610ffa57fe5b1461100457600080fd5b600c54600a54101561101557600080fd5b600c54600a5461102a9163ffffffff611cae16565b9150600082111561109257600554600160a060020a03166342966c688360405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b151561107d57600080fd5b6102c65a03f1151561108e57600080fd5b5050505b5050565b60095460009033600160a060020a039081169116146110b457600080fd5b600082116110c157600080fd5b6110d982670de0b6b3a764000063ffffffff611c5216565b9050600081116110e857600080fd5b600e5550565b60095433600160a060020a0390811691161461110957600080fd5b60175460009060ff16600581111561111d57fe5b81600581111561112957fe5b1461113357600080fd5b4285101561114057600080fd5b8484101561114d57600080fd5b600160a060020a038316151561116257600080fd5b6000341161116f57600080fd5b611178836109a4565b151560011461118657600080fd5b600582101561119457600080fd5b6006859055600784905560058054600160a060020a031916600160a060020a03851617905560118290556017805460ff191660011790556111da828603601d1901611cc0565b7f9e953e39084a678c098e2b3a77bf0809ac2f84c6597505f3f21c4ae8809ff7a060405160405180910390a1600a54600554600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561126257600080fd5b6102c65a03f1151561127357600080fd5b5050506040518051905014151561108e57fe5b60166020526000908152604090205481565b600954600160a060020a031681565b60095433600160a060020a039081169116146112c257600080fd5b60175460049060ff1660058111156112d657fe5b8160058111156112e257fe5b146112ec57600080fd5b600160a060020a03821615801590611316575030600160a060020a031682600160a060020a031614155b151561132157600080fd5b600160a060020a03821660009081526014602052604090205460ff161561134757600080fd5b600160a060020a0382166000908152601560205260408120541161136a57600080fd5b50600160a060020a03166000908152601460205260409020805460ff19166001179055565b6000610998670de0b6b3a76400006115ce565b60095433600160a060020a039081169116146113bd57600080fd5b60058110156113cb57600080fd5b601155565b60175460029060ff1660058111156113e457fe5b8160058111156113f057fe5b146113fa57600080fd5b6000341161140757600080fd5b64069c476540821461109257600080fd5b6000610998600f54600e54611c8890919063ffffffff16565b60105481565b60095433600160a060020a0390811691161461145257600080fd5b6017805482919060ff1916600183600581111561146b57fe5b021790555050565b6000610998600b54600a54611cae90919063ffffffff16565b60095433600160a060020a039081169116146114a757600080fd5b633b9aca008110156114b857600080fd5b610dcc81611e14565b60095460009033600160a060020a039081169116146114df57600080fd5b60175460059060ff16818111156114f257fe5b8160058111156114fe57fe5b1461150857600080fd5b600554600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561156157600080fd5b6102c65a03f1151561157257600080fd5b5050506040518051925050600082111561109257600554600160a060020a03166342966c688360405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b151561107d57600080fd5b6000806115d9610dcf565b90506115f16103e8610dee838663ffffffff611c5216565b9392505050565b600f5481565b60095433600160a060020a0390811691161461161957600080fd5b600160a060020a0381166000908152600d602052604090205460ff16151560011461164357600080fd5b600160a060020a03166000908152600d60205260409020805460ff19169055565b60115481565b60095433600160a060020a0390811691161461168557600080fd5b610dcc81611cc0565b600160a060020a0333166000908152600d6020526040812054819060ff1615156001146116ba57600080fd5b600060065442101580156116d057506007544211155b90506000341180156116df5750805b80156116ec575060065415155b15156116f757600080fd5b60018115151480156117195750600160175460ff16600581111561171757fe5b145b1561172c576017805460ff191660021790555b60175460029060ff16600581111561174057fe5b81600581111561174c57fe5b1461175657600080fd5b600160a060020a038516151561176b57600080fd5b30600160a060020a031685600160a060020a03161415151561178c57600080fd5b670de0b6b3a76400003410156117a157600080fd5b3493506117ad846115ce565b9250600083116117bc57600080fd5b600a54600b546117d2908563ffffffff611c9f16565b11156117dd57600080fd5b600b546117f0908463ffffffff611c9f16565b600b55601354611806908563ffffffff611c9f16565b601355600160a060020a038516600090815260156020526040902054611832908463ffffffff611c9f16565b600160a060020a038616600090815260156020908152604080832093909355601690522054611867908563ffffffff611c9f16565b6016600087600160a060020a0316600160a060020a031681526020019081526020016000208190555084600160a060020a031633600160a060020a03167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad18868660405191825260208201526040908101905180910390a361108e611fab565b600060075442118015610998575050600654151590565b600a5481565b600554600160a060020a031681565b60156020526000908152604090205481565b60008054600160a060020a0316158061194f575060005461194d90600160a060020a0316611fdf565b155b156119605761195e6000611fe3565b505b60008054600160a060020a0316906338cc483190604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156119a957600080fd5b6102c65a03f115156119ba57600080fd5b5050506040518051600154600160a060020a039081169116149050611a5d5760008054600160a060020a0316906338cc483190604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515611a2257600080fd5b6102c65a03f11515611a3357600080fd5b505050604051805160018054600160a060020a031916600160a060020a0392909216919091179055505b600154600160a060020a031663c281d19e6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515611aa557600080fd5b6102c65a03f11515611ab657600080fd5b505050604051805191505090565b6000611ace6128c2565b5082600080805b8351811015611c15577f3000000000000000000000000000000000000000000000000000000000000000848281518110611b0b57fe5b016020015160f860020a900460f860020a02600160f860020a03191610158015611b7c57507f3900000000000000000000000000000000000000000000000000000000000000848281518110611b5d57fe5b016020015160f860020a900460f860020a02600160f860020a03191611155b15611bd2578115611b9b57851515611b9357611c15565b600019909501945b600a830292506030848281518110611baf57fe5b016020015160f860020a900460f860020a0260f860020a90040383019250611c0d565b838181518110611bde57fe5b016020015160f860020a900460f860020a02600160f860020a031916602e60f860020a021415611c0d57600191505b600101611ad5565b6000861115611c275785600a0a830292505b509095945050505050565b60105442036011541115611c4557611c50565b611c50601154611cc0565b565b600080831515611c655760009150611c81565b50828202828482811515611c7557fe5b0414611c7d57fe5b8091505b5092915050565b6000808284811515611c9657fe5b04949350505050565b600082820183811015611c7d57fe5b600082821115611cba57fe5b50900390565b6005811015611cce57600080fd5b30600160a060020a031631611d1860408051908101604052600381527f55524c00000000000000000000000000000000000000000000000000000000006020820152601254611ff3565b1115611d4f577ff2eff06c8f21dbd6382ac5d1c81874a74bd3b442413581e0ffaaa2a97c6be08660405160405180910390a1610dcc565b611092816040805190810160405280600381526020017f55524c0000000000000000000000000000000000000000000000000000000000815250608060405190810160405280604c81526020017f6a736f6e2868747470733a2f2f6170692e6b72616b656e2e636f6d2f302f707581526020017f626c69632f5469636b65723f706169723d455448555344292e726573756c742e81526020017f584554485a5553442e632e30000000000000000000000000000000000000000081525060125461220a565b600054600160a060020a03161580611e3e5750600054611e3c90600160a060020a0316611fdf565b155b15611e4f57611e4d6000611fe3565b505b60008054600160a060020a0316906338cc483190604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515611e9857600080fd5b6102c65a03f11515611ea957600080fd5b5050506040518051600154600160a060020a039081169116149050611f4c5760008054600160a060020a0316906338cc483190604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515611f1157600080fd5b6102c65a03f11515611f2257600080fd5b505050604051805160018054600160a060020a031916600160a060020a0392909216919091179055505b600154600160a060020a031663ca6ad1e48260405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b1515611f9457600080fd5b6102c65a03f11515611fa557600080fd5b50505050565b600854600160a060020a03163480156108fc0290604051600060405180830381858888f193505050501515611c5057600080fd5b3b90565b6000611fed612591565b92915050565b60008054600160a060020a0316158061201e575060005461201c90600160a060020a0316611fdf565b155b1561202f5761202d6000611fe3565b505b60008054600160a060020a0316906338cc483190604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561207857600080fd5b6102c65a03f1151561208957600080fd5b5050506040518051600154600160a060020a03908116911614905061212c5760008054600160a060020a0316906338cc483190604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156120f157600080fd5b6102c65a03f1151561210257600080fd5b505050604051805160018054600160a060020a031916600160a060020a0392909216919091179055505b600154600160a060020a0316632ef3accc84846000604051602001526040518363ffffffff1660e060020a0281526004018080602001838152602001828103825284818151815260200191508051906020019080838360005b8381101561219d578082015183820152602001612185565b50505050905090810190601f1680156121ca5780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b15156121e957600080fd5b6102c65a03f115156121fa57600080fd5b5050506040518051949350505050565b600080548190600160a060020a03161580612237575060005461223590600160a060020a0316611fdf565b155b15612248576122466000611fe3565b505b60008054600160a060020a0316906338cc483190604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561229157600080fd5b6102c65a03f115156122a257600080fd5b5050506040518051600154600160a060020a0390811691161490506123455760008054600160a060020a0316906338cc483190604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561230a57600080fd5b6102c65a03f1151561231b57600080fd5b505050604051805160018054600160a060020a031916600160a060020a0392909216919091179055505b600154600160a060020a0316632ef3accc86856000604051602001526040518363ffffffff1660e060020a0281526004018080602001838152602001828103825284818151815260200191508051906020019080838360005b838110156123b657808201518382015260200161239e565b50505050905090810190601f1680156123e35780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b151561240257600080fd5b6102c65a03f1151561241357600080fd5b5050506040518051915050670de0b6b3a76400003a84020181111561243b5760009150612588565b600154600160a060020a031663c51be90f82888888886000604051602001526040518663ffffffff1660e060020a028152600401808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156124b95780820151838201526020016124a1565b50505050905090810190601f1680156124e65780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b8381101561251c578082015183820152602001612504565b50505050905090810190601f1680156125495780820380516001836020036101000a031916815260200191505b5096505050505050506020604051808303818588803b151561256a57600080fd5b6125ee5a03f1151561257b57600080fd5b5050505060405180519250505b50949350505050565b6000806125b1731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed611fdf565b11156126215760008054600160a060020a031916731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed17905561261960408051908101604052600b81527f6574685f6d61696e6e657400000000000000000000000000000000000000000060208201526128af565b50600161099b565b600061264073c03a2615d5efaf5f49f60b7bb6583eaec212fdf1611fdf565b11156126a85760008054600160a060020a03191673c03a2615d5efaf5f49f60b7bb6583eaec212fdf117905561261960408051908101604052600c81527f6574685f726f707374656e33000000000000000000000000000000000000000060208201526128af565b60006126c773b7a07bcf2ba2f2703b24c0691b5278999c59ac7e611fdf565b111561272f5760008054600160a060020a03191673b7a07bcf2ba2f2703b24c0691b5278999c59ac7e17905561261960408051908101604052600981527f6574685f6b6f76616e000000000000000000000000000000000000000000000060208201526128af565b600061274e73146500cfd35b22e4a392fe0adc06de1a1368ed48611fdf565b11156127b65760008054600160a060020a03191673146500cfd35b22e4a392fe0adc06de1a1368ed4817905561261960408051908101604052600b81527f6574685f72696e6b65627900000000000000000000000000000000000000000060208201526128af565b60006127d5736f485c8bf6fc43ea212e93bbf8ce046c7f1cb475611fdf565b1115612809575060008054600160a060020a031916736f485c8bf6fc43ea212e93bbf8ce046c7f1cb475179055600161099b565b60006128287320e12a1f859b3feae5fb2a0a32c18f5a65555bbf611fdf565b111561285c575060008054600160a060020a0319167320e12a1f859b3feae5fb2a0a32c18f5a65555bbf179055600161099b565b600061287b7351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa611fdf565b1115610a0f575060008054600160a060020a0319167351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa179055600161099b565b60028180516110929291602001906128d4565b60206040519081016040526000815290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061291557805160ff1916838001178555612942565b82800160010185558215612942579182015b82811115612942578251825591602001919060010190612927565b5061294e929150612952565b5090565b61099b91905b8082111561294e57600081556001016129585600a165627a7a723058209e95dfac0cd2bd05a5029d045c95ab79e40cb8241e6a1908bc1b3efd2c5fbec80029

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

00000000000000000000000019f996f3e0ed68fae971676a1815fafde1198676

-----Decoded View---------------
Arg [0] : _wallet (address): 0x19F996F3e0ed68fae971676a1815fAfde1198676

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000019f996f3e0ed68fae971676a1815fafde1198676


Swarm Source

bzzr://9e95dfac0cd2bd05a5029d045c95ab79e40cb8241e6a1908bc1b3efd2c5fbec8

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.