Sponsored:   Ubex.com - Additional 17% of tokens are available for purchase! Trading on exchanges already started.
Contract Overview | etherisc
Balance: 0 Ether
Ether Value: $0
Transactions: 178 txns
 Latest 25 txns from a total Of 178 transactions

TxHash Age From To Value [TxFee]
0x0fc8e92319e67a16c5b9b1db5a1a655422dcff1f99c86f8d9e7e72803db0b598688 days 22 hrs agoOraclize  IN   etherisc0 Ether0.01
0xa41d135b027cdfb1476debf19b00b0ccf36aeff1498f2604b46f44777e802d0f695 days 28 mins agoOraclize  IN   etherisc0 Ether0.01
0xbd8483da38dcb4c745eba9542e0a5d47e4c465cb1f371ef2b382c6adbe14c881695 days 1 hr agoOraclize  IN   etherisc0 Ether0.00515524
0xcb6dd74715e4d39848f066f5399b6bb980542bd782d4e06d0da6b09061262971695 days 1 hr agoOraclize  IN   etherisc0 Ether0.00515524
0xf9d58624f2f69b379fb2f5732f04035872b00cd9458cd592ff94e436ad9fd208695 days 2 hrs agoOraclize  IN   etherisc0 Ether0.00515524
0xf3b0ee5e40bda40806173057c0cf8d38433cfbb85805f9604c3e276a34218d6c695 days 3 hrs agoOraclize  IN   etherisc0 Ether0.00515524
0xae420e66ef883a91d27baf1cc1da5bff531755b27db90ba819c7f075bd3bfebe696 days 14 hrs agoOraclize  IN   etherisc0 Ether0.0009395
0x7b3fa820cc1ba2acc61e81a1f1027527edb8f376a55b73018fbcd6ad2bde6660696 days 14 hrs agoOraclize  IN   etherisc0 Ether0.0009395
0xf70af3b4ad13d4809b58502f7241b136b29b5a89088c2fda46eb75af413ed43b696 days 15 hrs agoOraclize  IN   etherisc0 Ether0.00514952
0xe77e9e23bd235f6aed16466865054d47e38b042dfeaa29d974e7bcebde596f2a696 days 15 hrs agoOraclize  IN   etherisc0 Ether0.0051438
0x78edfbd4a040c5fda9c8c74598f2821cc6451ebdca84295d66e4ee2053e933f5696 days 15 hrs agoOraclize  IN   etherisc0 Ether0.00514824
0xf51211c61d801c627053464c75c8f60f16e3035a120fa8f754812c3b9702b801696 days 16 hrs agoOraclize  IN   etherisc0 Ether0.0009395
0x16303fd2fd43e0cbb1f5a5967c4ebf724519660e1ffc59a641adc4e05a1184cc696 days 16 hrs agoOraclize  IN   etherisc0 Ether0.0051438
0x0fb3b2a527f2f6daa228bb3e8f3f42a3ce6e437b33ddc49e4261baa19aaf0d25696 days 16 hrs agoOraclize  IN   etherisc0 Ether0.00514952
0x49da349edbbd2c52ac922ecad072f28bb1d2e71a628053955b486028f7d044ca696 days 16 hrs agoOraclize  IN   etherisc0 Ether0.00514252
0x4e2e3f01a6c33daa19cb84182588fba8bf2d5213bc6d28ab12d7583078e4f9ad696 days 17 hrs agoOraclize  IN   etherisc0 Ether0.0051438
0xe4dcb01c9c442a98bb4d65d7615bc1f4830be871f8d176143059b4cf500ca368696 days 17 hrs agoOraclize  IN   etherisc0 Ether0.00514952
0x00ce236dd464edbac162edac3d728892263c1de15bbe0a3eb283df3515c20ae6696 days 17 hrs agoOraclize  IN   etherisc0 Ether0.0051438
0x9069edb0600285a0b6c8ad431f12c2c3150b375adb35f42425c93e1ff08d6d0b696 days 17 hrs agoOraclize  IN   etherisc0 Ether0.0009395
0x49a37eb8a1a15c9be8d3270a89559c10a56d5d4060177d9fe8544421ba1e6a37696 days 17 hrs agoOraclize  IN   etherisc0 Ether0.0051438
0x3730e416d6838f89790926d43c0731ddb9f64bb2d63924f49073b3eab191a7a8696 days 18 hrs agoOraclize  IN   etherisc0 Ether0.0051438
0x49d308a6dc827fe7633101793968489e65fd4228a852adcddb0426ff31232fa3696 days 18 hrs agoOraclize  IN   etherisc0 Ether0.00480454
0xef5e41e78a050c2fc62ce08f2d35a5e4f2352d4a7b9f6bd0b4ff486bf89c24a5696 days 19 hrs agoOraclize  IN   etherisc0 Ether0.0051438
0x6cf8c6ad8cef2bed87a80704ed35bc3b39b901a94e2f7643a30bcd8d78c6af3b696 days 19 hrs agoOraclize  IN   etherisc0 Ether0.00480454
0xab723cc54d54f07aaf1d6c6e7f6ae083985d528731b7efb4b8438dec2d524956696 days 20 hrs agoOraclize  IN   etherisc0 Ether0.00480454
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
 Latest 25 Internal Txns, Click here to View More View All
ParentTxHash Block Age From To Value
0x714fe830afcd79953ba7584cde23a09bdc824d32bf4135cef3738ba361e8a26d2440530670 days 6 hrs ago0xa00d52431f51223b6cff30aefb8d08007d6a1c740x4d54be5a62f5d9fcf4b17c7ab6e68822c142ec6b0 Ether
0xca761e4534db9b7c10fbff429a3b2ec050095c819389fb7f88222a584071e3692440527670 days 6 hrs ago0x178c793b18a1e53b6402a7454b61b1046f8adf990x4d54be5a62f5d9fcf4b17c7ab6e68822c142ec6b0 Ether
0x88b6693e0f338c153bc1d990ae44e4c3409b561ccf19ec62654c45cadd74a7fe2439600670 days 10 hrs ago0x87fb2458ef0d5be4a43acb2e728d1741812bf6eb0x4d54be5a62f5d9fcf4b17c7ab6e68822c142ec6b0 Ether
0xaef0d0de5e4dd14731b900f6f4c8b01449a54769ae965a5156275fd24680d0242439594670 days 10 hrs ago0xa76151762bd6b8eefc5d70f297bd8f3e8ca8d2400x4d54be5a62f5d9fcf4b17c7ab6e68822c142ec6b0 Ether
0x27470aa1d18588247386a3703b2f11a8ab4c4c4b4075a22069c291acea5901c82439592670 days 10 hrs ago0xb1ebfb6b7268e0ba004c1fe606815636057bb7740x4d54be5a62f5d9fcf4b17c7ab6e68822c142ec6b0 Ether
0xe095db44c9d29b7d14e22eebdd92321d8a8019ef87858b28239a7d07342381962439149670 days 12 hrs ago0x880b322587937e0e1fe37b868dc2339575bc0a790x4d54be5a62f5d9fcf4b17c7ab6e68822c142ec6b0 Ether
0x6fc0bfe696f4bf300fbf691313e55dbe39240af88135b9fbf1fc1e5fefb8b5ba2439074670 days 12 hrs ago0x273346fa685408cfde4b5f1d620c8e5c265df84a0x4d54be5a62f5d9fcf4b17c7ab6e68822c142ec6b0 Ether
0xb6f2bc0794302d6e2ec6195a07f317a3a6d278e6306fd252c735ef59c3ecbbbe2438948670 days 13 hrs ago0x1c6b5a73c53eca8c90cf8b7066610f3e18065aad0x4d54be5a62f5d9fcf4b17c7ab6e68822c142ec6b0 Ether
0xa06018177dbdb52c1e95ee5b91ee2e2ea5472646566d8cff96ff440cf7612d492438936670 days 13 hrs ago0xbe33f67647898a7342da8ac65765c6746040e0b80x4d54be5a62f5d9fcf4b17c7ab6e68822c142ec6b0 Ether
0xd4ff20b8123e231d199333bb97ac3c08eb767157e93f2948ba5204211d2ef8912438863670 days 13 hrs ago0x889297dca98c10be6f7ad2ce98d8aace155d27b30x4d54be5a62f5d9fcf4b17c7ab6e68822c142ec6b0 Ether
0x684acf4e91e28b54348460ed0e96e2685e075ec9ebc31fb279205ad815ffa9bc2438724670 days 14 hrs ago0x5e7aad31e35793ddee4996f84b39911a2b47ccf90x4d54be5a62f5d9fcf4b17c7ab6e68822c142ec6b0 Ether
0x316ca7fda55f933e4c318bcc9bcabddf68e406eb91070d8638364a52b5cfa8162438517670 days 15 hrs ago0x713e473bcd07880ce4401512b91664951883cce70x4d54be5a62f5d9fcf4b17c7ab6e68822c142ec6b0 Ether
0xefb932fce3c0580599c99aa4f34cc2dc711f2f3859a116ab8ded9624cd76bdf72438507670 days 15 hrs ago0xb8f9959c1f996236af2996413dd88308b6d9efc10x4d54be5a62f5d9fcf4b17c7ab6e68822c142ec6b0 Ether
0x0326f57a16fb204d8da452589e69c8b6854dfc6125e9bedf3b2f486e5b1fcb4e2438465670 days 15 hrs ago0x690ac703e69138e37238a086d2eebcaeb2cf5abd0x4d54be5a62f5d9fcf4b17c7ab6e68822c142ec6b0 Ether
0x0414ccdbcddf309c2d86a6ad9850249190b2ad75c6823a8b59cca3d3d499b56b2438459670 days 15 hrs ago0xa69e954d4ca939bd22af794a8702c377876c53fa0x4d54be5a62f5d9fcf4b17c7ab6e68822c142ec6b0 Ether
0x261df5341e1aa09ebb63a9111733778dfe920dad29d82f4ac842a8b4e24041cd2438438670 days 15 hrs ago0x83859940431967251a48ee08014d52dfbfe6ce440x4d54be5a62f5d9fcf4b17c7ab6e68822c142ec6b0 Ether
0x5cd7ff67f1004222aefe06ebc4d742e5bf8333f470a7334f25e7844bd06f7f3c2438435670 days 15 hrs ago0x1a8ec4f3b910b76f2b4e1f690aaeaa164e8d0ea20x4d54be5a62f5d9fcf4b17c7ab6e68822c142ec6b0 Ether
0xd2a129377156f4ec5c719427c42f24b80468486091bc881bd48d43bdb2b6afcb2438433670 days 15 hrs ago0x77f70cc52fe611b70bafd2f2029ac39534189e2a0x4d54be5a62f5d9fcf4b17c7ab6e68822c142ec6b0 Ether
0x63f9f45958dfc581f3835e3e28c494ff0107669a8d2027c514c79ed8aa788ee52438388670 days 15 hrs ago0xc821aa24ad4080ab0dee22d03ad799efb0b297ed0x4d54be5a62f5d9fcf4b17c7ab6e68822c142ec6b0 Ether
0xfffc12100b50949dc499d060d0dbfc263ca1162973a1e4bad4d19cf0214b6d3a2438383670 days 15 hrs ago0x44a0932a883c40b73eeb0b14ad08b22d6fce05010x4d54be5a62f5d9fcf4b17c7ab6e68822c142ec6b0 Ether
0xdf5d0fe33c1545af2ef70263b640764b3a79a2c8f21f8ca642eba10aaee5ec772438332670 days 15 hrs ago0xdab76543bf59cc8a7a05bb7d3d5df7f66821e8510x4d54be5a62f5d9fcf4b17c7ab6e68822c142ec6b0 Ether
0x92a2f324c003cf0488529bd8b4a4189b5a133520e2df820225ca92c70aeb1f6b2438321670 days 15 hrs ago0x1f6693bbc3a8c0f3d780912800787363523eb8e60x4d54be5a62f5d9fcf4b17c7ab6e68822c142ec6b0 Ether
0xdfc118096e5c8c0c7a251dbc485d52fe1dcbf13cd8c39c95fcf9bae08f926eac2438287670 days 15 hrs ago0x7caaf6c22694766f66c6a1d9e859485eeb24f95e0x4d54be5a62f5d9fcf4b17c7ab6e68822c142ec6b0 Ether
0xe7fda5e8253156dad8788a2ab63cb59986916041a29987846a6a7d4b020037db2438276670 days 16 hrs ago0xf5fabdc5dc8631c7bed06ea7b9b92963464b3a1f0x4d54be5a62f5d9fcf4b17c7ab6e68822c142ec6b0 Ether
0xf4cda6f03d34d206f1a3986515879b913594f2c3e944dd8c0a5db582d5e283012438264670 days 16 hrs ago0x08151f5ae597fc9f0fe838cbb04ec6a0bbb1c66a0x4d54be5a62f5d9fcf4b17c7ab6e68822c142ec6b0 Ether
[ Download CSV Export  ] 



  Contract Source Code   Find Similiar Contracts

/**
 * 
 *	@title 	FlightDelay contract
 *	@author	Christoph Mussenbrock, Stephan Karpischek
 *	
 *  @brief 	This is a smart contract modelling the financial compensation of 
 *			delayed flights. People can apply for a policy and get automatically 
 *			paid in case a plane is late. Probabilities are calculated based on
 *			public accessible information from http://www.flightstats.com. 
 *			Real time flight status information is also pulled from the 
 *			same source.
 *			A frontend for the contract is running on http://fdi.etherisc.com.
 *	
 *	@copyright (c) 2016 by the authors.
 *
 *	@remark To view the contract code, you have to scroll down past
 *  		the imported interfaces. 
 * 
 */

/**************************************************************************
 *
 *	Oraclize API
 *
 **************************************************************************/
 
// <ORACLIZE_API>
/*
Copyright (c) 2015-2016 Oraclize srl, Thomas Bertani



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.
*/

contract OraclizeI {
    address public cbAddress;
    function query(uint _timestamp, string _datasource, string _arg) returns (bytes32 _id);
    function query_withGasLimit(uint _timestamp, string _datasource, string _arg, uint _gaslimit) returns (bytes32 _id);
    function query2(uint _timestamp, string _datasource, string _arg1, string _arg2) returns (bytes32 _id);
    function query2_withGasLimit(uint _timestamp, string _datasource, string _arg1, string _arg2, uint _gaslimit) returns (bytes32 _id);
    function getPrice(string _datasource) returns (uint _dsprice);
    function getPrice(string _datasource, uint gaslimit) returns (uint _dsprice);
    function useCoupon(string _coupon);
    function setProofType(byte _proofType);
    function setCustomGasPrice(uint _gasPrice);
}
contract OraclizeAddrResolverI {
    function getAddress() 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 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 {
        address oraclizeAddr = OAR.getAddress();
        if (oraclizeAddr == 0){
            oraclize_setNetwork(networkID_auto);
            oraclizeAddr = OAR.getAddress();
        }
        oraclize = OraclizeI(oraclizeAddr);
        _
    }
    modifier coupon(string code){
        oraclize = OraclizeI(OAR.getAddress());
        oraclize.useCoupon(code);
        _
    }

    function oraclize_setNetwork(uint8 networkID) internal returns(bool){
        if (getCodeSize(0x1d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed)>0){
            OAR = OraclizeAddrResolverI(0x1d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed);
            return true;
        }
        if (getCodeSize(0x9efbea6358bed926b293d2ce63a730d6d98d43dd)>0){
            OAR = OraclizeAddrResolverI(0x9efbea6358bed926b293d2ce63a730d6d98d43dd);
            return true;
        }
        if (getCodeSize(0x20e12a1f859b3feae5fb2a0a32c18f5a65555bbf)>0){
            OAR = OraclizeAddrResolverI(0x20e12a1f859b3feae5fb2a0a32c18f5a65555bbf);
            return true;
        }
        return false;
    }
    
    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_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 getCodeSize(address _addr) constant internal returns(uint _size) {
        assembly {
            _size := extcodesize(_addr)
        }
    }


    function parseAddr(string _a) internal 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 >= 48)&&(b1 <= 57)) b1 -= 48;
            if ((b2 >= 97)&&(b2 <= 102)) b2 -= 87;
            else if ((b2 >= 48)&&(b2 <= 57)) b2 -= 48;
            iaddr += (b1*16+b2);
        }
        return address(iaddr);
    }


    function strCompare(string _a, string _b) internal 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 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 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 returns (string) {
        return strConcat(_a, _b, _c, _d, "");
    }

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

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

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

    // parseInt(parseFloat*10^_b)
    function parseInt(string _a, uint _b) internal 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;
    }
    

}
// </ORACLIZE_API>


/**************************************************************************
 *
 *	Arachnid Strings utils.
 *
 **************************************************************************/

/*
 * @title String & slice utility library for Solidity contracts.
 * @author Nick Johnson <[email protected]>
 *
 * @dev Functionality in this library is largely implemented using an
 *      abstraction called a 'slice'. A slice represents a part of a string -
 *      anything from the entire string to a single character, or even no
 *      characters at all (a 0-length slice). Since a slice only has to specify
 *      an offset and a length, copying and manipulating slices is a lot less
 *      expensive than copying and manipulating the strings they reference.
 *
 *      To further reduce gas costs, most functions on slice that need to return
 *      a slice modify the original one instead of allocating a new one; for
 *      instance, `s.split(".")` will return the text up to the first '.',
 *      modifying s to only contain the remainder of the string after the '.'.
 *      In situations where you do not want to modify the original slice, you
 *      can make a copy first with `.copy()`, for example:
 *      `s.copy().split(".")`. Try and avoid using this idiom in loops; since
 *      Solidity has no memory management, it will result in allocating many
 *      short-lived slices that are later discarded.
 *
 *      Functions that return two slices come in two versions: a non-allocating
 *      version that takes the second slice as an argument, modifying it in
 *      place, and an allocating version that allocates and returns the second
 *      slice; see `nextRune` for example.
 *
 *      Functions that have to copy string data will return strings rather than
 *      slices; these can be cast back to slices for further processing if
 *      required.
 *
 *      For convenience, some functions are provided with non-modifying
 *      variants that create a new slice and return both; for instance,
 *      `s.splitNew('.')` leaves s unmodified, and returns two values
 *      corresponding to the left and right parts of the string.
 */
library strings {
    struct slice {
        uint _len;
        uint _ptr;
    }

    function memcpy(uint dest, uint src, uint len) private {
        // Copy word-length chunks while possible
        for(; len >= 32; len -= 32) {
            assembly {
                mstore(dest, mload(src))
            }
            dest += 32;
            src += 32;
        }

        // Copy remaining bytes
        uint mask = 256 ** (32 - len) - 1;
        assembly {
            let srcpart := and(mload(src), not(mask))
            let destpart := and(mload(dest), mask)
            mstore(dest, or(destpart, srcpart))
        }
    }

    /*
     * @dev Returns a slice containing the entire string.
     * @param self The string to make a slice from.
     * @return A newly allocated slice containing the entire string.
     */
    function toSlice(string self) internal returns (slice) {
        uint ptr;
        assembly {
            ptr := add(self, 0x20)
        }
        return slice(bytes(self).length, ptr);
    }

    /*
     * @dev Returns the length of a null-terminated bytes32 string.
     * @param self The value to find the length of.
     * @return The length of the string, from 0 to 32.
     */
    function len(bytes32 self) internal returns (uint) {
        uint ret;
        if (self == 0)
            return 0;
        if (self & 0xffffffffffffffffffffffffffffffff == 0) {
            ret += 16;
            self = bytes32(uint(self) / 0x100000000000000000000000000000000);
        }
        if (self & 0xffffffffffffffff == 0) {
            ret += 8;
            self = bytes32(uint(self) / 0x10000000000000000);
        }
        if (self & 0xffffffff == 0) {
            ret += 4;
            self = bytes32(uint(self) / 0x100000000);
        }
        if (self & 0xffff == 0) {
            ret += 2;
            self = bytes32(uint(self) / 0x10000);
        }
        if (self & 0xff == 0) {
            ret += 1;
        }
        return 32 - ret;
    }

    /*
     * @dev Returns a slice containing the entire bytes32, interpreted as a
     *      null-termintaed utf-8 string.
     * @param self The bytes32 value to convert to a slice.
     * @return A new slice containing the value of the input argument up to the
     *         first null.
     */
    function toSliceB32(bytes32 self) internal returns (slice ret) {
        // Allocate space for `self` in memory, copy it there, and point ret at it
        assembly {
            let ptr := mload(0x40)
            mstore(0x40, add(ptr, 0x20))
            mstore(ptr, self)
            mstore(add(ret, 0x20), ptr)
        }
        ret._len = len(self);
    }

    /*
     * @dev Returns a new slice containing the same data as the current slice.
     * @param self The slice to copy.
     * @return A new slice containing the same data as `self`.
     */
    function copy(slice self) internal returns (slice) {
        return slice(self._len, self._ptr);
    }

    /*
     * @dev Copies a slice to a new string.
     * @param self The slice to copy.
     * @return A newly allocated string containing the slice's text.
     */
    function toString(slice self) internal returns (string) {
        var ret = new string(self._len);
        uint retptr;
        assembly { retptr := add(ret, 32) }

        memcpy(retptr, self._ptr, self._len);
        return ret;
    }

    /*
     * @dev Returns the length in runes of the slice. Note that this operation
     *      takes time proportional to the length of the slice; avoid using it
     *      in loops, and call `slice.empty()` if you only need to know whether
     *      the slice is empty or not.
     * @param self The slice to operate on.
     * @return The length of the slice in runes.
     */
    function len(slice self) internal returns (uint) {
        // Starting at ptr-31 means the LSB will be the byte we care about
        var ptr = self._ptr - 31;
        var end = ptr + self._len;
        for (uint len = 0; ptr < end; len++) {
            uint8 b;
            assembly { b := and(mload(ptr), 0xFF) }
            if (b < 0x80) {
                ptr += 1;
            } else if(b < 0xE0) {
                ptr += 2;
            } else if(b < 0xF0) {
                ptr += 3;
            } else if(b < 0xF8) {
                ptr += 4;
            } else if(b < 0xFC) {
                ptr += 5;
            } else {
                ptr += 6;
            }
        }
        return len;
    }

    /*
     * @dev Returns true if the slice is empty (has a length of 0).
     * @param self The slice to operate on.
     * @return True if the slice is empty, False otherwise.
     */
    function empty(slice self) internal returns (bool) {
        return self._len == 0;
    }

    /*
     * @dev Returns a positive number if `other` comes lexicographically after
     *      `self`, a negative number if it comes before, or zero if the
     *      contents of the two slices are equal. Comparison is done per-rune,
     *      on unicode codepoints.
     * @param self The first slice to compare.
     * @param other The second slice to compare.
     * @return The result of the comparison.
     */
    function compare(slice self, slice other) internal returns (int) {
        uint shortest = self._len;
        if (other._len < self._len)
            shortest = other._len;

        var selfptr = self._ptr;
        var otherptr = other._ptr;
        for (uint idx = 0; idx < shortest; idx += 32) {
            uint a;
            uint b;
            assembly {
                a := mload(selfptr)
                b := mload(otherptr)
            }
            if (a != b) {
                // Mask out irrelevant bytes and check again
                uint mask = ~(2 ** (8 * (32 - shortest + idx)) - 1);
                var diff = (a & mask) - (b & mask);
                if (diff != 0)
                    return int(diff);
            }
            selfptr += 32;
            otherptr += 32;
        }
        return int(self._len) - int(other._len);
    }

    /*
     * @dev Returns true if the two slices contain the same text.
     * @param self The first slice to compare.
     * @param self The second slice to compare.
     * @return True if the slices are equal, false otherwise.
     */
    function equals(slice self, slice other) internal returns (bool) {
        return compare(self, other) == 0;
    }

    /*
     * @dev Extracts the first rune in the slice into `rune`, advancing the
     *      slice to point to the next rune and returning `self`.
     * @param self The slice to operate on.
     * @param rune The slice that will contain the first rune.
     * @return `rune`.
     */
    function nextRune(slice self, slice rune) internal returns (slice) {
        rune._ptr = self._ptr;

        if (self._len == 0) {
            rune._len = 0;
            return rune;
        }

        uint len;
        uint b;
        // Load the first byte of the rune into the LSBs of b
        assembly { b := and(mload(sub(mload(add(self, 32)), 31)), 0xFF) }
        if (b < 0x80) {
            len = 1;
        } else if(b < 0xE0) {
            len = 2;
        } else if(b < 0xF0) {
            len = 3;
        } else {
            len = 4;
        }

        // Check for truncated codepoints
        if (len > self._len) {
            rune._len = self._len;
            self._ptr += self._len;
            self._len = 0;
            return rune;
        }

        self._ptr += len;
        self._len -= len;
        rune._len = len;
        return rune;
    }

    /*
     * @dev Returns the first rune in the slice, advancing the slice to point
     *      to the next rune.
     * @param self The slice to operate on.
     * @return A slice containing only the first rune from `self`.
     */
    function nextRune(slice self) internal returns (slice ret) {
        nextRune(self, ret);
    }

    /*
     * @dev Returns the number of the first codepoint in the slice.
     * @param self The slice to operate on.
     * @return The number of the first codepoint in the slice.
     */
    function ord(slice self) internal returns (uint ret) {
        if (self._len == 0) {
            return 0;
        }

        uint word;
        uint len;
        uint div = 2 ** 248;

        // Load the rune into the MSBs of b
        assembly { word:= mload(mload(add(self, 32))) }
        var b = word / div;
        if (b < 0x80) {
            ret = b;
            len = 1;
        } else if(b < 0xE0) {
            ret = b & 0x1F;
            len = 2;
        } else if(b < 0xF0) {
            ret = b & 0x0F;
            len = 3;
        } else {
            ret = b & 0x07;
            len = 4;
        }

        // Check for truncated codepoints
        if (len > self._len) {
            return 0;
        }

        for (uint i = 1; i < len; i++) {
            div = div / 256;
            b = (word / div) & 0xFF;
            if (b & 0xC0 != 0x80) {
                // Invalid UTF-8 sequence
                return 0;
            }
            ret = (ret * 64) | (b & 0x3F);
        }

        return ret;
    }

    /*
     * @dev Returns the keccak-256 hash of the slice.
     * @param self The slice to hash.
     * @return The hash of the slice.
     */
    function keccak(slice self) internal returns (bytes32 ret) {
        assembly {
            ret := sha3(mload(add(self, 32)), mload(self))
        }
    }

    /*
     * @dev Returns true if `self` starts with `needle`.
     * @param self The slice to operate on.
     * @param needle The slice to search for.
     * @return True if the slice starts with the provided text, false otherwise.
     */
    function startsWith(slice self, slice needle) internal returns (bool) {
        if (self._len < needle._len) {
            return false;
        }

        if (self._ptr == needle._ptr) {
            return true;
        }

        bool equal;
        assembly {
            let len := mload(needle)
            let selfptr := mload(add(self, 0x20))
            let needleptr := mload(add(needle, 0x20))
            equal := eq(sha3(selfptr, len), sha3(needleptr, len))
        }
        return equal;
    }

    /*
     * @dev If `self` starts with `needle`, `needle` is removed from the
     *      beginning of `self`. Otherwise, `self` is unmodified.
     * @param self The slice to operate on.
     * @param needle The slice to search for.
     * @return `self`
     */
    function beyond(slice self, slice needle) internal returns (slice) {
        if (self._len < needle._len) {
            return self;
        }

        bool equal = true;
        if (self._ptr != needle._ptr) {
            assembly {
                let len := mload(needle)
                let selfptr := mload(add(self, 0x20))
                let needleptr := mload(add(needle, 0x20))
                equal := eq(sha3(selfptr, len), sha3(needleptr, len))
            }
        }

        if (equal) {
            self._len -= needle._len;
            self._ptr += needle._len;
        }

        return self;
    }

    /*
     * @dev Returns true if the slice ends with `needle`.
     * @param self The slice to operate on.
     * @param needle The slice to search for.
     * @return True if the slice starts with the provided text, false otherwise.
     */
    function endsWith(slice self, slice needle) internal returns (bool) {
        if (self._len < needle._len) {
            return false;
        }

        var selfptr = self._ptr + self._len - needle._len;

        if (selfptr == needle._ptr) {
            return true;
        }

        bool equal;
        assembly {
            let len := mload(needle)
            let needleptr := mload(add(needle, 0x20))
            equal := eq(sha3(selfptr, len), sha3(needleptr, len))
        }

        return equal;
    }

    /*
     * @dev If `self` ends with `needle`, `needle` is removed from the
     *      end of `self`. Otherwise, `self` is unmodified.
     * @param self The slice to operate on.
     * @param needle The slice to search for.
     * @return `self`
     */
    function until(slice self, slice needle) internal returns (slice) {
        if (self._len < needle._len) {
            return self;
        }

        var selfptr = self._ptr + self._len - needle._len;
        bool equal = true;
        if (selfptr != needle._ptr) {
            assembly {
                let len := mload(needle)
                let needleptr := mload(add(needle, 0x20))
                equal := eq(sha3(selfptr, len), sha3(needleptr, len))
            }
        }

        if (equal) {
            self._len -= needle._len;
        }

        return self;
    }

    // Returns the memory address of the first byte of the first occurrence of
    // `needle` in `self`, or the first byte after `self` if not found.
    function findPtr(uint selflen, uint selfptr, uint needlelen, uint needleptr) private returns (uint) {
        uint ptr;
        uint idx;

        if (needlelen <= selflen) {
            if (needlelen <= 32) {
                // Optimized assembly for 68 gas per byte on short strings
                assembly {
                    let mask := not(sub(exp(2, mul(8, sub(32, needlelen))), 1))
                    let needledata := and(mload(needleptr), mask)
                    let end := add(selfptr, sub(selflen, needlelen))
                    ptr := selfptr
                    loop:
                    jumpi(exit, eq(and(mload(ptr), mask), needledata))
                    ptr := add(ptr, 1)
                    jumpi(loop, lt(sub(ptr, 1), end))
                    ptr := add(selfptr, selflen)
                    exit:
                }
                return ptr;
            } else {
                // For long needles, use hashing
                bytes32 hash;
                assembly { hash := sha3(needleptr, needlelen) }
                ptr = selfptr;
                for (idx = 0; idx <= selflen - needlelen; idx++) {
                    bytes32 testHash;
                    assembly { testHash := sha3(ptr, needlelen) }
                    if (hash == testHash)
                        return ptr;
                    ptr += 1;
                }
            }
        }
        return selfptr + selflen;
    }

    // Returns the memory address of the first byte after the last occurrence of
    // `needle` in `self`, or the address of `self` if not found.
    function rfindPtr(uint selflen, uint selfptr, uint needlelen, uint needleptr) private returns (uint) {
        uint ptr;

        if (needlelen <= selflen) {
            if (needlelen <= 32) {
                // Optimized assembly for 69 gas per byte on short strings
                assembly {
                    let mask := not(sub(exp(2, mul(8, sub(32, needlelen))), 1))
                    let needledata := and(mload(needleptr), mask)
                    ptr := add(selfptr, sub(selflen, needlelen))
                    loop:
                    jumpi(ret, eq(and(mload(ptr), mask), needledata))
                    ptr := sub(ptr, 1)
                    jumpi(loop, gt(add(ptr, 1), selfptr))
                    ptr := selfptr
                    jump(exit)
                    ret:
                    ptr := add(ptr, needlelen)
                    exit:
                }
                return ptr;
            } else {
                // For long needles, use hashing
                bytes32 hash;
                assembly { hash := sha3(needleptr, needlelen) }
                ptr = selfptr + (selflen - needlelen);
                while (ptr >= selfptr) {
                    bytes32 testHash;
                    assembly { testHash := sha3(ptr, needlelen) }
                    if (hash == testHash)
                        return ptr + needlelen;
                    ptr -= 1;
                }
            }
        }
        return selfptr;
    }

    /*
     * @dev Modifies `self` to contain everything from the first occurrence of
     *      `needle` to the end of the slice. `self` is set to the empty slice
     *      if `needle` is not found.
     * @param self The slice to search and modify.
     * @param needle The text to search for.
     * @return `self`.
     */
    function find(slice self, slice needle) internal returns (slice) {
        uint ptr = findPtr(self._len, self._ptr, needle._len, needle._ptr);
        self._len -= ptr - self._ptr;
        self._ptr = ptr;
        return self;
    }

    /*
     * @dev Modifies `self` to contain the part of the string from the start of
     *      `self` to the end of the first occurrence of `needle`. If `needle`
     *      is not found, `self` is set to the empty slice.
     * @param self The slice to search and modify.
     * @param needle The text to search for.
     * @return `self`.
     */
    function rfind(slice self, slice needle) internal returns (slice) {
        uint ptr = rfindPtr(self._len, self._ptr, needle._len, needle._ptr);
        self._len = ptr - self._ptr;
        return self;
    }

    /*
     * @dev Splits the slice, setting `self` to everything after the first
     *      occurrence of `needle`, and `token` to everything before it. If
     *      `needle` does not occur in `self`, `self` is set to the empty slice,
     *      and `token` is set to the entirety of `self`.
     * @param self The slice to split.
     * @param needle The text to search for in `self`.
     * @param token An output parameter to which the first token is written.
     * @return `token`.
     */
    function split(slice self, slice needle, slice token) internal returns (slice) {
        uint ptr = findPtr(self._len, self._ptr, needle._len, needle._ptr);
        token._ptr = self._ptr;
        token._len = ptr - self._ptr;
        if (ptr == self._ptr + self._len) {
            // Not found
            self._len = 0;
        } else {
            self._len -= token._len + needle._len;
            self._ptr = ptr + needle._len;
        }
        return token;
    }

    /*
     * @dev Splits the slice, setting `self` to everything after the first
     *      occurrence of `needle`, and returning everything before it. If
     *      `needle` does not occur in `self`, `self` is set to the empty slice,
     *      and the entirety of `self` is returned.
     * @param self The slice to split.
     * @param needle The text to search for in `self`.
     * @return The part of `self` up to the first occurrence of `delim`.
     */
    function split(slice self, slice needle) internal returns (slice token) {
        split(self, needle, token);
    }

    /*
     * @dev Splits the slice, setting `self` to everything before the last
     *      occurrence of `needle`, and `token` to everything after it. If
     *      `needle` does not occur in `self`, `self` is set to the empty slice,
     *      and `token` is set to the entirety of `self`.
     * @param self The slice to split.
     * @param needle The text to search for in `self`.
     * @param token An output parameter to which the first token is written.
     * @return `token`.
     */
    function rsplit(slice self, slice needle, slice token) internal returns (slice) {
        uint ptr = rfindPtr(self._len, self._ptr, needle._len, needle._ptr);
        token._ptr = ptr;
        token._len = self._len - (ptr - self._ptr);
        if (ptr == self._ptr) {
            // Not found
            self._len = 0;
        } else {
            self._len -= token._len + needle._len;
        }
        return token;
    }

    /*
     * @dev Splits the slice, setting `self` to everything before the last
     *      occurrence of `needle`, and returning everything after it. If
     *      `needle` does not occur in `self`, `self` is set to the empty slice,
     *      and the entirety of `self` is returned.
     * @param self The slice to split.
     * @param needle The text to search for in `self`.
     * @return The part of `self` after the last occurrence of `delim`.
     */
    function rsplit(slice self, slice needle) internal returns (slice token) {
        rsplit(self, needle, token);
    }

    /*
     * @dev Counts the number of nonoverlapping occurrences of `needle` in `self`.
     * @param self The slice to search.
     * @param needle The text to search for in `self`.
     * @return The number of occurrences of `needle` found in `self`.
     */
    function count(slice self, slice needle) internal returns (uint count) {
        uint ptr = findPtr(self._len, self._ptr, needle._len, needle._ptr) + needle._len;
        while (ptr <= self._ptr + self._len) {
            count++;
            ptr = findPtr(self._len - (ptr - self._ptr), ptr, needle._len, needle._ptr) + needle._len;
        }
    }

    /*
     * @dev Returns True if `self` contains `needle`.
     * @param self The slice to search.
     * @param needle The text to search for in `self`.
     * @return True if `needle` is found in `self`, false otherwise.
     */
    function contains(slice self, slice needle) internal returns (bool) {
        return rfindPtr(self._len, self._ptr, needle._len, needle._ptr) != self._ptr;
    }

    /*
     * @dev Returns a newly allocated string containing the concatenation of
     *      `self` and `other`.
     * @param self The first slice to concatenate.
     * @param other The second slice to concatenate.
     * @return The concatenation of the two strings.
     */
    function concat(slice self, slice other) internal returns (string) {
        var ret = new string(self._len + other._len);
        uint retptr;
        assembly { retptr := add(ret, 32) }
        memcpy(retptr, self._ptr, self._len);
        memcpy(retptr + self._len, other._ptr, other._len);
        return ret;
    }

    /*
     * @dev Joins an array of slices, using `self` as a delimiter, returning a
     *      newly allocated string.
     * @param self The delimiter to use.
     * @param parts A list of slices to join.
     * @return A newly allocated string containing all the slices in `parts`,
     *         joined with `self`.
     */
    function join(slice self, slice[] parts) internal returns (string) {
        if (parts.length == 0)
            return "";

        uint len = self._len * (parts.length - 1);
        for(uint i = 0; i < parts.length; i++)
            len += parts[i]._len;

        var ret = new string(len);
        uint retptr;
        assembly { retptr := add(ret, 32) }

        for(i = 0; i < parts.length; i++) {
            memcpy(retptr, parts[i]._ptr, parts[i]._len);
            retptr += parts[i]._len;
            if (i < parts.length - 1) {
                memcpy(retptr, self._ptr, self._len);
                retptr += self._len;
            }
        }

        return ret;
    }
}


/**************************************************************************
 * 
 *	Contract code starts here. 
 * 
 **************************************************************************/

/*

	FlightDelay with Oraclized Underwriting and Payout
	All times are UTC.
	Copyright (C) Christoph Mussenbrock, Stephan Karpischek
	
*/

contract FlightDelay is usingOraclize {

	using strings for *;

	modifier noEther { if (msg.value > 0) throw; _ }
	modifier onlyOwner { if (msg.sender != owner) throw; _ }
	modifier onlyOraclize {	if (msg.sender != oraclize_cbAddress()) throw; _ }

	modifier onlyInState (uint _policyId, policyState _state) {

		policy p = policies[_policyId];
		if (p.state != _state) throw;
		_

	}

	modifier onlyCustomer(uint _policyId) {

		policy p = policies[_policyId];
		if (p.customer != msg.sender) throw;
		_

	}

	modifier notInMaintenance {
		healthCheck();
		if (maintenance_mode >= maintenance_Emergency) throw;
		_
	}

	// the following modifier is always checked at last, so previous modifiers
	// may throw without affecting reentrantGuard
	modifier noReentrant {
		if (reentrantGuard) throw;
		reentrantGuard = true;
		_
		reentrantGuard = false;
	}

	// policy Status Codes and meaning:
	//
	// 00 = Applied:	the customer has payed a premium, but the oracle has
	//					not yet checked and confirmed.
	//					The customer can still revoke the policy.
	// 01 = Accepted:	the oracle has checked and confirmed.
	//					The customer can still revoke the policy.
	// 02 = Revoked:	The customer has revoked the policy.
	//					The premium minus cancellation fee is payed back to the
	//					customer by the oracle.
	// 03 = PaidOut:	The flight has ended with delay.
	//					The oracle has checked and payed out.
	// 04 = Expired:	The flight has endet with <15min. delay.
	//					No payout.
	// 05 = Declined:	The application was invalid.
	//					The premium minus cancellation fee is payed back to the
	//					customer by the oracle.
	// 06 = SendFailed:	During Revoke, Decline or Payout, sending ether failed
	//					for unknown reasons.
	//					The funds remain in the contracts RiskFund.


	//                  00       01        02       03
	enum policyState {Applied, Accepted, Revoked, PaidOut,
	//					04      05           06
					  Expired, Declined, SendFailed}

	// oraclize callback types:
	enum oraclizeState { ForUnderwriting, ForPayout }

	event LOG_PolicyApplied(
		uint policyId,
		address customer,
		string carrierFlightNumber,
		uint premium
	);
	event LOG_PolicyAccepted(
		uint policyId,
		uint statistics0,
		uint statistics1,
		uint statistics2,
		uint statistics3,
		uint statistics4,
		uint statistics5
	);
	event LOG_PolicyRevoked(
		uint policyId
	);
	event LOG_PolicyPaidOut(
		uint policyId,
		uint amount
	);
	event LOG_PolicyExpired(
		uint policyId
	);
	event LOG_PolicyDeclined(
		uint policyId,
		bytes32 reason
	);
	event LOG_PolicyManualPayout(
		uint policyId,
		bytes32 reason
	);
	event LOG_SendFail(
		uint policyId,
		bytes32 reason
	);
	event LOG_OraclizeCall(
		uint policyId,
		bytes32 queryId,
		string oraclize_url
	);
	event LOG_OraclizeCallback(
		uint policyId,
		bytes32 queryId,
		string result,
		bytes proof
	);
	event LOG_HealthCheck(
		bytes32 message, 
		int diff,
		uint balance,
		int ledgerBalance 
	);

	// some general constants for the system:
	// minimum observations for valid prediction
	uint constant minObservations 			= 10;
	// minimum premium to cover costs
	uint constant minPremium 				= 500 finney;
	// maximum premium
	uint constant maxPremium 				= 5 ether;
	// maximum payout
	uint constant maxPayout 				= 150 ether;
	// maximum cumulated weighted premium per risk
	uint maxCumulatedWeightedPremium		= 300 ether; 
	// 1 percent for DAO, 1 percent for maintainer
	uint8 constant rewardPercent 			= 2;
	// reserve for tail risks
	uint8 constant reservePercent 			= 1;
	// the weight pattern; in future versions this may become part of the policy struct.
	// currently can't be constant because of compiler restrictions
	// weightPattern[0] is not used, just to be consistent
    uint8[6] weightPattern 					= [0, 10,20,30,50,50];
	// Deadline for acceptance of policies: Mon, 26 Sep 2016 12:00:00 GMT
	uint contractDeadline 					= 1474891200; 

	// account numbers for the internal ledger:
	// sum of all Premiums of all currently active policies
	uint8 constant acc_Premium 				= 0;
	// Risk fund; serves as reserve for tail risks
	uint8 constant acc_RiskFund 			= 1;
	// sum of all payed out policies
	uint8 constant acc_Payout 				= 2;
	// the balance of the contract (negative!!)
	uint8 constant acc_Balance 				= 3;
	// the reward account for DAO and maintainer
	uint8 constant acc_Reward 				= 4;
	// oraclize costs
	uint8 constant acc_OraclizeCosts 		= 5;
	// when adding more accounts, remember to increase ledger array length

	// Maintenance modes 
	uint8 constant maintenance_None      	= 0;
	uint8 constant maintenance_BalTooHigh 	= 1;
	uint8 constant maintenance_Emergency 	= 255;
	
	
	// gas Constants for oraclize
	uint constant oraclizeGas 				= 500000;

	// URLs and query strings for oraclize

	string constant oraclize_RatingsBaseUrl =
		"[URL] json(https://api.flightstats.com/flex/ratings/rest/v1/json/flight/";
	string constant oraclizeRatingsQuery =
		"?${[decrypt] BGHdZ9cDNIfZogzCYUU+esupKmGPoVvNE38mj1ELQZHv9MybFpzBp90QQN6j33fzU2UvvX/NqE02z1bGJ9yY5X3Az/dLou0DdWTc/Pu9vYXaq8oTuq9Zyqjg+VQ9T6k/OrASsgCF8P9z+/vW3FO5odhpmqCrwUpvLZTAbhcNyCYjbnA16XUW}).ratings[0]['observations','late15','late30','late45','cancelled','diverted']";

	// [URL] json(https://api.flightstats.com/flex/flightstatus/rest/v2/json/flight/status/LH/410/dep/2016/09/01?appId={appId}&appKey={appKey})
	string constant oraclize_StatusBaseUrl =
	  "[URL] json(https://api.flightstats.com/flex/flightstatus/rest/v2/json/flight/status/";
	string constant oraclizeStatusQuery =
		"?${[decrypt] BGHdZ9cDNIfZogzCYUU+esupKmGPoVvNE38mj1ELQZHv9MybFpzBp90QQN6j33fzU2UvvX/NqE02z1bGJ9yY5X3Az/dLou0DdWTc/Pu9vYXaq8oTuq9Zyqjg+VQ9T6k/OrASsgCF8P9z+/vW3FO5odhpmqCrwUpvLZTAbhcNyCYjbnA16XUW}).flightStatuses[0]['status','delays','operationalTimes']";


	// the policy structure: this structure keeps track of the individual parameters of a policy.
	// typically customer address, premium and some status information.

	struct policy {

		// 0 - the customer
		address customer;
		// 1 - premium
		uint premium;

		// risk specific parameters:
		// 2 - pointer to the risk in the risks mapping
		bytes32 riskId;
		// custom payout pattern
		// in future versions, customer will be able to tamper with this array.
		// to keep things simple, we have decided to hard-code the array for all policies.
		// uint8[5] pattern;
		// 3 - probability weight. this is the central parameter
		uint weight;
		// 4 - calculated Payout
		uint calculatedPayout;
		// 5 - actual Payout
		uint actualPayout;

		// status fields:
		// 6 - the state of the policy
		policyState state;
		// 7 - time of last state change
		uint stateTime;
		// 8 - state change message/reason
		bytes32 stateMessage;
		// 9 - TLSNotary Proof
		bytes proof;
	}

	// the risk structure; this structure keeps track of the risk-
	// specific parameters.
	// several policies can share the same risk structure (typically 
	// some people flying with the same plane)

	struct risk {

		// 0 - Airline Code + FlightNumber
		string carrierFlightNumber;
		// 1 - scheduled departure and arrival time in the format /dep/YYYY/MM/DD
		string departureYearMonthDay;
		// 2 - the inital arrival time
		uint arrivalTime;
		// 3 - the final delay in minutes
		uint delayInMinutes;
		// 4 - the determined delay category (0-5)
		uint8 delay;
		// 5 - we limit the cumulated weighted premium to avoid cluster risks
		uint cumulatedWeightedPremium;
		// 6 - max cumulated Payout for this risk
		uint premiumMultiplier;
	}

	// the oraclize callback structure: we use several oraclize calls.
	// all oraclize calls will result in a common callback to __callback(...).
	// to keep track of the different querys we have to introduce this struct.

	struct oraclizeCallback {

		// for which policy have we called?
		uint policyId;
		// for which purpose did we call? {ForUnderwrite | ForPayout}
		oraclizeState oState;
		uint oraclizeTime;

	}

	address public owner;

	// Table of policies
	policy[] public policies;
	// Lookup policyIds from customer addresses
	mapping (address => uint[]) public customerPolicies;
	// Lookup policy Ids from queryIds
	mapping (bytes32 => oraclizeCallback) public oraclizeCallbacks;
	mapping (bytes32 => risk) public risks;
	// Internal ledger
	int[6] public ledger;

	// invariant: acc_Premium + acc_RiskFund + acc_Payout
	//						+ acc_Balance + acc_Reward == 0

	// Mutex
	bool public reentrantGuard;
	uint8 public maintenance_mode;

	function healthCheck() internal {
		int diff = int(this.balance-msg.value) + ledger[acc_Balance];
		if (diff == 0) {
			return; // everything ok.
		}
		if (diff > 0) {
			LOG_HealthCheck('Balance too high', diff, this.balance, ledger[acc_Balance]);
			maintenance_mode = maintenance_BalTooHigh;
		} else {
			LOG_HealthCheck('Balance too low', diff, this.balance, ledger[acc_Balance]);
			maintenance_mode = maintenance_Emergency;
		}
	}

	// manually perform healthcheck.
	// @param _maintenance_mode: 
	// 		0 = reset maintenance_mode, even in emergency
	// 		1 = perform health check
	//    255 = set maintenance_mode to maintenance_emergency (no newPolicy anymore)
	function performHealthCheck(uint8 _maintenance_mode) onlyOwner {
		maintenance_mode = _maintenance_mode;
		if (maintenance_mode > 0 && maintenance_mode < maintenance_Emergency) {
			healthCheck();
		}
	}

	function payReward() onlyOwner {

		if (!owner.send(this.balance)) throw;
		maintenance_mode = maintenance_Emergency; // don't accept any policies

	}

	function bookkeeping(uint8 _from, uint8 _to, uint _amount) internal {

		ledger[_from] -= int(_amount);
		ledger[_to] += int(_amount);

	}

	// if ledger gets corrupt for unknown reasons, have a way to correct it:
	function audit(uint8 _from, uint8 _to, uint _amount) onlyOwner {

		bookkeeping (_from, _to, _amount);

	}

	function getPolicyCount(address _customer)
		constant returns (uint _count) {
		return policies.length;
	}

	function getCustomerPolicyCount(address _customer)
		constant returns (uint _count) {
		return customerPolicies[_customer].length;
	}

	function bookAndCalcRemainingPremium() internal returns (uint) {

		uint v = msg.value;
		uint reserve = v * reservePercent / 100;
		uint remain = v - reserve;
		uint reward = remain * rewardPercent / 100;

		bookkeeping(acc_Balance, acc_Premium, v);
		bookkeeping(acc_Premium, acc_RiskFund, reserve);
		bookkeeping(acc_Premium, acc_Reward, reward);

		return (uint(remain - reward));

	}

	// constructor
	function FlightDelay (address _owner) {

		owner = _owner;
		reentrantGuard = false;
		maintenance_mode = maintenance_None;

		// initially put all funds in risk fund.
		bookkeeping(acc_Balance, acc_RiskFund, msg.value);
		oraclize_setProof(proofType_TLSNotary | proofStorage_IPFS);

	}

	// create new policy
	function newPolicy(
		string _carrierFlightNumber, 
		string _departureYearMonthDay, 
		uint _departureTime, 
		uint _arrivalTime
		) 
		notInMaintenance {

		// sanity checks:

		// don't accept too low or too high policies

		if (msg.value < minPremium || msg.value > maxPremium) {
			LOG_PolicyDeclined(0, 'Invalid premium value');
			if (!msg.sender.send(msg.value)) {
				LOG_SendFail(0, 'newPolicy sendback failed (1)');
			}
			return;
		}

        // don't accept flights with departure time earlier than in 24 hours, 
		// or arrivalTime before departureTime, 
		// or departureTime after Mon, 26 Sep 2016 12:00:00 GMT
        if (
			_arrivalTime < _departureTime ||
			_arrivalTime > _departureTime + 2 days ||
			_departureTime < now + 24 hours ||
			_departureTime > contractDeadline) {
			LOG_PolicyDeclined(0, 'Invalid arrival/departure time');
			if (!msg.sender.send(msg.value)) {
				LOG_SendFail(0, 'newPolicy sendback failed (2)');
			}
			return;
        }
		
		// accept only a number of maxIdenticalRisks identical risks:
		
		bytes32 riskId = sha3(
			_carrierFlightNumber, 
			_departureYearMonthDay, 
			_arrivalTime
		);
		risk r = risks[riskId];
	
		// roughly check, whether maxCumulatedWeightedPremium will be exceeded
		// (we accept the inaccuracy that the real remaining premium is 3% lower), 
		// but we are conservative;
		// if this is the first policy, the left side will be 0
		if (msg.value * r.premiumMultiplier + r.cumulatedWeightedPremium >= 
			maxCumulatedWeightedPremium) {
			LOG_PolicyDeclined(0, 'Cluster risk');
			if (!msg.sender.send(msg.value)) {
				LOG_SendFail(0, 'newPolicy sendback failed (3)');
			}
			return;
		} else if (r.cumulatedWeightedPremium == 0) {
			// at the first police, we set r.cumulatedWeightedPremium to the max.
			// this prevents further polices to be accepted, until the correct
			// value is calculated after the first callback from the oracle.
			r.cumulatedWeightedPremium = maxCumulatedWeightedPremium;
		}

		// store or update policy
		uint policyId = policies.length++;
		customerPolicies[msg.sender].push(policyId);
		policy p = policies[policyId];

		p.customer = msg.sender;
		// the remaining premium after deducting reserve and reward
		p.premium = bookAndCalcRemainingPremium();
		p.riskId = riskId;

		// store risk parameters
		// Airline Code
		if (r.premiumMultiplier == 0) { // then it is the first call.
			// we have a new struct
			r.carrierFlightNumber = _carrierFlightNumber;
			r.departureYearMonthDay = _departureYearMonthDay;
			r.arrivalTime = _arrivalTime;
		} else { // we cumulate the risk
			r.cumulatedWeightedPremium += p.premium * r.premiumMultiplier;
		}

		// now we have successfully applied
		p.state = policyState.Applied;
		p.stateMessage = 'Policy applied by customer';
		p.stateTime = now;
		LOG_PolicyApplied(policyId, msg.sender, _carrierFlightNumber, p.premium);

		// call oraclize to get Flight Stats; this will also call underwrite()
		getFlightStats(policyId, _carrierFlightNumber);
	}
	
	function underwrite(uint _policyId, uint[6] _statistics, bytes _proof) internal {

		policy p = policies[_policyId]; // throws if _policyId invalid
		uint weight;
		for (uint8 i = 1; i <= 5; i++ ) {
			weight += weightPattern[i] * _statistics[i];
			// 1% = 100 / 100% = 10,000
		}
		// to avoid div0 in the payout section, 
		// we have to make a minimal assumption on p.weight.
		if (weight == 0) { weight = 100000 / _statistics[0]; }

		risk r = risks[p.riskId];
		// we calculate the factors to limit cluster risks.
		if (r.premiumMultiplier == 0) { 
			// it's the first call, we accept any premium
			r.premiumMultiplier = 100000 / weight;
			r.cumulatedWeightedPremium = p.premium * 100000 / weight;
		}
		
		p.proof = _proof;
		p.weight = weight;

		// schedule payout Oracle
		schedulePayoutOraclizeCall(
			_policyId, 
			r.carrierFlightNumber, 
			r.departureYearMonthDay, 
			r.arrivalTime + 15 minutes
		);

		p.state = policyState.Accepted;
		p.stateMessage = 'Policy underwritten by oracle';
		p.stateTime = now;

		LOG_PolicyAccepted(
			_policyId, 
			_statistics[0], 
			_statistics[1], 
			_statistics[2], 
			_statistics[3], 
			_statistics[4],
			_statistics[5]
		);

	}
	
	function decline(uint _policyId, bytes32 _reason, bytes _proof)	internal {

		policy p = policies[_policyId];

		p.state = policyState.Declined;
		p.stateMessage = _reason;
		p.stateTime = now; // won't be reverted in case of errors
		p.proof = _proof;
		bookkeeping(acc_Premium, acc_Balance, p.premium);

		if (!p.customer.send(p.premium))  {
			bookkeeping(acc_Balance, acc_RiskFund, p.premium);
			p.state = policyState.SendFailed;
			p.stateMessage = 'decline: Send failed.';
			LOG_SendFail(_policyId, 'decline sendfail');
		}
		else {
			LOG_PolicyDeclined(_policyId, _reason);
		}


	}
	
	function schedulePayoutOraclizeCall(
		uint _policyId, 
		string _carrierFlightNumber, 
		string _departureYearMonthDay, 
		uint _oraclizeTime) 
		internal {

		string memory oraclize_url = strConcat(
			oraclize_StatusBaseUrl,
			_carrierFlightNumber,
			_departureYearMonthDay,
			oraclizeStatusQuery
			);

		bytes32 queryId = oraclize_query(_oraclizeTime, 'nested', oraclize_url, oraclizeGas);
		bookkeeping(acc_OraclizeCosts, acc_Balance, uint((-ledger[acc_Balance]) - int(this.balance)));
		oraclizeCallbacks[queryId] = oraclizeCallback(_policyId, oraclizeState.ForPayout, _oraclizeTime);

		LOG_OraclizeCall(_policyId, queryId, oraclize_url);
	}

	function payOut(uint _policyId, uint8 _delay, uint _delayInMinutes)
		notInMaintenance
		onlyOraclize
		onlyInState(_policyId, policyState.Accepted)
		internal {

		policy p = policies[_policyId];
		risk r = risks[p.riskId];
		r.delay = _delay;
		r.delayInMinutes = _delayInMinutes;
		
		if (_delay == 0) {
			p.state = policyState.Expired;
			p.stateMessage = 'Expired - no delay!';
			p.stateTime = now;
			LOG_PolicyExpired(_policyId);
		} else {

			uint payout = p.premium * weightPattern[_delay] * 10000 / p.weight;
			p.calculatedPayout = payout;

			if (payout > maxPayout) {
				payout = maxPayout;
			}

			if (payout > uint(-ledger[acc_Balance])) { // don't go for chapter 11
				payout = uint(-ledger[acc_Balance]);
			}

			p.actualPayout = payout;
			bookkeeping(acc_Payout, acc_Balance, payout);      // cash out payout


			if (!p.customer.send(payout))  {
				bookkeeping(acc_Balance, acc_Payout, payout);
				p.state = policyState.SendFailed;
				p.stateMessage = 'Payout, send failed!';
				p.actualPayout = 0;
				LOG_SendFail(_policyId, 'payout sendfail');
			}
			else {
				p.state = policyState.PaidOut;
				p.stateMessage = 'Payout successful!';
				p.stateTime = now; // won't be reverted in case of errors
				LOG_PolicyPaidOut(_policyId, payout);
			}
		}

	}

	// fallback function: don't accept ether, except from owner
	function () onlyOwner {

		// put additional funds in risk fund.
		bookkeeping(acc_Balance, acc_RiskFund, msg.value);

	}

	// internal, so no reentrant guard neccessary
	function getFlightStats(
		uint _policyId,
		string _carrierFlightNumber)
		internal {

		// call oraclize and retrieve the number of observations from flightstats API
		// format https://api.flightstats.com/flex/ratings/rest/v1/json/flight/OS/75?appId=**&appKey=**

		// using nested data sources (query type nested) and partial
		// encrypted queries in the next release of oraclize
		// note that the first call maps the encrypted string to the
		// sending contract address, this string can't be used from any other sender
		string memory oraclize_url = strConcat(
			oraclize_RatingsBaseUrl,
			_carrierFlightNumber,
			oraclizeRatingsQuery
			);

		bytes32 queryId = oraclize_query("nested", oraclize_url, oraclizeGas);
		// calculate the spent gas
		bookkeeping(acc_OraclizeCosts, acc_Balance, uint((-ledger[acc_Balance]) - int(this.balance)));
		oraclizeCallbacks[queryId] = oraclizeCallback(_policyId, oraclizeState.ForUnderwriting, 0);

		LOG_OraclizeCall(_policyId, queryId, oraclize_url);

	}

	// this is a dispatcher, but must be called __callback
	function __callback(bytes32 _queryId, string _result, bytes _proof) 
		onlyOraclize 
		noReentrant {

		oraclizeCallback o = oraclizeCallbacks[_queryId];
		LOG_OraclizeCallback(o.policyId, _queryId, _result, _proof);
		
		if (o.oState == oraclizeState.ForUnderwriting) {
            callback_ForUnderwriting(o.policyId, _result, _proof);
		}
        else {
            callback_ForPayout(_queryId, _result, _proof);
        }
	}

	function callback_ForUnderwriting(uint _policyId, string _result, bytes _proof) 
		onlyInState(_policyId, policyState.Applied)
		internal {

		var sl_result = _result.toSlice(); 		
		risk r = risks[policies[_policyId].riskId];

		// we expect result to contain 6 values, something like
		// "[61, 10, 4, 3, 0, 0]" ->
		// ['observations','late15','late30','late45','cancelled','diverted']

		if (bytes(_result).length == 0) {
			decline(_policyId, 'Declined (empty result)', _proof);
		} else {

			// now slice the string using
			// https://github.com/Arachnid/solidity-stringutils

			if (sl_result.count(', '.toSlice()) != 5) { 
				// check if result contains 6 values
				decline(_policyId, 'Declined (invalid result)', _proof);
			} else {
				sl_result.beyond("[".toSlice()).until("]".toSlice());

				uint observations = parseInt(
					sl_result.split(', '.toSlice()).toString());

				// decline on < minObservations observations,
				// can't calculate reasonable probabibilities
				if (observations <= minObservations) {
					decline(_policyId, 'Declined (too few observations)', _proof);
				} else {
					uint[6] memory statistics;
					// calculate statistics (scaled by 10000; 1% => 100)
					statistics[0] = observations;
					for(uint i = 1; i <= 5; i++) {
						statistics[i] =
							parseInt(
								sl_result.split(', '.toSlice()).toString()) 
								* 10000/observations;
					}

					// underwrite policy
					underwrite(_policyId, statistics, _proof);
				}
			}
		}
	} 

	function callback_ForPayout(bytes32 _queryId, string _result, bytes _proof) internal {

		oraclizeCallback o = oraclizeCallbacks[_queryId];
		uint policyId = o.policyId;
		var sl_result = _result.toSlice(); 		
		risk r = risks[policies[policyId].riskId];

		if (bytes(_result).length == 0) {
			if (o.oraclizeTime > r.arrivalTime + 180 minutes) {
				LOG_PolicyManualPayout(policyId, 'No Callback at +120 min');
				return;
			} else {
				schedulePayoutOraclizeCall(
					policyId, 
					r.carrierFlightNumber, 
					r.departureYearMonthDay, 
					o.oraclizeTime + 45 minutes
				);
			}
		} else {
						
			// first check status

			// extract the status field:
			sl_result.find('"'.toSlice()).beyond('"'.toSlice());
			sl_result.until(sl_result.copy().find('"'.toSlice()));
			bytes1 status = bytes(sl_result.toString())[0];	// s = L
			
			if (status == 'C') {
				// flight cancelled --> payout
				payOut(policyId, 4, 0);
				return;
			} else if (status == 'D') {
				// flight diverted --> payout					
				payOut(policyId, 5, 0);
				return;
			} else if (status != 'L' && status != 'A' && status != 'C' && status != 'D') {
				LOG_PolicyManualPayout(policyId, 'Unprocessable status');
				return;
			}
			
			// process the rest of the response:
			sl_result = _result.toSlice();
			bool arrived = sl_result.contains('actualGateArrival'.toSlice());

			if (status == 'A' || (status == 'L' && !arrived)) {
				// flight still active or not at gate --> reschedule
				if (o.oraclizeTime > r.arrivalTime + 180 minutes) {
					LOG_PolicyManualPayout(policyId, 'No arrival at +120 min');
				} else {
					schedulePayoutOraclizeCall(
						policyId, 
						r.carrierFlightNumber, 
						r.departureYearMonthDay, 
						o.oraclizeTime + 45 minutes
					);
				}
			} else if (status == 'L' && arrived) {
				var aG = '"arrivalGateDelayMinutes": '.toSlice();
				if (sl_result.contains(aG)) {
					sl_result.find(aG).beyond(aG);
					sl_result.until(sl_result.copy().find('"'.toSlice())
						.beyond('"'.toSlice()));
					sl_result.until(sl_result.copy().find('}'.toSlice()));
					sl_result.until(sl_result.copy().find(','.toSlice()));
					uint delayInMinutes = parseInt(sl_result.toString());
				} else {
					delayInMinutes = 0;
				}
				
				if (delayInMinutes < 15) {
					payOut(policyId, 0, 0);
				} else if (delayInMinutes < 30) {
					payOut(policyId, 1, delayInMinutes);
				} else if (delayInMinutes < 45) {
					payOut(policyId, 2, delayInMinutes);
				} else {
					payOut(policyId, 3, delayInMinutes);
				}
			} else { // no delay info
				payOut(policyId, 0, 0);
			}
		} 
	}
}




/* EOF */

    Contract ABI  
[{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"ledger","outputs":[{"name":"","type":"int256"}],"type":"function"},{"constant":true,"inputs":[],"name":"maintenance_mode","outputs":[{"name":"","type":"uint8"}],"type":"function"},{"constant":false,"inputs":[{"name":"_queryId","type":"bytes32"},{"name":"_result","type":"string"},{"name":"_proof","type":"bytes"}],"name":"__callback","outputs":[],"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"uint256"}],"name":"customerPolicies","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"oraclizeCallbacks","outputs":[{"name":"policyId","type":"uint256"},{"name":"oState","type":"uint8"},{"name":"oraclizeTime","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[{"name":"_customer","type":"address"}],"name":"getCustomerPolicyCount","outputs":[{"name":"_count","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"uint8"},{"name":"_to","type":"uint8"},{"name":"_amount","type":"uint256"}],"name":"audit","outputs":[],"type":"function"},{"constant":true,"inputs":[{"name":"_customer","type":"address"}],"name":"getPolicyCount","outputs":[{"name":"_count","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[],"name":"payReward","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"reentrantGuard","outputs":[{"name":"","type":"bool"}],"type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"risks","outputs":[{"name":"carrierFlightNumber","type":"string"},{"name":"departureYearMonthDay","type":"string"},{"name":"arrivalTime","type":"uint256"},{"name":"delayInMinutes","type":"uint256"},{"name":"delay","type":"uint8"},{"name":"cumulatedWeightedPremium","type":"uint256"},{"name":"premiumMultiplier","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":false,"inputs":[{"name":"_maintenance_mode","type":"uint8"}],"name":"performHealthCheck","outputs":[],"type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"policies","outputs":[{"name":"customer","type":"address"},{"name":"premium","type":"uint256"},{"name":"riskId","type":"bytes32"},{"name":"weight","type":"uint256"},{"name":"calculatedPayout","type":"uint256"},{"name":"actualPayout","type":"uint256"},{"name":"state","type":"uint8"},{"name":"stateTime","type":"uint256"},{"name":"stateMessage","type":"bytes32"},{"name":"proof","type":"bytes"}],"type":"function"},{"constant":false,"inputs":[{"name":"_carrierFlightNumber","type":"string"},{"name":"_departureYearMonthDay","type":"string"},{"name":"_departureTime","type":"uint256"},{"name":"_arrivalTime","type":"uint256"}],"name":"newPolicy","outputs":[],"type":"function"},{"inputs":[{"name":"_owner","type":"address"}],"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"policyId","type":"uint256"},{"indexed":false,"name":"customer","type":"address"},{"indexed":false,"name":"carrierFlightNumber","type":"string"},{"indexed":false,"name":"premium","type":"uint256"}],"name":"LOG_PolicyApplied","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"policyId","type":"uint256"},{"indexed":false,"name":"statistics0","type":"uint256"},{"indexed":false,"name":"statistics1","type":"uint256"},{"indexed":false,"name":"statistics2","type":"uint256"},{"indexed":false,"name":"statistics3","type":"uint256"},{"indexed":false,"name":"statistics4","type":"uint256"},{"indexed":false,"name":"statistics5","type":"uint256"}],"name":"LOG_PolicyAccepted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"policyId","type":"uint256"}],"name":"LOG_PolicyRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"policyId","type":"uint256"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"LOG_PolicyPaidOut","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"policyId","type":"uint256"}],"name":"LOG_PolicyExpired","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"policyId","type":"uint256"},{"indexed":false,"name":"reason","type":"bytes32"}],"name":"LOG_PolicyDeclined","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"policyId","type":"uint256"},{"indexed":false,"name":"reason","type":"bytes32"}],"name":"LOG_PolicyManualPayout","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"policyId","type":"uint256"},{"indexed":false,"name":"reason","type":"bytes32"}],"name":"LOG_SendFail","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"policyId","type":"uint256"},{"indexed":false,"name":"queryId","type":"bytes32"},{"indexed":false,"name":"oraclize_url","type":"string"}],"name":"LOG_OraclizeCall","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"policyId","type":"uint256"},{"indexed":false,"name":"queryId","type":"bytes32"},{"indexed":false,"name":"result","type":"string"},{"indexed":false,"name":"proof","type":"bytes"}],"name":"LOG_OraclizeCallback","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"message","type":"bytes32"},{"indexed":false,"name":"diff","type":"int256"},{"indexed":false,"name":"balance","type":"uint256"},{"indexed":false,"name":"ledgerBalance","type":"int256"}],"name":"LOG_HealthCheck","type":"event"}]

  Contract Creation Code Switch To Opcodes View
681043561a8829300000600255610120604081905260006060818152600a608052601460a052601e60c052603260e0819052610100526003926004928491905b8382111561007a57835183826101000a81548160ff02191690830217905550926020019260010160208160000104928301926001030261003f565b80156100a75782816101000a81549060ff021916905560010160208160000104928301926001030261007a565b50506100c89291505b8082111561013c57805460ff191681556001016100b0565b50506357e90dc06004556040516020806140908339810160405280805190602001909190505060058054600160a060020a031916821790556010805461ffff19169055610140600360013480600a60ff8516600681101561000a575050600d8054919091039055600b805490910190555050565b5090565b6102007f110000000000000000000000000000000000000000000000000000000000000060008054604080517f38cc48310000000000000000000000000000000000000000000000000000000081529051600160a060020a03909216916338cc483191600481810192602092909190829003018187876161da5a03f11561000a5750506040515191600160a060020a038316141590506102805761020f600060006000610326731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed5b3b90565b50613c8c806104046000396000f35b50600060009054906101000a9004600160a060020a0316600160a060020a03166338cc4831604051817c01000000000000000000000000000000000000000000000000000000000281526004018090506020604051808303816000876161da5a03f11561000a575050604051519150505b60018054600160a060020a031916821790819055604080517f688dcfd70000000000000000000000000000000000000000000000000000000081527fff00000000000000000000000000000000000000000000000000000000000000851660048201529051600160a060020a03929092169163688dcfd791602481810192600092909190829003018183876161da5a03f11561000a575050505050565b5060005b919050565b111561035c575060008054731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed600160a060020a03199091161790556001610321565b600061037b739efbea6358bed926b293d2ce63a730d6d98d43dd6101fc565b11156103b1575060008054739efbea6358bed926b293d2ce63a730d6d98d43dd600160a060020a03199091161790556001610321565b60006103d07320e12a1f859b3feae5fb2a0a32c18f5a65555bbf6101fc565b111561031d575060008054600160a060020a0319167320e12a1f859b3feae5fb2a0a32c18f5a65555bbf179055600161032156606060405236156100b95760e060020a600035046310a7fd7b81146100d757806320cf3e1f146100ef57806338bbfa50146101005780633e79e4c214610222578063426d5ef11461025557806344c5e75814610282578063572816ef146102a75780635f4b9b4f146102cf5780637842a3a4146102dd5780637f1ebc4d146102fc5780638993021b146103085780638da5cb5b146103435780638ed3475114610355578063d3e8948314610377578063f49e4745146104f4575b6105ad60055433600160a060020a039081169116146105af57610002565b6105f1600435600a8160068110156100025750015481565b610603601054610100900460ff1681565b60408051602060248035600481810135601f81018590048502860185019096528585526105ad9581359591946044949293909201918190840183828082843750506040805160209735808a0135601f81018a90048a0283018a01909352828252969897606497919650602491909101945090925082915084018382808284375094965050505050505060006108845b60006000600060009054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518160e060020a0281526004018090506020604051808303816000876161da5a03f11561000257505060405151915050600160a060020a038116600014156115dd5761158560005b600060006126c8731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed5b3b90565b6105f160043560243560076020526000828152604090208054829081101561000257506000908152602090200154905081565b6008602052600435600090815260409020805460028201546001929092015461061a9260ff919091169083565b6105f1600435600160a060020a0381166000908152600760205260409020545b919050565b6105ad600435602435604435600554600160a060020a039081163390911614610b0757610002565b6105f16004356006546102a2565b6105ad600554600160a060020a039081163390911614610b1257610002565b61063860105460ff1681565b60096020526004803560009081526040902060068101549181015460028201546003830154600584015461064c95600186019460ff16919087565b61077a600554600160a060020a031681565b6105ad600435600554600160a060020a039081163390911614610b5457610002565b6107976004356006805482908110156100025750600052600a02600080516020613b71833981519152810154600080516020613b518339815191528201547ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d458301547ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d408401547ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d428501547ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d438601547ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d448701547ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d468801547ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d47890154600160a060020a039890981698949793959294919360ff939093169290917ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d48018a565b6105ad6004808035906020019082018035906020019191908080601f01602080910402602001604051908101604052809392919081815260200183838082843750506040805160208835808b0135601f81018390048302840183019094528383529799986044989297509190910194509092508291508401838280828437509496505093359350506064359150506000600060006000610c2e5b600d543430600160a060020a03163103016000811415610ba157610c2b565b005b6105ef60036001345b80600a60ff851660068110156100025701805491909103905580600a60ff841660068110156100025701805490910190555b505050565b565b60408051918252519081900360200190f35b6040805160ff929092168252519081900360200190f35b60408051938452602084019290925282820152519081900360600190f35b604080519115158252519081900360200190f35b604080519081018690526060810185905260ff8416608082015260a0810183905260c0810182905260e08082528854600260018216156101009081026000190190921604918301829052829160208301918301908b9080156106ef5780601f106106c4576101008083540402835291602001916106ef565b820191906000526020600020905b8154815290600101906020018083116106d257829003601f168201915b50508381038252895460026001821615610100026000190190911604808252602091909101908a9080156107645780601f1061073957610100808354040283529160200191610764565b820191906000526020600020905b81548152906001019060200180831161074757829003601f168201915b5050995050505050505050505060405180910390f35b60408051600160a060020a03929092168252519081900360200190f35b60408051600160a060020a038c168152602081018b9052908101899052606081018890526080810187905260a0810186905260c0810185905260e0810184905261010081810184905261014061012083018181528454600260018216159094026000190116929092049083018190526101608301908490801561085b5780601f106108305761010080835404028352916020019161085b565b820191906000526020600020905b81548152906001019060200180831161083e57829003601f168201915b50509b50505050505050505050505060405180910390f35b6010805460ff191690555b50505050565b600160a060020a031633600160a060020a03161415156108a357610002565b60105460ff16156108b357610002565b506010805460ff191660011790556000838152600860209081526040805181842080548083528285018990526080938301848152885194840194909452875191957fd70c2c0e8b02e406449de284d799fe3dae14621b9ba0847733122a8420acb2b69591948a948a948a949193606085019260a08601928882019290918291859183918691600490601f850104600302600f01f150905090810190601f1680156109715780820380516001836020036101000a031916815260200191505b508381038252848181518152602001915080519060200190808383829060006004602084601f0104600302600f01f150905090810190601f1680156109ca5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a1600181015460ff1660001415610a91578054610873908484604080518082018252600080825260208201819052825160c08101909352909181906006815b6000815260200190600190039081610a1957905050600087600060006006600050838154811015610002575090527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d45600a830290810154600080516020613b718339815191529091019060ff16821461165957610002565b6108738484846040805180820182526000808252602082810182905283518085018552828152808201839052878352600890915292812080549093909291908190819081611c108a5b60408051808201825260008082526020918201528151808301909252825182529182019181019190915290565b6105ea8383836105b8565b604051600554600160a060020a03908116916000913016319082818181858883f193505050501515610b4357610002565b6010805461ff00191661ff00179055565b6010805461ff00191661010083810291909117918290556000910460ff16118015610b94575060ff60ff16601060019054906101000a900460ff1660ff16105b15610c2b57610c2b61058e565b60008113156124675760408051600d547f42616c616e636520746f6f20686967680000000000000000000000000000000082526020820184905230600160a060020a03163182840152606082015290517fb351f33763ede3906feda3a9eaa67ea47e88a0b98b3a1095d53f77b502856e889181900360800190a16010805461ff0019166101001790555b50565b60105460ff610100909104811610610c4557610002565b6706f05b59d3b20000341080610c625750674563918244f4000034115b15610d2a5760408051600081527f496e76616c6964207072656d69756d2076616c7565000000000000000000000060208201528151600080516020613a01833981519152929181900390910190a160405133600160a060020a031690600090349082818181858883f193505050501515610d205760408051600081527f6e6577506f6c6963792073656e646261636b206661696c65642028312900000060208201528151600080516020613a21833981519152929181900390910190a15b5050505050505050565b85851080610d3c5750856202a3000185115b80610d4b575042620151800186105b80610d57575060045486115b15610e195760408051600081527f496e76616c6964206172726976616c2f6465706172747572652074696d65000060208201528151600080516020613a01833981519152929181900390910190a160405133600160a060020a031690600090349082818181858883f193505050501515610d205760408051600081527f6e6577506f6c6963792073656e646261636b206661696c65642028322900000060208201528151600080516020613a21833981519152929181900390910190a1610d20565b878786604051808480519060200190808383829060006004602084601f0104600302600f01f1509050018380519060200190808383829060006004602084601f0104600302600f01f1509050018281526020019350505050604051809103902093506009600050600085600019168152602001908152602001600020600050925060026000505483600501600050548460060160005054340201101515610f7f57600080516020613a01833981519152600060405180828152602001807f436c7573746572207269736b000000000000000000000000000000000000000081526020015060200191505060405180910390a160405133600160a060020a031690600090349082818181858883f193505050501515610d205760408051600081527f6e6577506f6c6963792073656e646261636b206661696c65642028332900000060208201528151600080516020613a21833981519152929181900390910190a1610d20565b600583015460001415610f955760025460058401555b6006805460018101808355909190828015829011610fcc57600a0281600a028360005260206000209182019101610fcc9190611020565b50505033600160a060020a03166000908152600760205260409020805460018101808355929450909182818380158290116110d0578183600052602060002091820191016110d091906110b8565b5050600a015b808211156110cc578054600160a060020a031916815560006001828101829055600283810183905560038401839055600484018390556005840183905560068401805460ff191690556007840183905560088401839055600984018054848255909281161561010002600019011604601f81901061109e575061101a565b601f01602090049060005260206000209081019061101a91905b808211156110cc57600081556001016110b8565b5090565b50505060009283525060209091200182905560068054839081101561000257506000908152600a8302600080516020613b71833981519152018054600160a060020a03191633178155915061113b90346064808204908183039060028202046124ea600386866105b8565b6001820155600281018490556006830154600014156111ad5787836000016000509080519060200190828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106114bc57805160ff19168380011785555b506114ec9291506110b8565b60018101546006840154600585018054919092020190555b60068101805460ff191690557f506f6c696379206170706c69656420627920637573746f6d6572000000000000600882015542600782015560408051600183015484825233600160a060020a0381166020848101919091526060840183905260809484018581528d51958501959095528c517fd7cb7b04d22b468f36c5e0940a2708119fab22394386b39a44c50f26e7c47b8d95889593948f949093909260a084019186810191908190849082908590600090600490601f850104600302600f01f150905090810190601f1680156112b15780820380516001836020036101000a031916815260200191505b509550505050505060405180910390a1610d2082896020604051908101604052806000815260200150600061250d608060405190810160405280604881526020017f5b55524c5d206a736f6e2868747470733a2f2f6170692e666c6967687473746181526020017f74732e636f6d2f666c65782f726174696e67732f726573742f76312f6a736f6e81526020017f2f666c696768742f00000000000000000000000000000000000000000000000081526020015084610140604051908101604052806101108152602001613a41610110913960408051602081810183526000808352835180830185528181528451928301909452815290916131ea91869186918691905b60408051602081810183526000808352835180830185528190528351808301855281905283518083018552819052835180830185528190528351808301855281905283518083018552818152845192830185528183528551875189518b518d51985197988e988e988e988e988e98909792969195869501909101909101019080591061143e5750595b908082528060200260200182016040528015611455575b50935083925060009150600090505b885181101561387e57888181518110156100025790602001015160f860020a900460f860020a028383806001019450815181101561000257906020010190600160f860020a031916908160001a905350600101611464565b828001600101855582156111a1579182015b828111156111a15782518260005055916020019190600101906114ce565b505086836001016000509080519060200190828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061154757805160ff19168380011785555b506115779291506110b8565b8280016001018555821561153b579182015b8281111561153b578251826000505591602001919060010190611559565b5050600283018590556111c5565b50600060009054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518160e060020a0281526004018090506020604051808303816000876161da5a03f115610002575050604051519150505b60018054600160a060020a031916821790819055604080517fc281d19e0000000000000000000000000000000000000000000000000000000081529051600160a060020a03929092169163c281d19e9160048181019260209290919082900301816000876161da5a03f115610002575050604051519250505090565b6116628a610ada565b97506009600050600060066000508d8154811015610002575050600a8d02600080516020613b5183398151915201548152602091909152604081208b51909850141561176a57611ccb8b7f4465636c696e65642028656d70747920726573756c74290000000000000000008b5b600060066000508481548110156100025790600052602060002090600a020160005060068101805460ff191660051790556008810184905542600782015582516009820180546000828152602090819020949550919360026001831615610100026000190190921691909104601f908101839004820193928701908390106127aa57805160ff19168380011785555b506127da9291506110b8565b604080518082019091526002815260f560020a610161026020820152611793906117c590610ada565b60051461183f57611ccb8b7f4465636c696e65642028696e76616c696420726573756c7429000000000000008b6116cf565b89906000600082600001516128e485600001518660200151866000015187602001515b60008080808088871161348557602087116134975760018760200360080260020a031980875116888b038a018a96505b818388511614611834576001870196819010611818578b8b0196505b50505083945061348b565b60408051808201909152600181527f5d000000000000000000000000000000000000000000000000000000000000006020820152611880906118b290610ada565b50604080518082019091526002815260f560020a61016102602082015261194b9061198090611a4490611ac690610ada565b60408051808201909152600181527f5b0000000000000000000000000000000000000000000000000000000000000060208201526118f39061191f90610ada565b905b604080518082019091526000808252602082018190528351835182911015612979578492506129b9565b8b905b60408051808201909152600080825260208201819052835183519010156129235783915061296a565b9550600a8611611b1057611ccb8b7f4465636c696e65642028746f6f20666577206f62736572766174696f6e7329008b6116cf565b60006129c18260006040805160208101909152600090819052828180805b8351811015611a2057603060f860020a028482815181101561000257016020015160f860020a9081900402600160f860020a03191610801590611a0b5750603960f860020a028482815181101561000257016020015160f860020a9081900402600160f860020a03191611155b1561351b57811561357b578560001415613573575b6000861115611a3357600a86900a909202915b509095945050505050565b50611fde865b6040805160208181018352600080835283519182018452808252925184519293919290805910611a715750595b908082528060200260200182016040528015611a88575b50915060208201905061296a818560200151866000015160005b602082106134fd57825184526020938401939290920191601f199190910190611aa2565b8b905b604080518082019091526000808252602082015261296a83838360408051808201909152600080825260208281018290528551868201518651928701516134d193906117e8565b858552600193505b60058411611b565785611be4611980611a44611c096040604051908101604052806002815260200160f560020a61016102815260200150610ada9090565b611ccb8b868b6000600060006000600660005087815481101561000257508152600a8702600080516020613b71833981519152019350600191505b600560ff8316116129c857858260ff166006811015610002576020020151600360ff84166006811015610002576020808204909201549190066101000a900460ff16029092019160019190910190611b91565b6127100204858560068110156100025750506020850286015260019390930192611b18565b8c90611ac9565b9550600960005060006006600050898154811015610002575050600a8902600080516020613b5183398151915201548152602091909152604081208b519096501415611cd8578460020160005054612a300188600201600050541115611d0057604080518881527f4e6f2043616c6c6261636b206174202b313230206d696e000000000000000000602082015281517f48ab3ea1886950af47c1723491bd4cea531e19477a54702c5b8f74b4b3fb10d9929181900390910190a15b5050505050505050505050565b604080518082019091526001815260f960020a6011026020820152611f1490611f4190610ada565b604080518654602060026001831615610100026000190190921691909104601f8101829004820283018201909352828252611ccb928a9291899190830182828015611d8c5780601f10611d6157610100808354040283529160200191611d8c565b820191906000526020600020905b815481529060010190602001808311611d6f57829003601f168201915b50506040805160018d810180546020600293821615610100026000190190911692909204601f8101839004830284018301909452838352919550909350909150830182828015611e1d5780601f10611df257610100808354040283529160200191611e1d565b820191906000526020600020905b815481529060010190602001808311611e0057829003601f168201915b5050505060028d0154610a8c0190505b60206040519081016040528060008152602001506000612cb8608060405190810160405280605481526020017f5b55524c5d206a736f6e2868747470733a2f2f6170692e666c6967687473746181526020017f74732e636f6d2f666c65782f666c696768747374617475732f726573742f763281526020017f2f6a736f6e2f666c696768742f7374617475732f00000000000000000000000081526020015086866101206040519081016040528060fb8152602001613b9160fb913960408051602081810183528882528251908101909252878252906135ab9086908690869086906113b5565b50604080518082019091526001815260f960020a6011026020820152611a3e90611f9f90611fa690610ada565b604080518082019091526001815260f960020a6011026020820152611f6990611f6f90610ada565b90611922565b89905b6040805180820190915260008082526020828101829052845185820151855192860151612e8493906117e8565b87906118f5565b611fd8895b604080518082018252600080825260209182015281518083019092528251825282810151908201526102a2565b90611f72565b6000815181101561000257506020015160f860020a90819004029350600160f860020a0319841660f860020a604302141561202057611ccb876004600061204f565b60fa60020a601102600160f860020a03198516141561205d57611ccb876005600061204f565b611ccb87600060005b600060006000612ea061058e565b60fa60020a601302600160f860020a031985161480159061208f575060f860020a604102600160f860020a0319851614155b80156120ac575060f860020a604302600160f860020a0319851614155b80156120c9575060fa60020a601102600160f860020a0319851614155b1561212d57604080518881527f556e70726f6365737361626c6520737461747573000000000000000000000000602082015281517f48ab3ea1886950af47c1723491bd4cea531e19477a54702c5b8f74b4b3fb10d9929181900390910190a1611ccb565b6121368a610ada565b60408051808201909152601181527f61637475616c476174654172726976616c000000000000000000000000000000602082015290965061217a9061223290610ada565b925060f860020a604102600160f860020a0319851614806121b45750600160f860020a0319841660fa60020a6013021480156121b4575082155b1561229b578460020160005054612a300188600201600050541115611d0057604080518881527f4e6f206172726976616c206174202b313230206d696e00000000000000000000602082015281517f48ab3ea1886950af47c1723491bd4cea531e19477a54702c5b8f74b4b3fb10d9929181900390910190a1611ccb565b87905b805160208281015190840151845160009391926131e1928491600080808087861161382a57602086116138395760018660200360080260020a031980865116878a03890194505b8082865116146138635760001985019489901161227c57889450613868565b60fa60020a601302600160f860020a031985161480156122b85750825b156120465760408051808201909152601b81527f226172726976616c4761746544656c61794d696e75746573223a20000000000060208201526122fa90610ada565b91506123068683612235565b156123195761233382611f698882611f72565b5060005b600f81101561243157611ccb876000600061204f565b50604080518082019091526001815260f960020a601102602082015261236090611f9f906123a690610ada565b5060408051808201909152600181527f7d0000000000000000000000000000000000000000000000000000000000000060208201526123d790611f9f90611fa690610ada565b604080518082019091526001815260f960020a6011026020820152611f69906123ce90610ada565b611fd88b611fab565b5060408051808201909152600181527f2c00000000000000000000000000000000000000000000000000000000000000602082015261241d90611f9f90611fa690610ada565b5061242a61198087611a44565b905061231d565b601e81101561244657611ccb8760018361204f565b602d81101561245b57611ccb8760028361204f565b611ccb8760038361204f565b60408051600d547f42616c616e636520746f6f206c6f77000000000000000000000000000000000082526020820184905230600160a060020a03163182840152606082015290517fb351f33763ede3906feda3a9eaa67ea47e88a0b98b3a1095d53f77b502856e889181900360800190a16010805461ff00191661ff0017905550565b6124f760006001856105b8565b61250460006004836105b8565b90039392505050565b604080518082019091526006815260d260020a651b995cdd19590260208201529092506125b090836207a120600060006000600060009054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518160e060020a0281526004018090506020604051808303816000876161da5a03f11561000257505060405151915050600160a060020a03811682141561326b576132136000610201565b90506125d76005600330600160a060020a031631600a8290900160005054600003036105b8565b6040805160608181018352868252600060208381018281528486018381528784526008835286842095518655905160018601805460ff191690911790555160029490940193909355835188815280840186905293840182815286519285019290925285517f6dd82637d9e1fdfbdb0582c0fe172c2b02ed8e868a1837f623c9f2c48f027dce948994879489949293909260808501928681019291829185918391869190600490601f850104600302600f01f150905090810190601f1680156126b35780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a150505050565b11156126fc575060008054600160a060020a031916731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed17905560016102a2565b600061271b739efbea6358bed926b293d2ce63a730d6d98d43dd61021e565b111561274f575060008054600160a060020a031916739efbea6358bed926b293d2ce63a730d6d98d43dd17905560016102a2565b600061276e7320e12a1f859b3feae5fb2a0a32c18f5a65555bbf61021e565b11156127a2575060008054600160a060020a0319167320e12a1f859b3feae5fb2a0a32c18f5a65555bbf17905560016102a2565b5060006102a2565b8280016001018555821561175e579182015b8281111561175e5782518260005055916020019190600101906127bc565b50506127f06000600383600101600050546105b8565b60405181546001830154600160a060020a0391909116916000919082818181858883f193505050501515612832576128616003600183600101600050546105b8565b60408051858152602081018590528151600080516020613a01833981519152929181900390910190a150505050565b6006818101805460ff191690911790557f6465636c696e653a2053656e64206661696c65642e00000000000000000000006008820155604080518581527f6465636c696e652073656e646661696c0000000000000000000000000000000060208201528151600080516020613a21833981519152929181900390910190a161087e565b0190505b8351602085015101811161296a57818060010192505082600001516129718560200151830386600001510383866000015187602001516117e8565b50602083810151908301516001911461294b5750815160208481015190840151829020919020145b80156129665782518451038452825160208501805190910190525b8391505b5092915050565b0190506128e8565b505082518251602085810151908501519201039060019082146129a6575082516020840151819020908220145b80156129b55784518451900385525b8492505b505092915050565b90506102a2565b82600014156129db578551620186a00492505b5060028301546000908152600960205260408120600681015490911415612a1757620186a0838104600683015560018501540283900460058201555b84846009016000509080519060200190828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612a7057805160ff19168380011785555b50612aa09291506110b8565b82800160010185558215612a64579182015b82811115612a64578251826000505591602001919060010190612a82565b505060038401839055604080518254602060026001831615610100026000190190921691909104601f8101829004820283018201909352828252612b0a928a9291859190830182828015612c135780601f10612be857610100808354040283529160200191612c13565b60068401805460ff191660011790557f506f6c69637920756e6465727772697474656e206279206f7261636c6500000060088501554260078501557f8380bb92d300516d82b1201f440aa0e693109f9529af57488562d9967aec981b878760005050875188600150506020890151896002505060408a01518a6003505060608b01518b6004505060808c01518c6005909060200201516040518088815260200187815260200186815260200185815260200184815260200183815260200182815260200197505050505050505060405180910390a150505050505050565b820191906000526020600020905b815481529060010190602001808311612bf657829003601f168201915b505060408051600189810180546020600293821615610100026000190190911692909204601f8101839004830284018301909452838352919550909350909150830182828015612ca45780601f10612c7957610100808354040283529160200191612ca4565b820191906000526020600020905b815481529060010190602001808311612c8757829003601f168201915b505050506002860154610384019050611e2d565b6040805180820182526006815260d260020a651b995cdd1959026020828101919091528251600080547f38cc48310000000000000000000000000000000000000000000000000000000083529451959750612d6795899589946207a1209484938493600160a060020a0316926338cc48319260048181019391829003018187876161da5a03f11561000257505060405151915050600160a060020a03811682141561360c576135b46000610201565b9050612d8e6005600330600160a060020a031631600a8290900160005054600003036105b8565b604080516060818101835288825260016020838101828152848601898152600088815260088452878120965187559151938601805460ff191690941790935591516002949094019390935583518a815280840186905293840182815286519285019290925285517f6dd82637d9e1fdfbdb0582c0fe172c2b02ed8e868a1837f623c9f2c48f027dce948b94879489949293909260808501928681019291829185918391869190600490601f850104600302600f01f150905090810190601f168015612e6d5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a1505050505050565b845160208601805183039091038652819052849250905061296a565b60105460ff610100909104811610612eb757610002565b612ebf61018f565b600160a060020a031633600160a060020a0316141515612ede57610002565b8560016000600660005083815481101561000257509052600a82027ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d45810154600080516020613b71833981519152919091019060ff168214612f3f57610002565b600680548a90811015610002575050600a8902600080516020613b51833981519152810154600090815260096020526040812060048101805460ff19168c179055600381018a9055600080516020613b71833981519152909201975090955060ff8916141561301b5760068601805460ff191660041790557f45787069726564202d206e6f2064656c617921000000000000000000000000006008870155426007870155604080518a815290517f01dcf1a7b822e29dea0fbe09d2b189aef03f4d5fc4053bc34503a5d9c7a20ee99181900360200190a161314c565b6003868101549060ff8a1660068110156100025760208082049092015460018a0154929091066101000a900460ff16026127100204600487018190559350680821ab0d441498000084111561307757680821ab0d441498000093505b600d5460000384111561308d57600d5460000393505b600586018490556130a160026003866105b8565b6040518654600160a060020a031690600090869082818181858883f1935050505015156130d55761315760036002866105b8565b60068601805460ff191660031790557f5061796f7574207375636365737366756c2100000000000000000000000000006008870155426007870155604080518a81526020810186905281517fc675965f701550d92216640f105e180eecb8700a912a237e90c3dad73260c5d3929181900390910190a15b505050505050505050565b6006868101805460ff191690911790557f5061796f75742c2073656e64206661696c656421000000000000000000000000600887015560006005870155604080518a81527f7061796f75742073656e646661696c000000000000000000000000000000000060208201528151600080516020613a21833981519152929181900390910190a161314c565b14159392505050565b949350505050565b84518351855101900385528351810160208601525b8291505b509392505050565b50600060009054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518160e060020a0281526004018090506020604051808303816000876161da5a03f115610002575050604051519150505b60018054600160a060020a0319168217908190556040805160e260020a630bbceb33028152602481018790526004818101928352895160448301528951600160a060020a039490941693632ef3accc938b938a939192839260649290920191602087810192918291859183918691600091601f850104600302600f01f150905090810190601f1680156133125780820380516001836020036101000a031916815260200191505b5093505050506020604051808303816000876161da5a03f11561000257505060405151925050670de0b6b3a76400003a85020182111561335657506000915061320b565b600160009054906101000a9004600160a060020a0316600160a060020a031663c51be90f8360008989896040518660e060020a0281526004018085815260200180602001806020018481526020018381038352868181518152602001915080519060200190808383829060006004602084601f0104600302600f01f150905090810190601f1680156133fc5780820380516001836020036101000a031916815260200191505b508381038252858181518152602001915080519060200190808383829060006004602084601f0104600302600f01f150905090810190601f1680156134555780820380516001836020036101000a031916815260200191505b50965050505050505060206040518083038185886185025a03f11561000257505060405151945061320b92505050565b88880194505b50505050949350505050565b8686208894506000935091505b86890383116134855750858320808214156134c15783945061348b565b60019384019392909201916134a4565b602086810180519186019190915280518203855286519051919250018114156131f25760008552613207565b50905182516020929092036101000a60001901918216911916179052565b8381815181101561000257016020015160f860020a9081900402600160f860020a0319167f2e00000000000000000000000000000000000000000000000000000000000000141561356b57600191505b60010161199e565b600019909501945b600a83029250825060308482815181101561000257016020015160f860020a90819004810204039092019161356b565b95945050505050565b50600060009054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518160e060020a0281526004018090506020604051808303816000876161da5a03f115610002575050604051519150505b60018054600160a060020a0319168217908190556040805160e260020a630bbceb33028152602481018790526004818101928352895160448301528951600160a060020a039490941693632ef3accc938b938a939192839260649290920191602087810192918291859183918691600091601f850104600302600f01f150905090810190601f1680156136b35780820380516001836020036101000a031916815260200191505b5093505050506020604051808303816000876161da5a03f11561000257505060405151925050670de0b6b3a76400003a8502018211156136fc5750600091505b50949350505050565b600160009054906101000a9004600160a060020a0316600160a060020a031663c51be90f83898989896040518660e060020a0281526004018085815260200180602001806020018481526020018381038352868181518152602001915080519060200190808383829060006004602084601f0104600302600f01f150905090810190601f1680156137a15780820380516001836020036101000a031916815260200191505b508381038252858181518152602001915080519060200190808383829060006004602084601f0104600302600f01f150905090810190601f1680156137fa5780820380516001836020036101000a031916815260200191505b50965050505050505060206040518083038185886185025a03f1156100025750506040515194506136f392505050565b8693505b505050949350505050565b8585208689038801935091505b86831061382a57508482208082141561387257858301935061382e565b938701935b505082935061382e565b60001990920191613846565b5060005b87518110156138da57878181518110156100025790602001015160f860020a900460f860020a028383806001019450815181101561000257906020010190600160f860020a031916908160001a905350600101613882565b5060005b865181101561393657868181518110156100025790602001015160f860020a900460f860020a028383806001019450815181101561000257906020010190600160f860020a031916908160001a9053506001016138de565b5060005b855181101561399257858181518110156100025790602001015160f860020a900460f860020a028383806001019450815181101561000257906020010190600160f860020a031916908160001a90535060010161393a565b5060005b84518110156139ee57848181518110156100025790602001015160f860020a900460f860020a028383806001019450815181101561000257906020010190600160f860020a031916908160001a905350600101613996565b50909d9c5050505050505050505050505056db54702c000254117129eb89488777a91ec59db7879e711c3ec873cebe9ba124869338db4e92ef08ca9646c9d82d3aa15f5a359be565928a76f1ece40bcc03843f247b5b646563727970745d20424748645a3963444e49665a6f677a435955552b657375704b6d47506f56764e4533386d6a31454c515a4876394d796246707a4270393051514e366a3333667a5532557676582f4e714530327a3162474a397959355833417a2f644c6f753044645754632f5075397659586171386f547571395a79716a672b56513954366b2f4f724153736743463850397a2b2f765733464f356f6468706d714372775570764c5a54416268634e7943596a626e4131365855577d292e726174696e67735b305d5b276f62736572766174696f6e73272c276c6174653135272c276c6174653330272c276c6174653435272c2763616e63656c6c6564272c276469766572746564275df652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d41f652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f3f247b5b646563727970745d20424748645a3963444e49665a6f677a435955552b657375704b6d47506f56764e4533386d6a31454c515a4876394d796246707a4270393051514e366a3333667a5532557676582f4e714530327a3162474a397959355833417a2f644c6f753044645754632f5075397659586171386f547571395a79716a672b56513954366b2f4f724153736743463850397a2b2f765733464f356f6468706d714372775570764c5a54416268634e7943596a626e4131365855577d292e666c6967687453746174757365735b305d5b27737461747573272c2764656c617973272c276f7065726174696f6e616c54696d6573275d

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

-----Decoded View---------------
Found 1 constructor arguments :
Arg [0] : 0000000000000000000000005cb5f46a655c02889172323760d12d0e5d83cdaf


 

View All
Block Age txn Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward
Make sure to use the "downvote" button for any spammy posts, and the "upvote" for interesting conversations.