Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 14 from a total of 14 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Claim_reward | 5876670 | 2324 days ago | IN | 0 ETH | 0.00008087 | ||||
Claim_reward | 5873989 | 2325 days ago | IN | 0 ETH | 0.00008087 | ||||
__callback | 5873905 | 2325 days ago | IN | 0 ETH | 0.00626796 | ||||
__callback | 5873905 | 2325 days ago | IN | 0 ETH | 0.00250869 | ||||
__callback | 5873905 | 2325 days ago | IN | 0 ETH | 0.00247632 | ||||
__callback | 5873739 | 2325 days ago | IN | 0 ETH | 0.00225714 | ||||
__callback | 5873662 | 2325 days ago | IN | 0 ETH | 0.00149433 | ||||
__callback | 5873661 | 2325 days ago | IN | 0 ETH | 0.00227994 | ||||
__callback | 5873597 | 2325 days ago | IN | 0 ETH | 0.00230082 | ||||
Place Bet | 5873593 | 2325 days ago | IN | 0.05 ETH | 0.00091358 | ||||
Place Bet | 5873568 | 2325 days ago | IN | 0.15 ETH | 0.00038066 | ||||
Place Bet | 5871608 | 2325 days ago | IN | 0.87 ETH | 0.00028353 | ||||
Place Bet | 5871606 | 2325 days ago | IN | 0.83 ETH | 0.00028353 | ||||
Place Bet | 5871604 | 2325 days ago | IN | 0.8 ETH | 0.00042452 |
Latest 11 internal transactions
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
6513255 | 2218 days ago | 0.00129987 ETH | ||||
5876670 | 2324 days ago | 2.41926134 ETH | ||||
5873989 | 2325 days ago | 0.14573863 ETH | ||||
5873905 | 2325 days ago | 0.135 ETH | ||||
5871602 | 2325 days ago | 0.00703335 ETH | ||||
5871602 | 2325 days ago | 0.00703335 ETH | ||||
5871602 | 2325 days ago | 0.00703335 ETH | ||||
5871602 | 2325 days ago | 0.00253335 ETH | ||||
5871602 | 2325 days ago | 0.00253335 ETH | ||||
5871602 | 2325 days ago | 0.00253335 ETH | ||||
5871602 | 2325 days ago | Contract Creation | 0.03 ETH |
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x48c71f27...d74F417E1 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
Betting
Compiler Version
v0.4.21+commit.dfe3193c
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2018-06-16 */ pragma solidity ^0.4.20; library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } 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 queryN(uint _timestamp, string _datasource, bytes _argN) payable returns (bytes32 _id); function queryN_withGasLimit(uint _timestamp, string _datasource, bytes _argN, 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 setConfig(bytes32 _config); function setCustomGasPrice(uint _gasPrice); function randomDS_getSessionPubKeyHash() returns(bytes32); } 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 proofType_Android = 0x20; byte constant proofType_Ledger = 0x30; byte constant proofType_Native = 0xF0; byte constant proofStorage_IPFS = 0x01; uint8 constant networkID_auto = 0; uint8 constant networkID_mainnet = 1; uint8 constant networkID_testnet = 2; uint8 constant networkID_morden = 2; uint8 constant networkID_consensys = 161; OraclizeAddrResolverI OAR; OraclizeI oraclize; modifier oraclizeAPI { if((address(OAR)==0)||(getCodeSize(address(OAR))==0)) oraclize_setNetwork(networkID_auto); 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){ //mainnet OAR = OraclizeAddrResolverI(0x1d3B2638a7cC9f2CB3D298A3DA7a90B67E5506ed); oraclize_setNetworkName("eth_mainnet"); return true; } if (getCodeSize(0xc03A2615D5efaf5F49F60B7BB6583eaec212fdf1)>0){ //ropsten testnet OAR = OraclizeAddrResolverI(0xc03A2615D5efaf5F49F60B7BB6583eaec212fdf1); oraclize_setNetworkName("eth_ropsten3"); return true; } if (getCodeSize(0xB7A07BcF2Ba2f2703b24C0691b5278999C59AC7e)>0){ //kovan testnet OAR = OraclizeAddrResolverI(0xB7A07BcF2Ba2f2703b24C0691b5278999C59AC7e); oraclize_setNetworkName("eth_kovan"); return true; } if (getCodeSize(0x146500cfd35B22E4A392Fe0aDc06De1a1368Ed48)>0){ //rinkeby testnet OAR = OraclizeAddrResolverI(0x146500cfd35B22E4A392Fe0aDc06De1a1368Ed48); oraclize_setNetworkName("eth_rinkeby"); return true; } if (getCodeSize(0x6f485C8BF6fc43eA212E93BBF8ce046C7f1cb475)>0){ //ethereum-bridge OAR = OraclizeAddrResolverI(0x6f485C8BF6fc43eA212E93BBF8ce046C7f1cb475); return true; } if (getCodeSize(0x20e12A1F859B3FeaE5Fb2A0A32C18F5a65555bBF)>0){ //ether.camp ide OAR = OraclizeAddrResolverI(0x20e12A1F859B3FeaE5Fb2A0A32C18F5a65555bBF); return true; } if (getCodeSize(0x51efaF4c8B3C9AfBD5aB9F4bbC82784Ab6ef8fAA)>0){ //browser-solidity OAR = OraclizeAddrResolverI(0x51efaF4c8B3C9AfBD5aB9F4bbC82784Ab6ef8fAA); return true; } return false; } function __callback(bytes32 myid, string result) { __callback(myid, result, new bytes(0)); } function __callback(bytes32 myid, string result, bytes proof) { } function oraclize_useCoupon(string code) oraclizeAPI internal { oraclize.useCoupon(code); } function oraclize_getPrice(string datasource) oraclizeAPI internal returns (uint){ return oraclize.getPrice(datasource); } function oraclize_getPrice(string datasource, uint gaslimit) oraclizeAPI internal returns (uint){ return oraclize.getPrice(datasource, gaslimit); } function oraclize_query(string datasource, string arg) oraclizeAPI internal returns (bytes32 id){ uint price = oraclize.getPrice(datasource); if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price return oraclize.query.value(price)(0, datasource, arg); } function oraclize_query(uint timestamp, string datasource, string arg) oraclizeAPI internal returns (bytes32 id){ uint price = oraclize.getPrice(datasource); if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price return oraclize.query.value(price)(timestamp, datasource, arg); } function oraclize_query(uint timestamp, string datasource, string arg, uint gaslimit) oraclizeAPI internal returns (bytes32 id){ uint price = oraclize.getPrice(datasource, gaslimit); if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price return oraclize.query_withGasLimit.value(price)(timestamp, datasource, arg, gaslimit); } function oraclize_query(string datasource, string arg, uint gaslimit) oraclizeAPI internal returns (bytes32 id){ uint price = oraclize.getPrice(datasource, gaslimit); if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price return oraclize.query_withGasLimit.value(price)(0, datasource, arg, gaslimit); } function oraclize_query(string datasource, string arg1, string arg2) oraclizeAPI internal returns (bytes32 id){ uint price = oraclize.getPrice(datasource); if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price return oraclize.query2.value(price)(0, datasource, arg1, arg2); } function oraclize_query(uint timestamp, string datasource, string arg1, string arg2) oraclizeAPI internal returns (bytes32 id){ uint price = oraclize.getPrice(datasource); if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price return oraclize.query2.value(price)(timestamp, datasource, arg1, arg2); } function oraclize_query(uint timestamp, string datasource, string arg1, string arg2, uint gaslimit) oraclizeAPI internal returns (bytes32 id){ uint price = oraclize.getPrice(datasource, gaslimit); if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price return oraclize.query2_withGasLimit.value(price)(timestamp, datasource, arg1, arg2, gaslimit); } function oraclize_query(string datasource, string arg1, string arg2, uint gaslimit) oraclizeAPI internal returns (bytes32 id){ uint price = oraclize.getPrice(datasource, gaslimit); if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price return oraclize.query2_withGasLimit.value(price)(0, datasource, arg1, arg2, gaslimit); } function oraclize_query(string datasource, string[] argN) oraclizeAPI internal returns (bytes32 id){ uint price = oraclize.getPrice(datasource); if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price bytes memory args = stra2cbor(argN); return oraclize.queryN.value(price)(0, datasource, args); } function oraclize_query(uint timestamp, string datasource, string[] argN) oraclizeAPI internal returns (bytes32 id){ uint price = oraclize.getPrice(datasource); if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price bytes memory args = stra2cbor(argN); return oraclize.queryN.value(price)(timestamp, datasource, args); } function oraclize_query(uint timestamp, string datasource, string[] argN, uint gaslimit) oraclizeAPI internal returns (bytes32 id){ uint price = oraclize.getPrice(datasource, gaslimit); if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price bytes memory args = stra2cbor(argN); return oraclize.queryN_withGasLimit.value(price)(timestamp, datasource, args, gaslimit); } function oraclize_query(string datasource, string[] argN, uint gaslimit) oraclizeAPI internal returns (bytes32 id){ uint price = oraclize.getPrice(datasource, gaslimit); if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price bytes memory args = stra2cbor(argN); return oraclize.queryN_withGasLimit.value(price)(0, datasource, args, gaslimit); } function oraclize_query(string datasource, string[1] args) oraclizeAPI internal returns (bytes32 id) { string[] memory dynargs = new string[](1); dynargs[0] = args[0]; return oraclize_query(datasource, dynargs); } function oraclize_query(uint timestamp, string datasource, string[1] args) oraclizeAPI internal returns (bytes32 id) { string[] memory dynargs = new string[](1); dynargs[0] = args[0]; return oraclize_query(timestamp, datasource, dynargs); } function oraclize_query(uint timestamp, string datasource, string[1] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) { string[] memory dynargs = new string[](1); dynargs[0] = args[0]; return oraclize_query(timestamp, datasource, dynargs, gaslimit); } function oraclize_query(string datasource, string[1] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) { string[] memory dynargs = new string[](1); dynargs[0] = args[0]; return oraclize_query(datasource, dynargs, gaslimit); } function oraclize_query(string datasource, string[2] args) oraclizeAPI internal returns (bytes32 id) { string[] memory dynargs = new string[](2); dynargs[0] = args[0]; dynargs[1] = args[1]; return oraclize_query(datasource, dynargs); } function oraclize_query(uint timestamp, string datasource, string[2] args) oraclizeAPI internal returns (bytes32 id) { string[] memory dynargs = new string[](2); dynargs[0] = args[0]; dynargs[1] = args[1]; return oraclize_query(timestamp, datasource, dynargs); } function oraclize_query(uint timestamp, string datasource, string[2] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) { string[] memory dynargs = new string[](2); dynargs[0] = args[0]; dynargs[1] = args[1]; return oraclize_query(timestamp, datasource, dynargs, gaslimit); } function oraclize_query(string datasource, string[2] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) { string[] memory dynargs = new string[](2); dynargs[0] = args[0]; dynargs[1] = args[1]; return oraclize_query(datasource, dynargs, gaslimit); } function oraclize_query(string datasource, string[3] args) oraclizeAPI internal returns (bytes32 id) { string[] memory dynargs = new string[](3); dynargs[0] = args[0]; dynargs[1] = args[1]; dynargs[2] = args[2]; return oraclize_query(datasource, dynargs); } function oraclize_query(uint timestamp, string datasource, string[3] args) oraclizeAPI internal returns (bytes32 id) { string[] memory dynargs = new string[](3); dynargs[0] = args[0]; dynargs[1] = args[1]; dynargs[2] = args[2]; return oraclize_query(timestamp, datasource, dynargs); } function oraclize_query(uint timestamp, string datasource, string[3] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) { string[] memory dynargs = new string[](3); dynargs[0] = args[0]; dynargs[1] = args[1]; dynargs[2] = args[2]; return oraclize_query(timestamp, datasource, dynargs, gaslimit); } function oraclize_query(string datasource, string[3] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) { string[] memory dynargs = new string[](3); dynargs[0] = args[0]; dynargs[1] = args[1]; dynargs[2] = args[2]; return oraclize_query(datasource, dynargs, gaslimit); } function oraclize_query(string datasource, string[4] args) oraclizeAPI internal returns (bytes32 id) { string[] memory dynargs = new string[](4); dynargs[0] = args[0]; dynargs[1] = args[1]; dynargs[2] = args[2]; dynargs[3] = args[3]; return oraclize_query(datasource, dynargs); } function oraclize_query(uint timestamp, string datasource, string[4] args) oraclizeAPI internal returns (bytes32 id) { string[] memory dynargs = new string[](4); dynargs[0] = args[0]; dynargs[1] = args[1]; dynargs[2] = args[2]; dynargs[3] = args[3]; return oraclize_query(timestamp, datasource, dynargs); } function oraclize_query(uint timestamp, string datasource, string[4] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) { string[] memory dynargs = new string[](4); dynargs[0] = args[0]; dynargs[1] = args[1]; dynargs[2] = args[2]; dynargs[3] = args[3]; return oraclize_query(timestamp, datasource, dynargs, gaslimit); } function oraclize_query(string datasource, string[4] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) { string[] memory dynargs = new string[](4); dynargs[0] = args[0]; dynargs[1] = args[1]; dynargs[2] = args[2]; dynargs[3] = args[3]; return oraclize_query(datasource, dynargs, gaslimit); } function oraclize_query(string datasource, string[5] args) oraclizeAPI internal returns (bytes32 id) { string[] memory dynargs = new string[](5); dynargs[0] = args[0]; dynargs[1] = args[1]; dynargs[2] = args[2]; dynargs[3] = args[3]; dynargs[4] = args[4]; return oraclize_query(datasource, dynargs); } function oraclize_query(uint timestamp, string datasource, string[5] args) oraclizeAPI internal returns (bytes32 id) { string[] memory dynargs = new string[](5); dynargs[0] = args[0]; dynargs[1] = args[1]; dynargs[2] = args[2]; dynargs[3] = args[3]; dynargs[4] = args[4]; return oraclize_query(timestamp, datasource, dynargs); } function oraclize_query(uint timestamp, string datasource, string[5] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) { string[] memory dynargs = new string[](5); dynargs[0] = args[0]; dynargs[1] = args[1]; dynargs[2] = args[2]; dynargs[3] = args[3]; dynargs[4] = args[4]; return oraclize_query(timestamp, datasource, dynargs, gaslimit); } function oraclize_query(string datasource, string[5] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) { string[] memory dynargs = new string[](5); dynargs[0] = args[0]; dynargs[1] = args[1]; dynargs[2] = args[2]; dynargs[3] = args[3]; dynargs[4] = args[4]; return oraclize_query(datasource, dynargs, gaslimit); } function oraclize_query(string datasource, bytes[] argN) oraclizeAPI internal returns (bytes32 id){ uint price = oraclize.getPrice(datasource); if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price bytes memory args = ba2cbor(argN); return oraclize.queryN.value(price)(0, datasource, args); } function oraclize_query(uint timestamp, string datasource, bytes[] argN) oraclizeAPI internal returns (bytes32 id){ uint price = oraclize.getPrice(datasource); if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price bytes memory args = ba2cbor(argN); return oraclize.queryN.value(price)(timestamp, datasource, args); } function oraclize_query(uint timestamp, string datasource, bytes[] argN, uint gaslimit) oraclizeAPI internal returns (bytes32 id){ uint price = oraclize.getPrice(datasource, gaslimit); if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price bytes memory args = ba2cbor(argN); return oraclize.queryN_withGasLimit.value(price)(timestamp, datasource, args, gaslimit); } function oraclize_query(string datasource, bytes[] argN, uint gaslimit) oraclizeAPI internal returns (bytes32 id){ uint price = oraclize.getPrice(datasource, gaslimit); if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price bytes memory args = ba2cbor(argN); return oraclize.queryN_withGasLimit.value(price)(0, datasource, args, gaslimit); } function oraclize_query(string datasource, bytes[1] args) oraclizeAPI internal returns (bytes32 id) { bytes[] memory dynargs = new bytes[](1); dynargs[0] = args[0]; return oraclize_query(datasource, dynargs); } function oraclize_query(uint timestamp, string datasource, bytes[1] args) oraclizeAPI internal returns (bytes32 id) { bytes[] memory dynargs = new bytes[](1); dynargs[0] = args[0]; return oraclize_query(timestamp, datasource, dynargs); } function oraclize_query(uint timestamp, string datasource, bytes[1] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) { bytes[] memory dynargs = new bytes[](1); dynargs[0] = args[0]; return oraclize_query(timestamp, datasource, dynargs, gaslimit); } function oraclize_query(string datasource, bytes[1] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) { bytes[] memory dynargs = new bytes[](1); dynargs[0] = args[0]; return oraclize_query(datasource, dynargs, gaslimit); } function oraclize_query(string datasource, bytes[2] args) oraclizeAPI internal returns (bytes32 id) { bytes[] memory dynargs = new bytes[](2); dynargs[0] = args[0]; dynargs[1] = args[1]; return oraclize_query(datasource, dynargs); } function oraclize_query(uint timestamp, string datasource, bytes[2] args) oraclizeAPI internal returns (bytes32 id) { bytes[] memory dynargs = new bytes[](2); dynargs[0] = args[0]; dynargs[1] = args[1]; return oraclize_query(timestamp, datasource, dynargs); } function oraclize_query(uint timestamp, string datasource, bytes[2] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) { bytes[] memory dynargs = new bytes[](2); dynargs[0] = args[0]; dynargs[1] = args[1]; return oraclize_query(timestamp, datasource, dynargs, gaslimit); } function oraclize_query(string datasource, bytes[2] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) { bytes[] memory dynargs = new bytes[](2); dynargs[0] = args[0]; dynargs[1] = args[1]; return oraclize_query(datasource, dynargs, gaslimit); } function oraclize_query(string datasource, bytes[3] args) oraclizeAPI internal returns (bytes32 id) { bytes[] memory dynargs = new bytes[](3); dynargs[0] = args[0]; dynargs[1] = args[1]; dynargs[2] = args[2]; return oraclize_query(datasource, dynargs); } function oraclize_query(uint timestamp, string datasource, bytes[3] args) oraclizeAPI internal returns (bytes32 id) { bytes[] memory dynargs = new bytes[](3); dynargs[0] = args[0]; dynargs[1] = args[1]; dynargs[2] = args[2]; return oraclize_query(timestamp, datasource, dynargs); } function oraclize_query(uint timestamp, string datasource, bytes[3] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) { bytes[] memory dynargs = new bytes[](3); dynargs[0] = args[0]; dynargs[1] = args[1]; dynargs[2] = args[2]; return oraclize_query(timestamp, datasource, dynargs, gaslimit); } function oraclize_query(string datasource, bytes[3] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) { bytes[] memory dynargs = new bytes[](3); dynargs[0] = args[0]; dynargs[1] = args[1]; dynargs[2] = args[2]; return oraclize_query(datasource, dynargs, gaslimit); } function oraclize_query(string datasource, bytes[4] args) oraclizeAPI internal returns (bytes32 id) { bytes[] memory dynargs = new bytes[](4); dynargs[0] = args[0]; dynargs[1] = args[1]; dynargs[2] = args[2]; dynargs[3] = args[3]; return oraclize_query(datasource, dynargs); } function oraclize_query(uint timestamp, string datasource, bytes[4] args) oraclizeAPI internal returns (bytes32 id) { bytes[] memory dynargs = new bytes[](4); dynargs[0] = args[0]; dynargs[1] = args[1]; dynargs[2] = args[2]; dynargs[3] = args[3]; return oraclize_query(timestamp, datasource, dynargs); } function oraclize_query(uint timestamp, string datasource, bytes[4] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) { bytes[] memory dynargs = new bytes[](4); dynargs[0] = args[0]; dynargs[1] = args[1]; dynargs[2] = args[2]; dynargs[3] = args[3]; return oraclize_query(timestamp, datasource, dynargs, gaslimit); } function oraclize_query(string datasource, bytes[4] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) { bytes[] memory dynargs = new bytes[](4); dynargs[0] = args[0]; dynargs[1] = args[1]; dynargs[2] = args[2]; dynargs[3] = args[3]; return oraclize_query(datasource, dynargs, gaslimit); } function oraclize_query(string datasource, bytes[5] args) oraclizeAPI internal returns (bytes32 id) { bytes[] memory dynargs = new bytes[](5); dynargs[0] = args[0]; dynargs[1] = args[1]; dynargs[2] = args[2]; dynargs[3] = args[3]; dynargs[4] = args[4]; return oraclize_query(datasource, dynargs); } function oraclize_query(uint timestamp, string datasource, bytes[5] args) oraclizeAPI internal returns (bytes32 id) { bytes[] memory dynargs = new bytes[](5); dynargs[0] = args[0]; dynargs[1] = args[1]; dynargs[2] = args[2]; dynargs[3] = args[3]; dynargs[4] = args[4]; return oraclize_query(timestamp, datasource, dynargs); } function oraclize_query(uint timestamp, string datasource, bytes[5] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) { bytes[] memory dynargs = new bytes[](5); dynargs[0] = args[0]; dynargs[1] = args[1]; dynargs[2] = args[2]; dynargs[3] = args[3]; dynargs[4] = args[4]; return oraclize_query(timestamp, datasource, dynargs, gaslimit); } function oraclize_query(string datasource, bytes[5] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) { bytes[] memory dynargs = new bytes[](5); dynargs[0] = args[0]; dynargs[1] = args[1]; dynargs[2] = args[2]; dynargs[3] = args[3]; dynargs[4] = args[4]; return oraclize_query(datasource, dynargs, gaslimit); } function oraclize_cbAddress() oraclizeAPI internal returns (address){ return oraclize.cbAddress(); } function oraclize_setProof(byte proofP) oraclizeAPI internal { return oraclize.setProofType(proofP); } function oraclize_setCustomGasPrice(uint gasPrice) oraclizeAPI internal { return oraclize.setCustomGasPrice(gasPrice); } function oraclize_setConfig(bytes32 config) oraclizeAPI internal { return oraclize.setConfig(config); } function oraclize_randomDS_getSessionPubKeyHash() oraclizeAPI internal returns (bytes32){ return oraclize.randomDS_getSessionPubKeyHash(); } function getCodeSize(address _addr) constant internal returns(uint _size) { assembly { _size := extcodesize(_addr) } } function parseAddr(string _a) internal returns (address){ bytes memory tmp = bytes(_a); uint160 iaddr = 0; uint160 b1; uint160 b2; for (uint i=2; i<2+2*20; i+=2){ iaddr *= 256; b1 = uint160(tmp[i]); b2 = uint160(tmp[i+1]); if ((b1 >= 97)&&(b1 <= 102)) b1 -= 87; else if ((b1 >= 65)&&(b1 <= 70)) b1 -= 55; else if ((b1 >= 48)&&(b1 <= 57)) b1 -= 48; if ((b2 >= 97)&&(b2 <= 102)) b2 -= 87; else if ((b2 >= 65)&&(b2 <= 70)) b2 -= 55; else if ((b2 >= 48)&&(b2 <= 57)) b2 -= 48; iaddr += (b1*16+b2); } return address(iaddr); } function strCompare(string _a, string _b) internal 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; } function uint2str(uint i) internal returns (string){ if (i == 0) return "0"; uint j = i; uint len; while (j != 0){ len++; j /= 10; } bytes memory bstr = new bytes(len); uint k = len - 1; while (i != 0){ bstr[k--] = byte(48 + i % 10); i /= 10; } return string(bstr); } function stra2cbor(string[] arr) internal returns (bytes) { uint arrlen = arr.length; // get correct cbor output length uint outputlen = 0; bytes[] memory elemArray = new bytes[](arrlen); for (uint i = 0; i < arrlen; i++) { elemArray[i] = (bytes(arr[i])); outputlen += elemArray[i].length + (elemArray[i].length - 1)/23 + 3; //+3 accounts for paired identifier types } uint ctr = 0; uint cborlen = arrlen + 0x80; outputlen += byte(cborlen).length; bytes memory res = new bytes(outputlen); while (byte(cborlen).length > ctr) { res[ctr] = byte(cborlen)[ctr]; ctr++; } for (i = 0; i < arrlen; i++) { res[ctr] = 0x5F; ctr++; for (uint x = 0; x < elemArray[i].length; x++) { // if there's a bug with larger strings, this may be the culprit if (x % 23 == 0) { uint elemcborlen = elemArray[i].length - x >= 24 ? 23 : elemArray[i].length - x; elemcborlen += 0x40; uint lctr = ctr; while (byte(elemcborlen).length > ctr - lctr) { res[ctr] = byte(elemcborlen)[ctr - lctr]; ctr++; } } res[ctr] = elemArray[i][x]; ctr++; } res[ctr] = 0xFF; ctr++; } return res; } function ba2cbor(bytes[] arr) internal returns (bytes) { uint arrlen = arr.length; // get correct cbor output length uint outputlen = 0; bytes[] memory elemArray = new bytes[](arrlen); for (uint i = 0; i < arrlen; i++) { elemArray[i] = (bytes(arr[i])); outputlen += elemArray[i].length + (elemArray[i].length - 1)/23 + 3; //+3 accounts for paired identifier types } uint ctr = 0; uint cborlen = arrlen + 0x80; outputlen += byte(cborlen).length; bytes memory res = new bytes(outputlen); while (byte(cborlen).length > ctr) { res[ctr] = byte(cborlen)[ctr]; ctr++; } for (i = 0; i < arrlen; i++) { res[ctr] = 0x5F; ctr++; for (uint x = 0; x < elemArray[i].length; x++) { // if there's a bug with larger strings, this may be the culprit if (x % 23 == 0) { uint elemcborlen = elemArray[i].length - x >= 24 ? 23 : elemArray[i].length - x; elemcborlen += 0x40; uint lctr = ctr; while (byte(elemcborlen).length > ctr - lctr) { res[ctr] = byte(elemcborlen)[ctr - lctr]; ctr++; } } res[ctr] = elemArray[i][x]; ctr++; } res[ctr] = 0xFF; ctr++; } return res; } string oraclize_network_name; function oraclize_setNetworkName(string _network_name) internal { oraclize_network_name = _network_name; } function oraclize_getNetworkName() internal returns (string) { return oraclize_network_name; } function oraclize_newRandomDSQuery(uint _delay, uint _nbytes, uint _customGasLimit) internal returns (bytes32){ if ((_nbytes == 0)||(_nbytes > 32)) throw; bytes memory nbytes = new bytes(1); nbytes[0] = byte(_nbytes); bytes memory unonce = new bytes(32); bytes memory sessionKeyHash = new bytes(32); bytes32 sessionKeyHash_bytes32 = oraclize_randomDS_getSessionPubKeyHash(); assembly { mstore(unonce, 0x20) mstore(add(unonce, 0x20), xor(blockhash(sub(number, 1)), xor(coinbase, timestamp))) mstore(sessionKeyHash, 0x20) mstore(add(sessionKeyHash, 0x20), sessionKeyHash_bytes32) } bytes[3] memory args = [unonce, nbytes, sessionKeyHash]; bytes32 queryId = oraclize_query(_delay, "random", args, _customGasLimit); oraclize_randomDS_setCommitment(queryId, sha3(bytes8(_delay), args[1], sha256(args[0]), args[2])); return queryId; } function oraclize_randomDS_setCommitment(bytes32 queryId, bytes32 commitment) internal { oraclize_randomDS_args[queryId] = commitment; } mapping(bytes32=>bytes32) oraclize_randomDS_args; mapping(bytes32=>bool) oraclize_randomDS_sessionKeysHashVerified; function verifySig(bytes32 tosignh, bytes dersig, bytes pubkey) internal returns (bool){ bool sigok; address signer; bytes32 sigr; bytes32 sigs; bytes memory sigr_ = new bytes(32); uint offset = 4+(uint(dersig[3]) - 0x20); sigr_ = copyBytes(dersig, offset, 32, sigr_, 0); bytes memory sigs_ = new bytes(32); offset += 32 + 2; sigs_ = copyBytes(dersig, offset+(uint(dersig[offset-1]) - 0x20), 32, sigs_, 0); assembly { sigr := mload(add(sigr_, 32)) sigs := mload(add(sigs_, 32)) } (sigok, signer) = safer_ecrecover(tosignh, 27, sigr, sigs); if (address(sha3(pubkey)) == signer) return true; else { (sigok, signer) = safer_ecrecover(tosignh, 28, sigr, sigs); return (address(sha3(pubkey)) == signer); } } function oraclize_randomDS_proofVerify__sessionKeyValidity(bytes proof, uint sig2offset) internal returns (bool) { bool sigok; // Step 6: verify the attestation signature, APPKEY1 must sign the sessionKey from the correct ledger app (CODEHASH) bytes memory sig2 = new bytes(uint(proof[sig2offset+1])+2); copyBytes(proof, sig2offset, sig2.length, sig2, 0); bytes memory appkey1_pubkey = new bytes(64); copyBytes(proof, 3+1, 64, appkey1_pubkey, 0); bytes memory tosign2 = new bytes(1+65+32); tosign2[0] = 1; //role copyBytes(proof, sig2offset-65, 65, tosign2, 1); bytes memory CODEHASH = hex"fd94fa71bc0ba10d39d464d0d8f465efeef0a2764e3887fcc9df41ded20f505c"; copyBytes(CODEHASH, 0, 32, tosign2, 1+65); sigok = verifySig(sha256(tosign2), sig2, appkey1_pubkey); if (sigok == false) return false; // Step 7: verify the APPKEY1 provenance (must be signed by Ledger) bytes memory LEDGERKEY = hex"7fb956469c5c9b89840d55b43537e66a98dd4811ea0a27224272c2e5622911e8537a2f8e86a46baec82864e98dd01e9ccc2f8bc5dfc9cbe5a91a290498dd96e4"; bytes memory tosign3 = new bytes(1+65); tosign3[0] = 0xFE; copyBytes(proof, 3, 65, tosign3, 1); bytes memory sig3 = new bytes(uint(proof[3+65+1])+2); copyBytes(proof, 3+65, sig3.length, sig3, 0); sigok = verifySig(sha256(tosign3), sig3, LEDGERKEY); return sigok; } modifier oraclize_randomDS_proofVerify(bytes32 _queryId, string _result, bytes _proof) { // Step 1: the prefix has to match 'LP\x01' (Ledger Proof version 1) if ((_proof[0] != "L")||(_proof[1] != "P")||(_proof[2] != 1)) throw; bool proofVerified = oraclize_randomDS_proofVerify__main(_proof, _queryId, bytes(_result), oraclize_getNetworkName()); if (proofVerified == false) throw; _; } function matchBytes32Prefix(bytes32 content, bytes prefix) internal returns (bool){ bool match_ = true; for (var i=0; i<prefix.length; i++){ if (content[i] != prefix[i]) match_ = false; } return match_; } function oraclize_randomDS_proofVerify__main(bytes proof, bytes32 queryId, bytes result, string context_name) internal returns (bool){ bool checkok; // Step 2: the unique keyhash has to match with the sha256 of (context name + queryId) uint ledgerProofLength = 3+65+(uint(proof[3+65+1])+2)+32; bytes memory keyhash = new bytes(32); copyBytes(proof, ledgerProofLength, 32, keyhash, 0); checkok = (sha3(keyhash) == sha3(sha256(context_name, queryId))); if (checkok == false) return false; bytes memory sig1 = new bytes(uint(proof[ledgerProofLength+(32+8+1+32)+1])+2); copyBytes(proof, ledgerProofLength+(32+8+1+32), sig1.length, sig1, 0); // Step 3: we assume sig1 is valid (it will be verified during step 5) and we verify if 'result' is the prefix of sha256(sig1) checkok = matchBytes32Prefix(sha256(sig1), result); if (checkok == false) return false; // Step 4: commitment match verification, sha3(delay, nbytes, unonce, sessionKeyHash) == commitment in storage. // This is to verify that the computed args match with the ones specified in the query. bytes memory commitmentSlice1 = new bytes(8+1+32); copyBytes(proof, ledgerProofLength+32, 8+1+32, commitmentSlice1, 0); bytes memory sessionPubkey = new bytes(64); uint sig2offset = ledgerProofLength+32+(8+1+32)+sig1.length+65; copyBytes(proof, sig2offset-64, 64, sessionPubkey, 0); bytes32 sessionPubkeyHash = sha256(sessionPubkey); if (oraclize_randomDS_args[queryId] == sha3(commitmentSlice1, sessionPubkeyHash)){ //unonce, nbytes and sessionKeyHash match delete oraclize_randomDS_args[queryId]; } else return false; // Step 5: validity verification for sig1 (keyhash and args signed with the sessionKey) bytes memory tosign1 = new bytes(32+8+1+32); copyBytes(proof, ledgerProofLength, 32+8+1+32, tosign1, 0); checkok = verifySig(sha256(tosign1), sig1, sessionPubkey); if (checkok == false) return false; // verify if sessionPubkeyHash was verified already, if not.. let's do it! if (oraclize_randomDS_sessionKeysHashVerified[sessionPubkeyHash] == false){ oraclize_randomDS_sessionKeysHashVerified[sessionPubkeyHash] = oraclize_randomDS_proofVerify__sessionKeyValidity(proof, sig2offset); } return oraclize_randomDS_sessionKeysHashVerified[sessionPubkeyHash]; } // the following function has been written by Alex Beregszaszi (@axic), use it under the terms of the MIT license function copyBytes(bytes from, uint fromOffset, uint length, bytes to, uint toOffset) internal returns (bytes) { uint minLength = length + toOffset; if (to.length < minLength) { // Buffer too small throw; // Should be a better way? } // NOTE: the offset 32 is added to skip the `size` field of both bytes variables uint i = 32 + fromOffset; uint j = 32 + toOffset; while (i < (32 + fromOffset + length)) { assembly { let tmp := mload(add(from, i)) mstore(add(to, j), tmp) } i += 32; j += 32; } return to; } // the following function has been written by Alex Beregszaszi (@axic), use it under the terms of the MIT license // Duplicate Solidity's ecrecover, but catching the CALL return value function safer_ecrecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal returns (bool, address) { // We do our own memory management here. Solidity uses memory offset // 0x40 to store the current end of memory. We write past it (as // writes are memory extensions), but don't update the offset so // Solidity will reuse it. The memory used here is only needed for // this context. // FIXME: inline assembly can't access return values bool ret; address addr; assembly { let size := mload(0x40) mstore(size, hash) mstore(add(size, 32), v) mstore(add(size, 64), r) mstore(add(size, 96), s) // NOTE: we can reuse the request memory because we deal with // the return code ret := call(3000, 1, 0, size, 128, size, 32) addr := mload(size) } return (ret, addr); } // the following function has been written by Alex Beregszaszi (@axic), use it under the terms of the MIT license function ecrecovery(bytes32 hash, bytes sig) internal returns (bool, address) { bytes32 r; bytes32 s; uint8 v; if (sig.length != 65) return (false, 0); // The signature format is a compact form of: // {bytes32 r}{bytes32 s}{uint8 v} // Compact means, uint8 is not padded to 32 bytes. assembly { r := mload(add(sig, 32)) s := mload(add(sig, 64)) // Here we are loading the last 32 bytes. We exploit the fact that // 'mload' will pad with zeroes if we overread. // There is no 'mload8' to do this, but that would be nicer. v := byte(0, mload(add(sig, 96))) // Alternative solution: // 'byte' is not working due to the Solidity parser, so lets // use the second best option, 'and' // v := and(mload(add(sig, 65)), 255) } // albeit non-transactional signatures are not specified by the YP, one would expect it // to match the YP range of [27, 28] // // geth uses [0, 1] and some clients have followed. This might change, see: // https://github.com/ethereum/go-ethereum/issues/2053 if (v < 27) v += 27; if (v != 27 && v != 28) return (false, 0); return safer_ecrecover(hash, v, r, s); } } contract BettingControllerInterface { function remoteBettingClose() external; function depositHouseTakeout() external payable; } contract Betting is usingOraclize { using SafeMath for uint256; //using safemath uint countdown=3; // variable to check if all prices are received address public owner; //owner address uint public winnerPoolTotal; string public constant version = "0.2.2"; BettingControllerInterface internal bettingControllerInstance; struct chronus_info { bool betting_open; // boolean: check if betting is open bool race_start; //boolean: check if race has started bool race_end; //boolean: check if race has ended bool voided_bet; //boolean: check if race has been voided uint32 starting_time; // timestamp of when the race starts uint32 betting_duration; uint32 race_duration; // duration of the race uint32 voided_timestamp; } struct horses_info{ int64 BTC_delta; //horses.BTC delta value int64 ETH_delta; //horses.ETH delta value int64 LTC_delta; //horses.LTC delta value bytes32 BTC; //32-bytes equivalent of horses.BTC bytes32 ETH; //32-bytes equivalent of horses.ETH bytes32 LTC; //32-bytes equivalent of horses.LTC uint customPreGasLimit; uint customPostGasLimit; } struct bet_info{ bytes32 horse; // coin on which amount is bet on uint amount; // amount bet by Bettor } struct coin_info{ uint256 pre; // locking price uint256 post; // ending price uint160 total; // total coin pool uint32 count; // number of bets bool price_check; bytes32 preOraclizeId; bytes32 postOraclizeId; } struct voter_info { uint160 total_bet; //total amount of bet placed bool rewarded; // boolean: check for double spending mapping(bytes32=>uint) bets; //array of bets } mapping (bytes32 => bytes32) oraclizeIndex; // mapping oraclize IDs with coins mapping (bytes32 => coin_info) coinIndex; // mapping coins with pool information mapping (address => voter_info) voterIndex; // mapping voter address with Bettor information uint public total_reward; // total reward to be awarded uint32 total_bettors; mapping (bytes32 => bool) public winner_horse; // tracking events event newOraclizeQuery(string description); event newPriceTicker(uint price); event Deposit(address _from, uint256 _value, bytes32 _horse, uint256 _date); event Withdraw(address _to, uint256 _value); // constructor function Betting() public payable { oraclize_setProof(proofType_TLSNotary | proofStorage_IPFS); owner = msg.sender; oraclize_setCustomGasPrice(30000000000 wei); horses.BTC = bytes32("BTC"); horses.ETH = bytes32("ETH"); horses.LTC = bytes32("LTC"); horses.customPreGasLimit = 80000; horses.customPostGasLimit = 230000; bettingControllerInstance = BettingControllerInterface(owner); } // data access structures horses_info public horses; chronus_info public chronus; // modifiers for restricting access to methods modifier onlyOwner { require(owner == msg.sender); _; } modifier duringBetting { require(chronus.betting_open); require(now < chronus.starting_time + chronus.betting_duration); _; } modifier beforeBetting { require(!chronus.betting_open && !chronus.race_start); _; } modifier afterRace { require(chronus.race_end); _; } //function to change owner function changeOwnership(address _newOwner) onlyOwner external { owner = _newOwner; } //oraclize callback method function __callback(bytes32 myid, string result, bytes proof) public { require (msg.sender == oraclize_cbAddress()); require (!chronus.race_end); bytes32 coin_pointer; // variable to differentiate different callbacks chronus.race_start = true; chronus.betting_open = false; bettingControllerInstance.remoteBettingClose(); coin_pointer = oraclizeIndex[myid]; if (myid == coinIndex[coin_pointer].preOraclizeId) { if (coinIndex[coin_pointer].pre > 0) { } else if (now >= chronus.starting_time+chronus.betting_duration+ 60 minutes) { forceVoidRace(); } else { coinIndex[coin_pointer].pre = stringToUintNormalize(result); emit newPriceTicker(coinIndex[coin_pointer].pre); } } else if (myid == coinIndex[coin_pointer].postOraclizeId){ if (coinIndex[coin_pointer].pre > 0 ){ if (coinIndex[coin_pointer].post > 0) { } else if (now >= chronus.starting_time+chronus.race_duration+ 60 minutes) { forceVoidRace(); } else { coinIndex[coin_pointer].post = stringToUintNormalize(result); coinIndex[coin_pointer].price_check = true; emit newPriceTicker(coinIndex[coin_pointer].post); if (coinIndex[horses.ETH].price_check && coinIndex[horses.BTC].price_check && coinIndex[horses.LTC].price_check) { reward(); } } } else { forceVoidRace(); } } } // place a bet on a coin(horse) lockBetting function placeBet(bytes32 horse) external duringBetting payable { require(msg.value >= 0.01 ether); if (voterIndex[msg.sender].total_bet==0) { total_bettors+=1; } uint _newAmount = voterIndex[msg.sender].bets[horse] + msg.value; voterIndex[msg.sender].bets[horse] = _newAmount; voterIndex[msg.sender].total_bet += uint160(msg.value); uint160 _newTotal = coinIndex[horse].total + uint160(msg.value); uint32 _newCount = coinIndex[horse].count + 1; coinIndex[horse].total = _newTotal; coinIndex[horse].count = _newCount; emit Deposit(msg.sender, msg.value, horse, now); } // fallback method for accepting payments function () private payable {} // method to place the oraclize queries function setupRace(uint delay, uint locking_duration) onlyOwner beforeBetting public payable returns(bool) { // if (oraclize_getPrice("URL") > (this.balance)/6) { if (oraclize_getPrice("URL" , horses.customPreGasLimit)*3 + oraclize_getPrice("URL", horses.customPostGasLimit)*3 > address(this).balance) { emit newOraclizeQuery("Oraclize query was NOT sent, please add some ETH to cover for the query fee"); return false; } else { chronus.starting_time = uint32(block.timestamp); chronus.betting_open = true; bytes32 temp_ID; // temp variable to store oraclize IDs emit newOraclizeQuery("Oraclize query was sent, standing by for the answer.."); // bets open price query chronus.betting_duration = uint32(delay); temp_ID = oraclize_query(delay, "URL", "json(https://api.coinmarketcap.com/v1/ticker/ethereum/).0.price_usd",horses.customPreGasLimit); oraclizeIndex[temp_ID] = horses.ETH; coinIndex[horses.ETH].preOraclizeId = temp_ID; temp_ID = oraclize_query(delay, "URL", "json(https://api.coinmarketcap.com/v1/ticker/litecoin/).0.price_usd",horses.customPreGasLimit); oraclizeIndex[temp_ID] = horses.LTC; coinIndex[horses.LTC].preOraclizeId = temp_ID; temp_ID = oraclize_query(delay, "URL", "json(https://api.coinmarketcap.com/v1/ticker/bitcoin/).0.price_usd",horses.customPreGasLimit); oraclizeIndex[temp_ID] = horses.BTC; coinIndex[horses.BTC].preOraclizeId = temp_ID; //bets closing price query delay = delay.add(locking_duration); temp_ID = oraclize_query(delay, "URL", "json(https://api.coinmarketcap.com/v1/ticker/ethereum/).0.price_usd",horses.customPostGasLimit); oraclizeIndex[temp_ID] = horses.ETH; coinIndex[horses.ETH].postOraclizeId = temp_ID; temp_ID = oraclize_query(delay, "URL", "json(https://api.coinmarketcap.com/v1/ticker/litecoin/).0.price_usd",horses.customPostGasLimit); oraclizeIndex[temp_ID] = horses.LTC; coinIndex[horses.LTC].postOraclizeId = temp_ID; temp_ID = oraclize_query(delay, "URL", "json(https://api.coinmarketcap.com/v1/ticker/bitcoin/).0.price_usd",horses.customPostGasLimit); oraclizeIndex[temp_ID] = horses.BTC; coinIndex[horses.BTC].postOraclizeId = temp_ID; chronus.race_duration = uint32(delay); return true; } } // method to calculate reward (called internally by callback) function reward() internal { /* calculating the difference in price with a precision of 5 digits not using safemath since signed integers are handled */ horses.BTC_delta = int64(coinIndex[horses.BTC].post - coinIndex[horses.BTC].pre)*100000/int64(coinIndex[horses.BTC].pre); horses.ETH_delta = int64(coinIndex[horses.ETH].post - coinIndex[horses.ETH].pre)*100000/int64(coinIndex[horses.ETH].pre); horses.LTC_delta = int64(coinIndex[horses.LTC].post - coinIndex[horses.LTC].pre)*100000/int64(coinIndex[horses.LTC].pre); total_reward = (coinIndex[horses.BTC].total) + (coinIndex[horses.ETH].total) + (coinIndex[horses.LTC].total); if (total_bettors <= 1) { forceVoidRace(); } else { uint house_fee = total_reward.mul(5).div(100); require(house_fee < address(this).balance); total_reward = total_reward.sub(house_fee); bettingControllerInstance.depositHouseTakeout.value(house_fee)(); } if (horses.BTC_delta > horses.ETH_delta) { if (horses.BTC_delta > horses.LTC_delta) { winner_horse[horses.BTC] = true; winnerPoolTotal = coinIndex[horses.BTC].total; } else if(horses.LTC_delta > horses.BTC_delta) { winner_horse[horses.LTC] = true; winnerPoolTotal = coinIndex[horses.LTC].total; } else { winner_horse[horses.BTC] = true; winner_horse[horses.LTC] = true; winnerPoolTotal = coinIndex[horses.BTC].total + (coinIndex[horses.LTC].total); } } else if(horses.ETH_delta > horses.BTC_delta) { if (horses.ETH_delta > horses.LTC_delta) { winner_horse[horses.ETH] = true; winnerPoolTotal = coinIndex[horses.ETH].total; } else if (horses.LTC_delta > horses.ETH_delta) { winner_horse[horses.LTC] = true; winnerPoolTotal = coinIndex[horses.LTC].total; } else { winner_horse[horses.ETH] = true; winner_horse[horses.LTC] = true; winnerPoolTotal = coinIndex[horses.ETH].total + (coinIndex[horses.LTC].total); } } else { if (horses.LTC_delta > horses.ETH_delta) { winner_horse[horses.LTC] = true; winnerPoolTotal = coinIndex[horses.LTC].total; } else if(horses.LTC_delta < horses.ETH_delta){ winner_horse[horses.ETH] = true; winner_horse[horses.BTC] = true; winnerPoolTotal = coinIndex[horses.ETH].total + (coinIndex[horses.BTC].total); } else { winner_horse[horses.LTC] = true; winner_horse[horses.ETH] = true; winner_horse[horses.BTC] = true; winnerPoolTotal = coinIndex[horses.ETH].total + (coinIndex[horses.BTC].total) + (coinIndex[horses.LTC].total); } } chronus.race_end = true; } // method to calculate an invidual's reward function calculateReward(address candidate) internal afterRace constant returns(uint winner_reward) { voter_info storage bettor = voterIndex[candidate]; if(chronus.voided_bet) { winner_reward = bettor.total_bet; } else { uint winning_bet_total; if(winner_horse[horses.BTC]) { winning_bet_total += bettor.bets[horses.BTC]; } if(winner_horse[horses.ETH]) { winning_bet_total += bettor.bets[horses.ETH]; } if(winner_horse[horses.LTC]) { winning_bet_total += bettor.bets[horses.LTC]; } winner_reward += (((total_reward.mul(10000000)).div(winnerPoolTotal)).mul(winning_bet_total)).div(10000000); } } // method to just check the reward amount function checkReward() afterRace external constant returns (uint) { require(!voterIndex[msg.sender].rewarded); return calculateReward(msg.sender); } // method to claim the reward amount function claim_reward() afterRace external { require(!voterIndex[msg.sender].rewarded); uint transfer_amount = calculateReward(msg.sender); require(address(this).balance >= transfer_amount); voterIndex[msg.sender].rewarded = true; msg.sender.transfer(transfer_amount); emit Withdraw(msg.sender, transfer_amount); } function forceVoidRace() internal { chronus.voided_bet=true; chronus.race_end = true; chronus.voided_timestamp=uint32(now); } // utility function to convert string to integer with precision consideration function stringToUintNormalize(string s) internal pure returns (uint result) { uint p =2; bool precision=false; bytes memory b = bytes(s); uint i; result = 0; for (i = 0; i < b.length; i++) { if (precision) {p = p-1;} if (uint(b[i]) == 46){precision = true;} uint c = uint(b[i]); if (c >= 48 && c <= 57) {result = result * 10 + (c - 48);} if (precision && p == 0){return result;} } while (p!=0) { result = result*10; p=p-1; } } // exposing the coin pool details for DApp function getCoinIndex(bytes32 index, address candidate) external constant returns (uint, uint, uint, bool, uint) { return (coinIndex[index].total, coinIndex[index].pre, coinIndex[index].post, coinIndex[index].price_check, voterIndex[candidate].bets[index]); } // exposing the total reward amount for DApp function reward_total() external constant returns (uint) { return ((coinIndex[horses.BTC].total) + (coinIndex[horses.ETH].total) + (coinIndex[horses.LTC].total)); } // in case of any errors in race, enable full refund for the Bettors to claim function refund() external onlyOwner { require(now > chronus.starting_time + chronus.race_duration); require((chronus.betting_open && !chronus.race_start) || (chronus.race_start && !chronus.race_end)); chronus.voided_bet = true; chronus.race_end = true; chronus.voided_timestamp=uint32(now); bettingControllerInstance.remoteBettingClose(); } // method to claim unclaimed winnings after 30 day notice period function recovery() external onlyOwner{ require((chronus.race_end && now > chronus.starting_time + chronus.race_duration + (30 days)) || (chronus.voided_bet && now > chronus.voided_timestamp + (30 days))); bettingControllerInstance.depositHouseTakeout.value(address(this).balance)(); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"constant":false,"inputs":[{"name":"horse","type":"bytes32"}],"name":"placeBet","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[],"name":"claim_reward","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"winner_horse","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"myid","type":"bytes32"},{"name":"result","type":"string"}],"name":"__callback","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"winnerPoolTotal","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"changeOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"myid","type":"bytes32"},{"name":"result","type":"string"},{"name":"proof","type":"bytes"}],"name":"__callback","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"horses","outputs":[{"name":"BTC_delta","type":"int64"},{"name":"ETH_delta","type":"int64"},{"name":"LTC_delta","type":"int64"},{"name":"BTC","type":"bytes32"},{"name":"ETH","type":"bytes32"},{"name":"LTC","type":"bytes32"},{"name":"customPreGasLimit","type":"uint256"},{"name":"customPostGasLimit","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"version","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"refund","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"index","type":"bytes32"},{"name":"candidate","type":"address"}],"name":"getCoinIndex","outputs":[{"name":"","type":"uint256"},{"name":"","type":"uint256"},{"name":"","type":"uint256"},{"name":"","type":"bool"},{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"chronus","outputs":[{"name":"betting_open","type":"bool"},{"name":"race_start","type":"bool"},{"name":"race_end","type":"bool"},{"name":"voided_bet","type":"bool"},{"name":"starting_time","type":"uint32"},{"name":"betting_duration","type":"uint32"},{"name":"race_duration","type":"uint32"},{"name":"voided_timestamp","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"reward_total","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"delay","type":"uint256"},{"name":"locking_duration","type":"uint256"}],"name":"setupRace","outputs":[{"name":"","type":"bool"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"checkReward","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"total_reward","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"recovery","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":true,"stateMutability":"payable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"description","type":"string"}],"name":"newOraclizeQuery","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"price","type":"uint256"}],"name":"newPriceTicker","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_from","type":"address"},{"indexed":false,"name":"_value","type":"uint256"},{"indexed":false,"name":"_horse","type":"bytes32"},{"indexed":false,"name":"_date","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_to","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Withdraw","type":"event"}]
Deployed Bytecode
0x6060604052600436106100e25763ffffffff60e060020a600035041663042b5fed81146100e4578063055ee253146100ef5780630f7696441461010257806327dc297e1461012c57806329114d65146101825780632af4c31e146101a757806338bbfa50146101c657806343bddf401461025e57806354fd4d50146102c4578063590e1ae31461034e5780637274f35b1461036157806384304ee5146103b65780638da5cb5b1461041e578063aa93038b1461044d578063aff6b3e814610460578063c4b24a461461046e578063d3d2172e14610481578063ddceafa914610494575b005b6100e26004356104a7565b34156100fa57600080fd5b6100e2610660565b341561010d57600080fd5b610118600435610796565b604051901515815260200160405180910390f35b341561013757600080fd5b6100e2600480359060446024803590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506107ab95505050505050565b341561018d57600080fd5b6101956107dd565b60405190815260200160405180910390f35b34156101b257600080fd5b6100e2600160a060020a03600435166107e3565b34156101d157600080fd5b6100e2600480359060446024803590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965061082095505050505050565b341561026957600080fd5b610271610b25565b604051600798890b890b815296880b880b602088015294870b90960b6040808701919091526060860193909352608085019190915260a084015260c083019390935260e082015261010001905180910390f35b34156102cf57600080fd5b6102d7610b61565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156103135780820151838201526020016102fb565b50505050905090810190601f1680156103405780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561035957600080fd5b6100e2610b98565b341561036c57600080fd5b610383600435600160a060020a0360243516610ccd565b604051948552602085019390935260408085019290925215156060840152608083019190915260a0909101905180910390f35b34156103c157600080fd5b6103c9610d21565b60405197151588529515156020880152931515604080880191909152921515606087015263ffffffff9182166080870152811660a086015291821660c0850152911660e0830152610100909101905180910390f35b341561042957600080fd5b610431610d83565b604051600160a060020a03909116815260200160405180910390f35b341561045857600080fd5b610195610d92565b610118600435602435610dd8565b341561047957600080fd5b6101956114a6565b341561048c57600080fd5b61019561150c565b341561049f57600080fd5b6100e2611512565b6015546000908190819060ff1615156104bf57600080fd5b601554640100000000810463ffffffff908116680100000000000000009092048116919091011642106104f157600080fd5b662386f26fc1000034101561050557600080fd5b600160a060020a033381166000908152600b602052604090205416151561054357600d805463ffffffff8082166001011663ffffffff199091161790555b50505033600160a060020a038181166000908152600b6020908152604080832086845260018082018452828520805434908101918290558354600160a060020a0319808216918a1683018a1691909117909455600a90955294839020600201805492831683881686019788161777ffffffff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000009384900463ffffffff9081169093019283169093029290921790915592947f60452eb7177e8d41c9d9fbc4c6e9ccf55a4d44d412355fbf2f02668e0d1a0ce19290918790429051600160a060020a039094168452602084019290925260408084019190915260608301919091526080909101905180910390a150505050565b60155460009062010000900460ff16151561067a57600080fd5b33600160a060020a03166000908152600b602052604090205474010000000000000000000000000000000000000000900460ff16156106b857600080fd5b6106c133611605565b9050600160a060020a03301631819010156106db57600080fd5b600160a060020a0333166000818152600b602052604090819020805474ff000000000000000000000000000000000000000019167401000000000000000000000000000000000000000017905582156108fc0290839051600060405180830381858888f19350505050151561074f57600080fd5b7f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243643382604051600160a060020a03909216825260208201526040908101905180910390a150565b600e6020526000908152604090205460ff1681565b6107d9828260006040518059106107bf5750595b818152601f19601f83011681016020016040529050610820565b5050565b60075481565b60065433600160a060020a039081169116146107fe57600080fd5b60068054600160a060020a031916600160a060020a0392909216919091179055565b600061082a61173f565b600160a060020a031633600160a060020a031614151561084957600080fd5b60155462010000900460ff161561085f57600080fd5b6015805460ff1961ff001990911661010017169055600854600160a060020a031663b6fe87fb6040518163ffffffff1660e060020a028152600401600060405180830381600087803b15156108b357600080fd5b5af115156108c057600080fd5b505050600084815260096020908152604080832054808452600a9092529091206003015490915084141561099a576000818152600a6020526040812054111561090857610995565b601554610e10640100000000820463ffffffff90811668010000000000000000909304811692909201011642106109465761094161183e565b610995565b61094f83611888565b6000828152600a6020526040908190208290557fc4db019ddd899ab8c4169d2877afae028fd941bb9c752cf08f14d21924c0673491905190815260200160405180910390a15b610b1f565b6000818152600a6020526040902060040154841415610b1f576000818152600a60205260408120541115610b17576000818152600a602052604081206001015411156109e557610995565b601554610e10640100000000820463ffffffff9081166c0100000000000000000000000090930481169290920101164210610a225761094161183e565b610a2b83611888565b6000828152600a60205260409081902060018101839055600201805478ff000000000000000000000000000000000000000000000000191660c060020a1790557fc4db019ddd899ab8c4169d2877afae028fd941bb9c752cf08f14d21924c0673491905190815260200160405180910390a16011546000908152600a602052604090206002015460c060020a900460ff168015610ae357506010546000908152600a602052604090206002015460c060020a900460ff165b8015610b0a57506012546000908152600a602052604090206002015460c060020a900460ff165b1561099557610995611979565b610b1f61183e565b50505050565b600f54601054601154601254601354601454600786810b96680100000000000000008104820b96608060020a90910490910b9490939092909188565b60408051908101604052600581527f302e322e32000000000000000000000000000000000000000000000000000000602082015281565b60065433600160a060020a03908116911614610bb357600080fd5b601554640100000000810463ffffffff9081166c01000000000000000000000000909204811691909101164211610be957600080fd5b60155460ff168015610c035750601554610100900460ff16155b80610c295750601554610100900460ff168015610c29575060155462010000900460ff16155b1515610c3457600080fd5b6015805462010000630100000063ff000000199092169190911762ff000019161773ffffffff000000000000000000000000000000001916608060020a4263ffffffff1602179055600854600160a060020a031663b6fe87fb6040518163ffffffff1660e060020a028152600401600060405180830381600087803b1515610cbb57600080fd5b5af11515610cc857600080fd5b505050565b6000828152600a6020908152604080832060028101548154600192830154600160a060020a039788168752600b8652848720988752979092019093529220549281169491939260c060020a90910460ff1691565b60155460ff808216916101008104821691620100008204811691630100000081049091169063ffffffff64010000000082048116916801000000000000000081048216916c010000000000000000000000008204811691608060020a90041688565b600654600160a060020a031681565b6012546000908152600a602052604080822060029081015460115484528284208201546010548552929093200154600160a060020a039283169183169083160101165b90565b600654600090819033600160a060020a03908116911614610df857600080fd5b60155460ff16158015610e135750601554610100900460ff16155b1515610e1e57600080fd5b30600160a060020a031631610e51604080519081016040526003815260ea60020a62155493026020820152601454611fe0565b600302610e7c604080519081016040526003815260ea60020a62155493026020820152601354611fe0565b600302011115610f40577f46cb989ef9cef13e930e3b7f286225a086e716a90d63e0b7da85d310a9db0c9a6040516020808252604b908201527f4f7261636c697a6520717565727920776173204e4f542073656e742c20706c656040808301919091527f6173652061646420736f6d652045544820746f20636f76657220666f7220746860608301527f6520717565727920666565000000000000000000000000000000000000000000608083015260a0909101905180910390a16000915061149f565b60158054600167ffffffff00000000199091166401000000004263ffffffff16021760ff19161790557f46cb989ef9cef13e930e3b7f286225a086e716a90d63e0b7da85d310a9db0c9a60405160208082526035908201527f4f7261636c697a65207175657279207761732073656e742c207374616e64696e6040808301919091527f6720627920666f722074686520616e737765722e2e000000000000000000000060608301526080909101905180910390a1601580546bffffffff000000000000000019166801000000000000000063ffffffff8716021790556110a08460408051908101604052806003815260200160ea60020a62155493028152506080604051908101604090815260438252600080516020612a7483398151915260208301527f6f6d2f76312f7469636b65722f657468657265756d2f292e302e70726963655f9082015260ea60020a621d5cd9026060820152601354612156565b6011546000828152600960209081526040808320849055928252600a905281902060030182905590915061114e9085908051908101604052806003815260200160ea60020a62155493028152506080604051908101604090815260438252600080516020612a7483398151915260208301527f6f6d2f76312f7469636b65722f6c697465636f696e2f292e302e70726963655f9082015260ea60020a621d5cd9026060820152601354612156565b6012546000828152600960209081526040808320849055928252600a90528190206003018290559091506112139085908051908101604052806003815260200160ea60020a62155493028152506080604051908101604090815260428252600080516020612a7483398151915260208301527f6f6d2f76312f7469636b65722f626974636f696e2f292e302e70726963655f75908201527f73640000000000000000000000000000000000000000000000000000000000006060820152601354612156565b6010546000828152600960209081526040808320849055928252600a905220600301819055905061124a848463ffffffff61242f16565b93506112d08460408051908101604052806003815260200160ea60020a62155493028152506080604051908101604090815260438252600080516020612a7483398151915260208301527f6f6d2f76312f7469636b65722f657468657265756d2f292e302e70726963655f9082015260ea60020a621d5cd9026060820152601454612156565b6011546000828152600960209081526040808320849055928252600a905281902060040182905590915061137e9085908051908101604052806003815260200160ea60020a62155493028152506080604051908101604090815260438252600080516020612a7483398151915260208301527f6f6d2f76312f7469636b65722f6c697465636f696e2f292e302e70726963655f9082015260ea60020a621d5cd9026060820152601454612156565b6012546000828152600960209081526040808320849055928252600a90528190206004018290559091506114439085908051908101604052806003815260200160ea60020a62155493028152506080604051908101604090815260428252600080516020612a7483398151915260208301527f6f6d2f76312f7469636b65722f626974636f696e2f292e302e70726963655f75908201527f73640000000000000000000000000000000000000000000000000000000000006060820152601454612156565b6010546000828152600960209081526040808320849055928252600a905220600401819055601580546fffffffff00000000000000000000000019166c0100000000000000000000000063ffffffff8816021790556001925090505b5092915050565b60155460009062010000900460ff1615156114c057600080fd5b33600160a060020a03166000908152600b602052604090205474010000000000000000000000000000000000000000900460ff16156114fe57600080fd5b61150733611605565b905090565b600c5481565b60065433600160a060020a0390811691161461152d57600080fd5b60155462010000900460ff168015611573575060155462278d00640100000000820463ffffffff9081166c01000000000000000000000000909304811692909201011642115b806115a857506015546301000000900460ff1680156115a8575060155462278d0063ffffffff608060020a9092048216011642115b15156115b357600080fd5b600854600160a060020a0390811690633270f753903016316040518263ffffffff1660e060020a0281526004016000604051808303818588803b15156115f857600080fd5b5af11515610b1f57600080fd5b6015546000908190819062010000900460ff16151561162357600080fd5b600160a060020a0384166000908152600b602052604090206015549092506301000000900460ff1615611662578154600160a060020a03169250611738565b6010546000908152600e602052604090205460ff1615611692576010546000908152600183016020526040902054015b6011546000908152600e602052604090205460ff16156116c2576011546000908152600183016020526040902054015b6012546000908152600e602052604090205460ff16156116f2576012546000908152600183016020526040902054015b6117336298968061171b8361172760075461171b62989680600c5461244590919063ffffffff16565b9063ffffffff61246916565b9063ffffffff61244516565b830192505b5050919050565b60008054600160a060020a0316158061176a575060005461176890600160a060020a0316612480565b155b1561177b576117796000612484565b505b600054600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156117ba57600080fd5b5af115156117c757600080fd5b505050604051805160018054600160a060020a031916600160a060020a03928316179081905516905063c281d19e6040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561182357600080fd5b5af1151561183057600080fd5b505050604051805191505090565b6015805462010000630100000063ff000000199092169190911762ff000019161773ffffffff000000000000000000000000000000001916608060020a4263ffffffff1602179055565b60008060006118956127d0565b5060009250600291508290508381805b82518210156119575783156118bb576001850394505b8282815181106118c757fe5b016020015160f860020a900460f860020a0260f860020a9004602e14156118ed57600193505b8282815181106118f957fe5b016020015160f860020a900460f860020a0260f860020a9004905060308110158015611926575060398111155b15611937576030810386600a020195505b838015611942575084155b1561194c5761196f565b6001909101906118a5565b5b841561196f5785600a029550600185039450611958565b5050505050919050565b6010546000908152600a602052604081208054600190910154600782810b92909103620186a002900b8115156119ab57fe5b600f805467ffffffffffffffff191667ffffffffffffffff93909205600790810b939093169190911790556011546000908152600a6020526040902080546001919091015481830b92919003620186a002900b811515611a0757fe5b600f805492909105600790810b67ffffffffffffffff1668010000000000000000026fffffffffffffffff0000000000000000199093169290921790556012546000908152600a6020526040902080546001919091015481830b92620186a09290910391909102900b811515611a7957fe5b600f805477ffffffffffffffff000000000000000000000000000000001916608060020a67ffffffffffffffff9490930560070b93909316919091029190911790556012546000908152600a602052604080822060029081015460115484528284208201546010548552929093200154600160a060020a03928316918316908316010116600c55600d54600163ffffffff90911611611b1f57611b1a61183e565b611bb9565b611b3a606461171b6005600c5461244590919063ffffffff16565b9050600160a060020a033016318110611b5257600080fd5b600c54611b65908263ffffffff6127ab16565b600c55600854600160a060020a0316633270f753826040518263ffffffff1660e060020a0281526004016000604051808303818588803b1515611ba757600080fd5b5af11515611bb457600080fd5b505050505b600f54680100000000000000008104600790810b810b91810b900b1315611cf757600f54608060020a8104600790810b810b91810b900b1315611c3457601080546000908152600e60209081526040808320805460ff1916600117905592548252600a90522060020154600160a060020a0316600755611cf2565b600f54600781810b810b608060020a909204810b900b1315611c8e57601280546000908152600e60209081526040808320805460ff1916600117905592548252600a90522060020154600160a060020a0316600755611cf2565b601080546000908152600e602090815260408083208054600160ff19918216811790925560128054865283862080549092169092179055548352600a9091528082206002908101549354835291200154600160a060020a0391821690821601166007555b611fcc565b600f54600781810b810b68010000000000000000909204810b900b1315611e4c57600f54608060020a8104600790810b810b68010000000000000000909204810b900b1315611d7e57601180546000908152600e60209081526040808320805460ff1916600117905592548252600a90522060020154600160a060020a0316600755611cf2565b600f54680100000000000000008104600790810b810b608060020a909204810b900b1315611de457601280546000908152600e60209081526040808320805460ff1916600117905592548252600a90522060020154600160a060020a0316600755611cf2565b601180546000908152600e602090815260408083208054600160ff19918216811790925560128054865283862080549092169092179055548352600a9091528082206002908101549354835291200154600160a060020a039182169082160116600755611fcc565b600f54680100000000000000008104600790810b810b608060020a909204810b900b1315611eb257601280546000908152600e60209081526040808320805460ff1916600117905592548252600a90522060020154600160a060020a0316600755611fcc565b600f54680100000000000000008104600790810b810b608060020a909204810b900b1215611f4257601180546000908152600e602090815260408083208054600160ff19918216811790925560108054865283862080549092169092179055548352600a9091528082206002908101549354835291200154600160a060020a039182169082160116600755611fcc565b601280546000908152600e602090815260408083208054600160ff1991821681179092556011805486528386208054831684179055601080548752848720805490931690931790915594548452600a9092528083206002908101549254845281842081015494548452922090910154600160a060020a039182169282169082160191909101166007555b506015805462ff0000191662010000179055565b60008054600160a060020a0316158061200b575060005461200990600160a060020a0316612480565b155b1561201c5761201a6000612484565b505b600054600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561205b57600080fd5b5af1151561206857600080fd5b505050604051805160018054600160a060020a031916600160a060020a039283161790819055169050632ef3accc84846040518363ffffffff1660e060020a0281526004018080602001838152602001828103825284818151815260200191508051906020019080838360005b838110156120ed5780820151838201526020016120d5565b50505050905090810190601f16801561211a5780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b151561213957600080fd5b5af1151561214657600080fd5b5050506040518051949350505050565b600080548190600160a060020a03161580612183575060005461218190600160a060020a0316612480565b155b15612194576121926000612484565b505b600054600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156121d357600080fd5b5af115156121e057600080fd5b505050604051805160018054600160a060020a031916600160a060020a039283161790819055169050632ef3accc86856040518363ffffffff1660e060020a0281526004018080602001838152602001828103825284818151815260200191508051906020019080838360005b8381101561226557808201518382015260200161224d565b50505050905090810190601f1680156122925780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b15156122b157600080fd5b5af115156122be57600080fd5b5050506040518051915050670de0b6b3a76400003a8402018111156122e65760009150612426565b600154600160a060020a031663c51be90f82888888886040518663ffffffff1660e060020a028152600401808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561235b578082015183820152602001612343565b50505050905090810190601f1680156123885780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b838110156123be5780820151838201526020016123a6565b50505050905090810190601f1680156123eb5780820380516001836020036101000a031916815260200191505b5096505050505050506020604051808303818588803b151561240c57600080fd5b5af1151561241957600080fd5b5050505060405180519250505b50949350505050565b60008282018381101561243e57fe5b9392505050565b6000828202831580612461575082848281151561245e57fe5b04145b151561243e57fe5b600080828481151561247757fe5b04949350505050565b3b90565b6000806124a4731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed612480565b11156125145760008054600160a060020a031916731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed17905561250c60408051908101604052600b81527f6574685f6d61696e6e657400000000000000000000000000000000000000000060208201526127bd565b5060016127a6565b600061253373c03a2615d5efaf5f49f60b7bb6583eaec212fdf1612480565b111561259b5760008054600160a060020a03191673c03a2615d5efaf5f49f60b7bb6583eaec212fdf117905561250c60408051908101604052600c81527f6574685f726f707374656e33000000000000000000000000000000000000000060208201526127bd565b60006125ba73b7a07bcf2ba2f2703b24c0691b5278999c59ac7e612480565b11156126225760008054600160a060020a03191673b7a07bcf2ba2f2703b24c0691b5278999c59ac7e17905561250c60408051908101604052600981527f6574685f6b6f76616e000000000000000000000000000000000000000000000060208201526127bd565b600061264173146500cfd35b22e4a392fe0adc06de1a1368ed48612480565b11156126a95760008054600160a060020a03191673146500cfd35b22e4a392fe0adc06de1a1368ed4817905561250c60408051908101604052600b81527f6574685f72696e6b65627900000000000000000000000000000000000000000060208201526127bd565b60006126c8736f485c8bf6fc43ea212e93bbf8ce046c7f1cb475612480565b11156126fc575060008054600160a060020a031916736f485c8bf6fc43ea212e93bbf8ce046c7f1cb47517905560016127a6565b600061271b7320e12a1f859b3feae5fb2a0a32c18f5a65555bbf612480565b111561274f575060008054600160a060020a0319167320e12a1f859b3feae5fb2a0a32c18f5a65555bbf17905560016127a6565b600061276e7351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa612480565b11156127a2575060008054600160a060020a0319167351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa17905560016127a6565b5060005b919050565b6000828211156127b757fe5b50900390565b60028180516107d99291602001906127e2565b60206040519081016040526000815290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061282357805160ff1916838001178555612850565b82800160010185558215612850579182015b82811115612850578251825591602001919060010190612835565b5061285c929150612860565b5090565b610dd591905b8082111561285c5760008155600101612866565b600054600160a060020a031615806128a457506000546128a290600160a060020a0316612480565b155b156128b5576128b36000612484565b505b600054600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156128f457600080fd5b5af1151561290157600080fd5b505050604051805160018054600160a060020a031916600160a060020a03928316179081905516905063688dcfd78260405160e060020a63ffffffff84160281527fff000000000000000000000000000000000000000000000000000000000000009091166004820152602401600060405180830381600087803b15156115f857600080fd5b600054600160a060020a031615806129b157506000546129af90600160a060020a0316612480565b155b156129c2576129c06000612484565b505b600054600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515612a0157600080fd5b5af11515612a0e57600080fd5b505050604051805160018054600160a060020a031916600160a060020a03928316179081905516905063ca6ad1e48260405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b15156115f857600080fd006a736f6e2868747470733a2f2f6170692e636f696e6d61726b65746361702e63a165627a7a72305820e8c5841d8a46392c1aaa6bda655e0aa1ea2292d7f8f857038e52f0286d6bde9b0029
Swarm Source
bzzr://e8c5841d8a46392c1aaa6bda655e0aa1ea2292d7f8f857038e52f0286d6bde9b
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.