Sponsored Link:    Adshares - Decentralized marketplace for advertising. Active ICO with a price floor and buyback option.
Contract Overview
ETH Balance: 0.00000000005518154 Ether
ETH USD Value: less than $0.01 (@ $197.54/ETH)
No Of Transactions: 1764 txns
  Latest 25 txns from a total Of 1764 transactions View All

TxHash Block Age From To Value [TxFee]
0x45d4e36677fcd6c1e8b633aee6f52fea210711024f977026b28e8e20e446b0e13185622161 days 13 hrs ago0x1baeb01683c6f91c4140d9ec114e2b24d8450883  IN   0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0.1 Ether0.0042
0x7dd11d5ece66178275c03ec469f42bc12fff38aa6e484efcc468023d1ee17dc23181189162 days 6 hrs ago0x1baeb01683c6f91c4140d9ec114e2b24d8450883  IN   0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0.1 Ether0.0042
0x12a9b33c7cd32c1e090415237d0aa4969dbd76875eca19403c72dca3388c6a963179762162 days 12 hrs ago0xcab87c1285639a1be6e4f99e7c654b4957c320d2  IN   0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0.1 Ether0.0044
0x59b2fd6f2cd5ea37acbd3876fc7d1e9dc4570b24695ac780d5e7bfd3b68655223176506163 days 1 hr ago0xcab87c1285639a1be6e4f99e7c654b4957c320d2  IN   0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0.1 Ether0.0044
0xd3776d09cd19325cb2f9adc43886c6d06ec354ea8062154b89bd98d135e3729e3176497163 days 1 hr ago0xcab87c1285639a1be6e4f99e7c654b4957c320d2  IN   0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0.1 Ether0.0044
0x572ada3124bcb07b4d488284f982e0576c37cc15c6ae6a03c5d0c2d8b446060c3176169163 days 2 hrs ago0x5eb7ebbb15bdd2be5b4e37009a42b1dee95638af  IN   0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0 Ether0.00126247
0x6569ad206b0509984062e1244f4a478f0341cbb05ef83bfeccec846d51069f213171419163 days 21 hrs agoOraclize  IN   0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0 Ether0.00081152
0x1cd48b7aaa13d58070370db8c6f9ec793b25a544ea49ecbaeba268169134f96a3171416163 days 21 hrs ago0x44fe14e53050ec6c7e043d688201f9b673ce1fbb  IN   0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0.1 Ether0.00226921
0xb99c636d92d5815eb4b6af539097ce941f0a704fea7540dd975cdd0ee2957dfe3171411163 days 21 hrs agoOraclize  IN   0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0 Ether0.00081152
0x32861c63c1bed19c804e124d4e9ccf7ec1c5f1f0f6783d2dcd631e21a8968f323171408163 days 21 hrs ago0x44fe14e53050ec6c7e043d688201f9b673ce1fbb  IN   0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0.1 Ether0.00226921
0x35b428781f96e684d408b464a7a9c3787c62b02b38b0ab9481cf7598231598433169113164 days 6 hrs agoOraclize  IN   0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0 Ether0.00081152
0x14dbd8cac82db817ac6cec722442c6e476c4a6a64f0a0d95637e6ba90b910c203169111164 days 6 hrs ago0x3085ec50eb94e6fa9f60a0aa50974c08f5b1e044  IN   0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0.1 Ether0.00226921
0x0dd60398ffe791c60f8a2ddaf5256421ff04c9de3a16fa6301b7bfd6b9668ada3168988164 days 7 hrs agoOraclize  IN   0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0 Ether0.00081152
0x6a8c80a563ba227ce1807f8732316da1302101356a8c744ca756d8a8e1ec5cde3168986164 days 7 hrs ago0x932e8476180022977c1fe1c36a8732004b0cda2f  IN   0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0.2 Ether0.00237727
0x38cd58c0adb5c7a89b9e7dca0c8e794fe33181f0958a307b792c856c3eac00ef3168982164 days 7 hrs agoOraclize  IN   0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0 Ether0.00081152
0x3dbc2fbd2eb74cd74c38bc32c28b9f1d4336c4e38dcadaed9fc40a9f4c3e1aeb3168976164 days 7 hrs ago0x932e8476180022977c1fe1c36a8732004b0cda2f  IN   0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0.2 Ether0.00237727
0x14e82e4c1227ed77ac109840ab6efd52c0d7f5303a4a13d41c3db161093cde153168974164 days 7 hrs agoOraclize  IN   0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0 Ether0.00081152
0xec001aef97ba39a99c320d66b7e3d7c7e8bf3479259d7eb1ce1d2153bbd4d5623168971164 days 7 hrs ago0x932e8476180022977c1fe1c36a8732004b0cda2f  IN   0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0.2 Ether0.00237727
0x6e26efe897a756fe5da65590103be8fca66933577709650460e79b1baff4345e3168968164 days 7 hrs agoOraclize  IN   0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0 Ether0.00081152
0xea8abdfb76b558ba89e3d56746ab0fae5a123305163002f4ba5975a316d48d553168966164 days 7 hrs ago0x932e8476180022977c1fe1c36a8732004b0cda2f  IN   0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0.2 Ether0.00237727
0x9b732132ca01561e9443125e000bf761fe8753dbdfe26007a474f72f7330152b3168963164 days 7 hrs agoOraclize  IN   0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0 Ether0.00081024
0xfa433d7981414b193efbf2b3de2d780323df32b2462a78d45aae6c784951049c3168961164 days 7 hrs ago0x932e8476180022977c1fe1c36a8732004b0cda2f  IN   0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0.1 Ether0.00237727
0x2778a43c5412fd24d7bc0d334b6d15cab08e833449e7849a0e8c9ebc947644643168959164 days 7 hrs agoOraclize  IN   0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0 Ether0.00081152
0x099eeccc8e0c72ef9d638b4ac3e90a77095b505909f42bb9f9f54f4c524fe1443168957164 days 7 hrs ago0x932e8476180022977c1fe1c36a8732004b0cda2f  IN   0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0.1 Ether0.00237727
0x15af56d7ee5eb420d271e0df0b80c3ff9f9abc838b3c5e767cc7159b4653462e3168954164 days 7 hrs agoOraclize  IN   0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0 Ether0.00081152
[ 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
0x572ada3124bcb07b4d488284f982e0576c37cc15c6ae6a03c5d0c2d8b446060c3176169163 days 2 hrs ago0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0x5eb7ebbb15bdd2be5b4e37009a42b1dee95638af47.766381921 Ether
0x6569ad206b0509984062e1244f4a478f0341cbb05ef83bfeccec846d51069f213171419163 days 21 hrs ago0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0x44fe14e53050ec6c7e043d688201f9b673ce1fbb0.1 Ether
0x1cd48b7aaa13d58070370db8c6f9ec793b25a544ea49ecbaeba268169134f96a3171416163 days 21 hrs ago0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0x001a589dda0d6be37632925eaf1256986b2c6ad00.00319331742243436 Ether
0xb99c636d92d5815eb4b6af539097ce941f0a704fea7540dd975cdd0ee2957dfe3171411163 days 21 hrs ago0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0x44fe14e53050ec6c7e043d688201f9b673ce1fbb0.1 Ether
0x32861c63c1bed19c804e124d4e9ccf7ec1c5f1f0f6783d2dcd631e21a8968f323171408163 days 21 hrs ago0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0x001a589dda0d6be37632925eaf1256986b2c6ad00.00319331742243436 Ether
0x35b428781f96e684d408b464a7a9c3787c62b02b38b0ab9481cf7598231598433169113164 days 6 hrs ago0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0x3085ec50eb94e6fa9f60a0aa50974c08f5b1e0440.1 Ether
0x14dbd8cac82db817ac6cec722442c6e476c4a6a64f0a0d95637e6ba90b910c203169111164 days 6 hrs ago0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0x001a589dda0d6be37632925eaf1256986b2c6ad00.00319331742243436 Ether
0x0dd60398ffe791c60f8a2ddaf5256421ff04c9de3a16fa6301b7bfd6b9668ada3168988164 days 7 hrs ago0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0x932e8476180022977c1fe1c36a8732004b0cda2f0.2 Ether
0x6a8c80a563ba227ce1807f8732316da1302101356a8c744ca756d8a8e1ec5cde3168986164 days 7 hrs ago0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0x001a589dda0d6be37632925eaf1256986b2c6ad00.00319331742243436 Ether
0x38cd58c0adb5c7a89b9e7dca0c8e794fe33181f0958a307b792c856c3eac00ef3168982164 days 7 hrs ago0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0x932e8476180022977c1fe1c36a8732004b0cda2f0.2 Ether
0x3dbc2fbd2eb74cd74c38bc32c28b9f1d4336c4e38dcadaed9fc40a9f4c3e1aeb3168976164 days 7 hrs ago0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0x001a589dda0d6be37632925eaf1256986b2c6ad00.00319331742243436 Ether
0x14e82e4c1227ed77ac109840ab6efd52c0d7f5303a4a13d41c3db161093cde153168974164 days 7 hrs ago0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0x932e8476180022977c1fe1c36a8732004b0cda2f0.2 Ether
0xec001aef97ba39a99c320d66b7e3d7c7e8bf3479259d7eb1ce1d2153bbd4d5623168971164 days 7 hrs ago0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0x001a589dda0d6be37632925eaf1256986b2c6ad00.00319331742243436 Ether
0x6e26efe897a756fe5da65590103be8fca66933577709650460e79b1baff4345e3168968164 days 7 hrs ago0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0x932e8476180022977c1fe1c36a8732004b0cda2f0.2 Ether
0xea8abdfb76b558ba89e3d56746ab0fae5a123305163002f4ba5975a316d48d553168966164 days 7 hrs ago0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0x001a589dda0d6be37632925eaf1256986b2c6ad00.00319331742243436 Ether
0x9b732132ca01561e9443125e000bf761fe8753dbdfe26007a474f72f7330152b3168963164 days 7 hrs ago0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0x932e8476180022977c1fe1c36a8732004b0cda2f0.1 Ether
0xfa433d7981414b193efbf2b3de2d780323df32b2462a78d45aae6c784951049c3168961164 days 7 hrs ago0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0x001a589dda0d6be37632925eaf1256986b2c6ad00.00319331742243436 Ether
0x2778a43c5412fd24d7bc0d334b6d15cab08e833449e7849a0e8c9ebc947644643168959164 days 7 hrs ago0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0x932e8476180022977c1fe1c36a8732004b0cda2f0.1 Ether
0x099eeccc8e0c72ef9d638b4ac3e90a77095b505909f42bb9f9f54f4c524fe1443168957164 days 7 hrs ago0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0x001a589dda0d6be37632925eaf1256986b2c6ad00.00319331742243436 Ether
0x15af56d7ee5eb420d271e0df0b80c3ff9f9abc838b3c5e767cc7159b4653462e3168954164 days 7 hrs ago0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0x932e8476180022977c1fe1c36a8732004b0cda2f0.1 Ether
0xced5e974b36d73f7ce88b9ab7fbc3bc9aebc588d6a6e4ab5c22caca2e042ed4f3168951164 days 7 hrs ago0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0x001a589dda0d6be37632925eaf1256986b2c6ad00.00319331742243436 Ether
0x9817f7aaf762d2190c17faf214d6c5ad11c0553a8eb8856880839d45073b0c083168945164 days 7 hrs ago0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0x932e8476180022977c1fe1c36a8732004b0cda2f0.1 Ether
0xb4f81c1864e1396df9b909e2be36a75976dc48c7d1f10a43897fcfa2ed0fafad3168942164 days 7 hrs ago0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0x001a589dda0d6be37632925eaf1256986b2c6ad00.00319331742243436 Ether
0x4de314fe26570d92531c139905b9e37a6174f8d0d215d20350c28d5fac06b32a3168939164 days 7 hrs ago0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0x932e8476180022977c1fe1c36a8732004b0cda2f0.1 Ether
0x2d369521f0215d9afc60a9146794579e0ec5ad21130a85b4d27747452420c5403168935164 days 7 hrs ago0x76bc9e61a1904b82cbf70d1fd9c0f8a120483bbb0x001a589dda0d6be37632925eaf1256986b2c6ad00.00319331742243436 Ether
[ Download CSV Export  ] 
Contract Name: slot
Compiler Version: v0.4.2+commit.af6afb04
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts
// <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.
*/

pragma solidity ^0.4.0;

contract OraclizeI {
    address public cbAddress;
    function query(uint _timestamp, string _datasource, string _arg) payable returns (bytes32 _id);
    function query_withGasLimit(uint _timestamp, string _datasource, string _arg, uint _gaslimit) payable returns (bytes32 _id);
    function query2(uint _timestamp, string _datasource, string _arg1, string _arg2) payable returns (bytes32 _id);
    function query2_withGasLimit(uint _timestamp, string _datasource, string _arg1, string _arg2, uint _gaslimit) payable 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 {
        if(address(OAR)==0) oraclize_setNetwork(networkID_auto);
        oraclize = OraclizeI(OAR.getAddress());
        _;
    }
    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;
        }
        if (getCodeSize(0x9a1d6e5c6c8d081ac45c6af98b74a42442afba60)>0){
            OAR = OraclizeAddrResolverI(0x9a1d6e5c6c8d081ac45c6af98b74a42442afba60);
            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>






contract mortal {
    address owner;

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

    function kill() {
        if (msg.sender == owner) suicide(owner);
    }
}


contract slot is mortal, usingOraclize {
    /** which oraclize ID belong to which player address?**/
    mapping (bytes32 => address) players; 
    /** the amount of gas to be sent to oraclize**/
    uint32 public oraclizeGas;
    /** probabilities of the different results (absolute frequency out of 1.000.000 spins)**/
    uint32[] public probabilities;
    /** the prize per probability (shifted by two digits -> 375 is acutually 3.75)*/
    uint32[] public prizes;
    /** the amount of ether per bet **/
    mapping (bytes32 => uint) bets;
    /** tell the listeners the result
    first value: type, second value: player address, third value: oraclize ID**/
    event gameResult(uint, address);// 0-> %5; 1 -> 80%; 2 -> loss, 3->error in callback;

    
    /** **/
    function slot() payable{
        probabilities.push(4);
        probabilities.push(50);
        probabilities.push(200);
        probabilities.push(600);
        probabilities.push(1000);
        probabilities.push(2000);
        probabilities.push(4000);
        probabilities.push(30000);
        probabilities.push(90000);
        prizes.push(5000);
        prizes.push(2500);
        prizes.push(2000);
        prizes.push(1900);
        prizes.push(1800);
        prizes.push(1700);
        prizes.push(1600);
        prizes.push(1500);
        prizes.push(375);
        oraclizeGas = 100000;
    }
    
    /**
     * If more than 0.1 ether and less than 1 ether is sent and the contracts holds enough to pay out the player in case of a win, a random number is asked from oraclize.
     * */

    function() payable {
        if(msg.sender!=owner){//owner should be able to send funds to the contract anytime
            if(msg.value<100000000000000000||msg.value>1000000000000000000) throw;//bet has to lie between 0.1 and 1 ETH
            if(address(this).balance < msg.value/100*prizes[0]) throw; //make sure the contract is able to pay out the player in case he wins
            bytes32 oid = oraclize_query("URL","https://www.random.org/integers/?num=1&min=1&max=1000000&col=1&base=10&format=plain&rnd=new", oraclizeGas);
            bets[oid] = msg.value;
            players[oid] = msg.sender;
        }
    }

    /**
     * The random number from Oraclizes decides the game result.
     * If Oraclize sends a message instead of the requested number, the bet is returned to the player.
     * */
    function __callback(bytes32 myid, string result) {
        if (msg.sender != oraclize_cbAddress()) throw;
        if (players[myid]==0x0) throw;
        uint random = convertToInt(result);
        if(random==0){//result not a number, return bet
            if(!players[myid].send(bets[myid])) throw;
            gameResult(101,players[myid]);
            delete players[myid];
            return;
        }
        uint range = 0;
        for(uint i = 0; i<probabilities.length; i++){
            range+=probabilities[i];
            if(random<=range){
                if(!players[myid].send(bets[myid]/100*prizes[i])){
                    gameResult(100,players[myid]);//100 -> error
                    throw;
                } 
                gameResult(i, players[myid]);
                delete players[myid];
                return;
            }
        }

        //else player loses everything
        gameResult(probabilities.length, players[myid]);
        
        delete players[myid];
        
    }
    
    /**
     * sets the amount of gas to be sent to oraclize
     * */
    function setOraclizeGas(uint32 newGas){
        if(!(msg.sender==owner)) throw;
    	oraclizeGas = newGas;
    }
    
    /** set the probabilities of the results (absolute frequencies out of 1.000.000 spins) **/
    function setProbabilities(uint32[] probs){
        if(!(msg.sender==owner)) throw;
        probabilities=probs;
    }
    
    /** set the prizes of the results (shifted by 2 digits -> 375 means 3.75)**/
    function setPrizes(uint32[] priz){
        if(!(msg.sender==owner)) throw;
        prizes=priz;
    }
    
    /**
     * allows the owner to collect the accumulated losses
     * */
    function collectFees(uint amount){
        if(!(msg.sender==owner)) throw;
        if( address(this).balance < amount) throw;
        if(!owner.send(amount)) throw;
    }
    
    /**
     * converts a string to an integer (there may only be digits)
     * */
    function convertToInt(string _a) internal returns (uint) {
        bytes memory bresult = bytes(_a);
        uint mint = 0;
        for (uint i=0; i<bresult.length; i++){
            if ((bresult[i] >= 48)&&(bresult[i] <= 57)){
                mint *= 10;
                mint += uint(bresult[i]) - 48;
            } else if((bresult[i] >= 58)&&(bresult[i] <= 126)) return 0;//its a message, no pure int
        }
        return mint;
    }
}

  Contract ABI  
[{"constant":false,"inputs":[{"name":"myid","type":"bytes32"},{"name":"result","type":"string"}],"name":"__callback","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"oraclizeGas","outputs":[{"name":"","type":"uint32"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"kill","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"priz","type":"uint32[]"}],"name":"setPrizes","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"probs","type":"uint32[]"}],"name":"setProbabilities","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newGas","type":"uint32"}],"name":"setOraclizeGas","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint256"}],"name":"collectFees","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"prizes","outputs":[{"name":"","type":"uint32"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"probabilities","outputs":[{"name":"","type":"uint32"}],"payable":false,"type":"function"},{"inputs":[],"type":"constructor"},{"payable":true,"type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"","type":"uint256"},{"indexed":false,"name":"","type":"address"}],"name":"gameResult","type":"event"}]

  Contract Creation Code Switch To Opcodes View
606060405260008054600160a060020a03191633179055600580546001810180835582818380158290116100bc5760070160089004816007016008900483600052602060002091820191016100bc91905b808211156101305760008155600101610050565b505050600092835260209092206008808304909101910660040281546101009190910a610177810263ffffffff90910219909116179055506004805463ffffffff1916620186a0179055610fbd806108836000396000f35b5050506000928352602090922060088083049091019106600402815460046101009290920a91820263ffffffff909202191617905550600580546001810180835582818380158290116101345760070160089004816007016008900483600052602060002091820191016101349190610050565b5090565b5050506000928352602090922060088083049091019106600402815460326101009290920a91820263ffffffff909202191617905550600580546001810180835582818380158290116101a85760070160089004816007016008900483600052602060002091820191016101a89190610050565b5050506000928352602090922060088083049091019106600402815460c86101009290920a91820263ffffffff9092021916179055506005805460018101808355828183801582901161021c57600701600890048160070160089004836000526020600020918201910161021c9190610050565b505050600092835260209092206008808304909101910660040281546102586101009290920a91820263ffffffff909202191617905550600580546001810180835582818380158290116102915760070160089004816007016008900483600052602060002091820191016102919190610050565b505050600092835260209092206008808304909101910660040281546103e86101009290920a91820263ffffffff909202191617905550600580546001810180835582818380158290116103065760070160089004816007016008900483600052602060002091820191016103069190610050565b505050600092835260209092206008808304909101910660040281546107d06101009290920a91820263ffffffff9092021916179055506005805460018101808355828183801582901161037b57600701600890048160070160089004836000526020600020918201910161037b9190610050565b50505060009283526020909220600880830490910191066004028154610fa06101009290920a91820263ffffffff909202191617905550600580546001810180835582818380158290116103f05760070160089004816007016008900483600052602060002091820191016103f09190610050565b505050600092835260209092206008808304909101910660040281546175306101009290920a91820263ffffffff909202191617905550600580546001810180835582818380158290116104655760070160089004816007016008900483600052602060002091820191016104659190610050565b5050506000928352602090922060088083049091019106600402815462015f906101009290920a91820263ffffffff909202191617905550600680546001810180835582818380158290116104db5760070160089004816007016008900483600052602060002091820191016104db9190610050565b505050600092835260209092206008808304909101910660040281546113886101009290920a91820263ffffffff909202191617905550600680546001810180835582818380158290116105505760070160089004816007016008900483600052602060002091820191016105509190610050565b505050600092835260209092206008808304909101910660040281546109c46101009290920a91820263ffffffff909202191617905550600680546001810180835582818380158290116105c55760070160089004816007016008900483600052602060002091820191016105c59190610050565b505050600092835260209092206008808304909101910660040281546107d06101009290920a91820263ffffffff9092021916179055506006805460018101808355828183801582901161063a57600701600890048160070160089004836000526020600020918201910161063a9190610050565b5050506000928352602090922060088083049091019106600402815461076c6101009290920a91820263ffffffff909202191617905550600680546001810180835582818380158290116106af5760070160089004816007016008900483600052602060002091820191016106af9190610050565b505050600092835260209092206008808304909101910660040281546107086101009290920a91820263ffffffff909202191617905550600680546001810180835582818380158290116107245760070160089004816007016008900483600052602060002091820191016107249190610050565b505050600092835260209092206008808304909101910660040281546106a46101009290920a91820263ffffffff909202191617905550600680546001810180835582818380158290116107995760070160089004816007016008900483600052602060002091820191016107999190610050565b505050600092835260209092206008808304909101910660040281546106406101009290920a91820263ffffffff9092021916179055506006805460018101808355828183801582901161080e57600701600890048160070160089004836000526020600020918201910161080e9190610050565b505050600092835260209092206008808304909101910660040281546105dc6101009290920a91820263ffffffff90920219161790555060068054600181018083558281838015829011610064576007016008900481600701600890048360005260206000209182019101610064919061005056606060405236156100775760e060020a600035046327dc297e81146100b85780633e9836c61461012f57806341c0e1b51461014357806353d97e65146101715780636e0d98fe146101d357806389ed0b3014610235578063b17acdcd1461025c578063eccb3a4f14610283578063f8833efd146102db575b6103336000805433600160a060020a039081169116146103635767016345785d8a00003410806100ae5750670de0b6b3a764000034115b1561036657610002565b346100025760408051602060248035600481810135601f81018590048502860185019096528585526103339581359591946044949293909201918190840183828082843750949650505050505050600060006000610804600154600090600160a060020a0316811415610e3357610e316000610499565b34610002576104ba60045463ffffffff1681565b3461000257610333600054600160a060020a03908116339091161415610b7457600054600160a060020a0316ff5b34610002576040805160048035808201356020818102808601820190965281855261033395939460249490938501929182919085019084908082843750949650505050505050600054600160a060020a039081163390911614610b7657610002565b34610002576040805160048035808201356020818102808601820190965281855261033395939460249490938501929182919085019084908082843750949650505050505050600054600160a060020a039081163390911614610c4957610002565b3461000257610333600435600054600160a060020a039081163390911614610ca257610002565b3461000257610333600435600054600160a060020a039081163390911614610cb457610002565b34610002576104ba600435600680548290811015610002575060005260088082047ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f015491066004026101000a900463ffffffff1681565b34610002576104ba600435600580548290811015610002575060005260088082047f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0015491066004026101000a900463ffffffff1681565b005b6000818152600760209081526040808320349055600390915290208054600160a060020a0319163317905590505b50565b6006805460009081101561000257600091825260209091206008808304919091015491066004026101000a900463ffffffff16606434040230600160a060020a03163110156103b457610002565b604080518082018252600381527f55524c00000000000000000000000000000000000000000000000000000000006020828101919091528251608081018452605b81527f68747470733a2f2f7777772e72616e646f6d2e6f72672f696e7465676572732f918101919091527f3f6e756d3d31266d696e3d31266d61783d3130303030303026636f6c3d312662928101929092527f6173653d313026666f726d61743d706c61696e26726e643d6e657700000000006060830152600454610335929063ffffffff166001546000908190600160a060020a03168114156104d6576104d460005b60006000610d06731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed5b3b90565b6040805163ffffffff929092168252519081900360200190f35b505b600160009054906101000a9004600160a060020a0316600160a060020a03166338cc48316000604051602001526040518160e060020a028152600401809050602060405180830381600087803b156100025760325a03f11561000257505060408051805160028054600160a060020a031916909117908190556000602092830181905283517f2ef3accc0000000000000000000000000000000000000000000000000000000081526024810189905260048181019586528b5160448301528b51600160a060020a03949094169650632ef3accc958c958b959194859460640193888301939283928692849287929190601f850104600302600f01f150905090810190601f1680156105fb5780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b156100025760325a03f115610002575050604051519150503a8302670de0b6b3a76400000181111561064857600091505b509392505050565b600260009054906101000a9004600160a060020a0316600160a060020a031663c51be90f8260008888886000604051602001526040518660e060020a0281526004018085815260200180602001806020018481526020018381038352868181518152602001915080519060200190808383829060006004602084601f0104600302600f01f150905090810190601f1680156106f75780820380516001836020036101000a031916815260200191505b508381038252858181518152602001915080519060200190808383829060006004602084601f0104600302600f01f150905090810190601f1680156107505780820380516001836020036101000a031916815260200191505b5096505050505050506020604051808303818588803b156100025761235a5a03f115610002575050604051519350610640915050565b600554600086815260036020908152604080519281902054938352600160a060020a0393909316908201528151600080516020610f9d833981519152929181900390910190a1600360005060008660001916815260200190815260200160002060006101000a815490600160a060020a0302191690555b5050505050565b600160a060020a031633600160a060020a031614151561082357610002565b600085815260036020526040812054600160a060020a0316141561084657610002565b6109058460408051602081019091526000908190528181805b8251811015610f1f57603060f860020a028382815181101561000257016020015160f860020a9081900402600160f860020a031916108015906108cc5750603960f860020a028382815181101561000257016020015160f860020a9081900402600160f860020a03191611155b15610f2b57600a82029150815060308382815181101561000257016020015160f860020a9081900481020403909101905b60010161085f565b9250826000141561095a576000858152600360209081526040808320546007909252805190832054600160a060020a03929092169282156108fc02929190818181858888f193505050501515610a7d57610002565b5060009050805b60055481101561078657600580548290811015610002576000918252602090912060088083049091015491066004026101000a900463ffffffff1690910190818311610af55760008581526003602052604090205460068054600160a060020a0392909216916108fc9190849081101561000257906000526020600020906008918282040191900660040290546000898152600760205260409020546101009290920a900463ffffffff169060649004029081150290604051809050600060405180830381858888f193505050501515610afd5760008581526003602090815260408051928190205460648452600160a060020a0316918301919091528051600080516020610f9d8339815191529281900390910190a1610002565b60008581526003602090815260408051928190205460658452600160a060020a0316918301919091528051600080516020610f9d8339815191529281900390910190a1600360005060008660001916815260200190815260200160002060006101000a815490600160a060020a0302191690556107fd565b600101610961565b600085815260036020908152604080519281902054848452600160a060020a0316918301919091528051600080516020610f9d8339815191529281900390910190a1600360005060008660001916815260200190815260200160002060006101000a815490600160a060020a0302191690556107fd565b565b806006600050908051906020019082805482825590600052602060002090600701600890048101928215610bed5791602002820160005b83821115610c1057835183826101000a81548163ffffffff021916908302179055509260200192600401602081600301049283019260010302610bad565b505b50610c409291505b80821115610c4557805463ffffffff19168155600101610bf5565b8015610beb5782816101000a81549063ffffffff0219169055600401602081600301049283019260010302610c10565b505050565b5090565b806005600050908051906020019082805482825590600052602060002090600701600890048101928215610bed57916020028201600083821115610c1057509151815463ffffffff191617815560408501916004610bad565b6004805463ffffffff19168217905550565b8030600160a060020a0316311015610ccb57610002565b60405160008054600160a060020a0316916108fc84150291849190818181858888f19350505050151561036357610002565b5060005b919050565b1115610d38575060018054600160a060020a031916731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed178155610d01565b6000610d57739efbea6358bed926b293d2ce63a730d6d98d43dd6104b6565b1115610d8c575060018054739efbea6358bed926b293d2ce63a730d6d98d43dd600160a060020a031991909116178155610d01565b6000610dab7320e12a1f859b3feae5fb2a0a32c18f5a65555bbf6104b6565b1115610de05750600180547320e12a1f859b3feae5fb2a0a32c18f5a65555bbf600160a060020a031991909116178155610d01565b6000610dff739a1d6e5c6c8d081ac45c6af98b74a42442afba606104b6565b1115610cfd575060018054600160a060020a031916739a1d6e5c6c8d081ac45c6af98b74a42442afba60178155610d01565b505b600160009054906101000a9004600160a060020a0316600160a060020a03166338cc48316000604051602001526040518160e060020a028152600401809050602060405180830381600087803b156100025760325a03f11561000257505060408051805160028054600160a060020a031916909117908190556000602092830181905283517fc281d19e0000000000000000000000000000000000000000000000000000000081529351600160a060020a0392909216945063c281d19e936004818101949392918390030190829087803b156100025760325a03f1156100025750506040515191505090565b8193505b505050919050565b603a60f860020a028382815181101561000257016020015160f860020a9081900402600160f860020a03191610801590610f8f5750607e60f860020a028382815181101561000257016020015160f860020a9081900402600160f860020a03191611155b156108fd5760009350610f2356568a807765db7b2c3f27d1157cf905be0d7503ba3c4a1d9818cc50ac4db8f25d
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.