Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 25 from a total of 129 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Withdraw Funds | 6570462 | 2702 days ago | IN | 0 ETH | 0.00053566 | ||||
| Withdraw Tokens | 6570457 | 2702 days ago | IN | 0 ETH | 0.00056894 | ||||
| __callback | 6412222 | 2728 days ago | IN | 0 ETH | 0.0018091 | ||||
| Play War | 6412219 | 2728 days ago | IN | 0.1 ETH | 0.00614559 | ||||
| __callback | 6412213 | 2728 days ago | IN | 0 ETH | 0.00172832 | ||||
| Play War | 6412208 | 2728 days ago | IN | 0.1 ETH | 0.00590922 | ||||
| __callback | 6411991 | 2728 days ago | IN | 0 ETH | 0.00181758 | ||||
| Play War | 6411990 | 2728 days ago | IN | 0.1 ETH | 0.00709107 | ||||
| __callback | 6411987 | 2728 days ago | IN | 0 ETH | 0.0017274 | ||||
| Play War | 6411982 | 2728 days ago | IN | 0.1 ETH | 0.00709107 | ||||
| __callback | 6411951 | 2728 days ago | IN | 0 ETH | 0.00171722 | ||||
| Play War | 6411949 | 2728 days ago | IN | 0.1 ETH | 0.00709107 | ||||
| __callback | 6411941 | 2728 days ago | IN | 0 ETH | 0.00181758 | ||||
| Play War | 6411938 | 2728 days ago | IN | 0.1 ETH | 0.00709107 | ||||
| __callback | 6411933 | 2728 days ago | IN | 0 ETH | 0.0017233 | ||||
| Play War | 6411930 | 2728 days ago | IN | 0.1 ETH | 0.00709107 | ||||
| __callback | 6411925 | 2728 days ago | IN | 0 ETH | 0.0018091 | ||||
| Play War | 6411922 | 2728 days ago | IN | 0.1 ETH | 0.00709107 | ||||
| __callback | 6411914 | 2728 days ago | IN | 0 ETH | 0.0018202 | ||||
| Play War | 6411912 | 2728 days ago | IN | 0.1 ETH | 0.00709107 | ||||
| __callback | 6411087 | 2728 days ago | IN | 0 ETH | 0.0018091 | ||||
| Play War | 6411084 | 2728 days ago | IN | 0.1 ETH | 0.00709107 | ||||
| __callback | 6406888 | 2729 days ago | IN | 0 ETH | 0.00172832 | ||||
| Play War | 6406884 | 2729 days ago | IN | 0.1 ETH | 0.00709107 | ||||
| __callback | 6406873 | 2729 days ago | IN | 0 ETH | 0.00172832 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| Transfer | 6570462 | 2702 days ago | 2.26050403 ETH | ||||
| Transfer | 6412222 | 2728 days ago | 0.09186317 ETH | ||||
| Transfer | 6412219 | 2728 days ago | 0.00813682 ETH | ||||
| Transfer | 6412208 | 2728 days ago | 0.00813682 ETH | ||||
| Transfer | 6411991 | 2728 days ago | 0.09186317 ETH | ||||
| Transfer | 6411990 | 2728 days ago | 0.00813682 ETH | ||||
| Transfer | 6411982 | 2728 days ago | 0.00813682 ETH | ||||
| Transfer | 6411949 | 2728 days ago | 0.00813682 ETH | ||||
| Transfer | 6411941 | 2728 days ago | 0.09186317 ETH | ||||
| Transfer | 6411938 | 2728 days ago | 0.00813682 ETH | ||||
| Transfer | 6411930 | 2728 days ago | 0.00813682 ETH | ||||
| Transfer | 6411925 | 2728 days ago | 0.09186317 ETH | ||||
| Transfer | 6411922 | 2728 days ago | 0.00813682 ETH | ||||
| Transfer | 6411914 | 2728 days ago | 0.09186317 ETH | ||||
| Transfer | 6411912 | 2728 days ago | 0.00813682 ETH | ||||
| Transfer | 6411087 | 2728 days ago | 0.09186317 ETH | ||||
| Transfer | 6411084 | 2728 days ago | 0.00813682 ETH | ||||
| Transfer | 6406884 | 2729 days ago | 0.00813682 ETH | ||||
| Transfer | 6406870 | 2729 days ago | 0.00813682 ETH | ||||
| Transfer | 6406860 | 2729 days ago | 0.00813682 ETH | ||||
| Transfer | 6367428 | 2735 days ago | 0.09186317 ETH | ||||
| Transfer | 6367426 | 2735 days ago | 0.00813682 ETH | ||||
| Transfer | 6325097 | 2742 days ago | 0.00816592 ETH | ||||
| Transfer | 6325078 | 2742 days ago | 0.00816592 ETH | ||||
| Transfer | 6325029 | 2742 days ago | 0.09183407 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
War
Compiler Version
v0.4.24+commit.e67f0147
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/**
*Submitted for verification at Etherscan.io on 2018-08-30
*/
pragma solidity 0.4.24;
// File: installed_contracts/oraclize/contracts/usingOraclize.sol
// <ORACLIZE_API>
/*
Copyright (c) 2015-2016 Oraclize SRL
Copyright (c) 2016 Oraclize LTD
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
// This api is currently targeted at 0.4.18, please import oraclizeAPI_pre0.4.sol or oraclizeAPI_0.4 where necessary
pragma solidity >=0.4.18;// Incompatible compiler version... please select one stated within pragma solidity or use different oraclizeAPI version
contract OraclizeI {
address public cbAddress;
function query(uint _timestamp, string _datasource, string _arg) external payable returns (bytes32 _id);
function query_withGasLimit(uint _timestamp, string _datasource, string _arg, uint _gaslimit) external payable returns (bytes32 _id);
function query2(uint _timestamp, string _datasource, string _arg1, string _arg2) public payable returns (bytes32 _id);
function query2_withGasLimit(uint _timestamp, string _datasource, string _arg1, string _arg2, uint _gaslimit) external payable returns (bytes32 _id);
function queryN(uint _timestamp, string _datasource, bytes _argN) public payable returns (bytes32 _id);
function queryN_withGasLimit(uint _timestamp, string _datasource, bytes _argN, uint _gaslimit) external payable returns (bytes32 _id);
function getPrice(string _datasource) public returns (uint _dsprice);
function getPrice(string _datasource, uint gaslimit) public returns (uint _dsprice);
function setProofType(byte _proofType) external;
function setCustomGasPrice(uint _gasPrice) external;
function randomDS_getSessionPubKeyHash() external constant returns(bytes32);
}
contract OraclizeAddrResolverI {
function getAddress() public returns (address _addr);
}
/*
Begin solidity-cborutils
https://github.com/smartcontractkit/solidity-cborutils
MIT License
Copyright (c) 2018 SmartContract ChainLink, Ltd.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
library Buffer {
struct buffer {
bytes buf;
uint capacity;
}
function init(buffer memory buf, uint _capacity) internal pure {
uint capacity = _capacity;
if(capacity % 32 != 0) capacity += 32 - (capacity % 32);
// Allocate space for the buffer data
buf.capacity = capacity;
assembly {
let ptr := mload(0x40)
mstore(buf, ptr)
mstore(ptr, 0)
mstore(0x40, add(ptr, capacity))
}
}
function resize(buffer memory buf, uint capacity) private pure {
bytes memory oldbuf = buf.buf;
init(buf, capacity);
append(buf, oldbuf);
}
function max(uint a, uint b) private pure returns(uint) {
if(a > b) {
return a;
}
return b;
}
/**
* @dev Appends a byte array to the end of the buffer. Resizes if doing so
* would exceed the capacity of the buffer.
* @param buf The buffer to append to.
* @param data The data to append.
* @return The original buffer.
*/
function append(buffer memory buf, bytes data) internal pure returns(buffer memory) {
if(data.length + buf.buf.length > buf.capacity) {
resize(buf, max(buf.capacity, data.length) * 2);
}
uint dest;
uint src;
uint len = data.length;
assembly {
// Memory address of the buffer data
let bufptr := mload(buf)
// Length of existing buffer data
let buflen := mload(bufptr)
// Start address = buffer address + buffer length + sizeof(buffer length)
dest := add(add(bufptr, buflen), 32)
// Update buffer length
mstore(bufptr, add(buflen, mload(data)))
src := add(data, 32)
}
// Copy word-length chunks while possible
for(; len >= 32; len -= 32) {
assembly {
mstore(dest, mload(src))
}
dest += 32;
src += 32;
}
// Copy remaining bytes
uint mask = 256 ** (32 - len) - 1;
assembly {
let srcpart := and(mload(src), not(mask))
let destpart := and(mload(dest), mask)
mstore(dest, or(destpart, srcpart))
}
return buf;
}
/**
* @dev Appends a byte to the end of the buffer. Resizes if doing so would
* exceed the capacity of the buffer.
* @param buf The buffer to append to.
* @param data The data to append.
* @return The original buffer.
*/
function append(buffer memory buf, uint8 data) internal pure {
if(buf.buf.length + 1 > buf.capacity) {
resize(buf, buf.capacity * 2);
}
assembly {
// Memory address of the buffer data
let bufptr := mload(buf)
// Length of existing buffer data
let buflen := mload(bufptr)
// Address = buffer address + buffer length + sizeof(buffer length)
let dest := add(add(bufptr, buflen), 32)
mstore8(dest, data)
// Update buffer length
mstore(bufptr, add(buflen, 1))
}
}
/**
* @dev Appends a byte to the end of the buffer. Resizes if doing so would
* exceed the capacity of the buffer.
* @param buf The buffer to append to.
* @param data The data to append.
* @return The original buffer.
*/
function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {
if(len + buf.buf.length > buf.capacity) {
resize(buf, max(buf.capacity, len) * 2);
}
uint mask = 256 ** len - 1;
assembly {
// Memory address of the buffer data
let bufptr := mload(buf)
// Length of existing buffer data
let buflen := mload(bufptr)
// Address = buffer address + buffer length + sizeof(buffer length) + len
let dest := add(add(bufptr, buflen), len)
mstore(dest, or(and(mload(dest), not(mask)), data))
// Update buffer length
mstore(bufptr, add(buflen, len))
}
return buf;
}
}
library CBOR {
using Buffer for Buffer.buffer;
uint8 private constant MAJOR_TYPE_INT = 0;
uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;
uint8 private constant MAJOR_TYPE_BYTES = 2;
uint8 private constant MAJOR_TYPE_STRING = 3;
uint8 private constant MAJOR_TYPE_ARRAY = 4;
uint8 private constant MAJOR_TYPE_MAP = 5;
uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;
function encodeType(Buffer.buffer memory buf, uint8 major, uint value) private pure {
if(value <= 23) {
buf.append(uint8((major << 5) | value));
} else if(value <= 0xFF) {
buf.append(uint8((major << 5) | 24));
buf.appendInt(value, 1);
} else if(value <= 0xFFFF) {
buf.append(uint8((major << 5) | 25));
buf.appendInt(value, 2);
} else if(value <= 0xFFFFFFFF) {
buf.append(uint8((major << 5) | 26));
buf.appendInt(value, 4);
} else if(value <= 0xFFFFFFFFFFFFFFFF) {
buf.append(uint8((major << 5) | 27));
buf.appendInt(value, 8);
}
}
function encodeIndefiniteLengthType(Buffer.buffer memory buf, uint8 major) private pure {
buf.append(uint8((major << 5) | 31));
}
function encodeUInt(Buffer.buffer memory buf, uint value) internal pure {
encodeType(buf, MAJOR_TYPE_INT, value);
}
function encodeInt(Buffer.buffer memory buf, int value) internal pure {
if(value >= 0) {
encodeType(buf, MAJOR_TYPE_INT, uint(value));
} else {
encodeType(buf, MAJOR_TYPE_NEGATIVE_INT, uint(-1 - value));
}
}
function encodeBytes(Buffer.buffer memory buf, bytes value) internal pure {
encodeType(buf, MAJOR_TYPE_BYTES, value.length);
buf.append(value);
}
function encodeString(Buffer.buffer memory buf, string value) internal pure {
encodeType(buf, MAJOR_TYPE_STRING, bytes(value).length);
buf.append(bytes(value));
}
function startArray(Buffer.buffer memory buf) internal pure {
encodeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);
}
function startMap(Buffer.buffer memory buf) internal pure {
encodeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);
}
function endSequence(Buffer.buffer memory buf) internal pure {
encodeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);
}
}
/*
End solidity-cborutils
*/
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_Ledger = 0x30;
byte constant proofType_Android = 0x40;
byte constant proofType_Native = 0xF0;
byte constant proofStorage_IPFS = 0x01;
uint8 constant networkID_auto = 0;
uint8 constant networkID_mainnet = 1;
uint8 constant networkID_testnet = 2;
uint8 constant networkID_morden = 2;
uint8 constant networkID_consensys = 161;
OraclizeAddrResolverI OAR;
OraclizeI oraclize;
modifier oraclizeAPI {
if((address(OAR)==0)||(getCodeSize(address(OAR))==0))
oraclize_setNetwork(networkID_auto);
if(address(oraclize) != OAR.getAddress())
oraclize = OraclizeI(OAR.getAddress());
_;
}
modifier coupon(string code){
oraclize = OraclizeI(OAR.getAddress());
_;
}
function oraclize_setNetwork(uint8 networkID) internal returns(bool){
return oraclize_setNetwork();
networkID; // silence the warning and remain backwards compatible
}
function oraclize_setNetwork() internal returns(bool){
if (getCodeSize(0x1d3B2638a7cC9f2CB3D298A3DA7a90B67E5506ed)>0){ //mainnet
OAR = OraclizeAddrResolverI(0x1d3B2638a7cC9f2CB3D298A3DA7a90B67E5506ed);
oraclize_setNetworkName("eth_mainnet");
return true;
}
if (getCodeSize(0xc03A2615D5efaf5F49F60B7BB6583eaec212fdf1)>0){ //ropsten testnet
OAR = OraclizeAddrResolverI(0xc03A2615D5efaf5F49F60B7BB6583eaec212fdf1);
oraclize_setNetworkName("eth_ropsten3");
return true;
}
if (getCodeSize(0xB7A07BcF2Ba2f2703b24C0691b5278999C59AC7e)>0){ //kovan testnet
OAR = OraclizeAddrResolverI(0xB7A07BcF2Ba2f2703b24C0691b5278999C59AC7e);
oraclize_setNetworkName("eth_kovan");
return true;
}
if (getCodeSize(0x146500cfd35B22E4A392Fe0aDc06De1a1368Ed48)>0){ //rinkeby testnet
OAR = OraclizeAddrResolverI(0x146500cfd35B22E4A392Fe0aDc06De1a1368Ed48);
oraclize_setNetworkName("eth_rinkeby");
return true;
}
if (getCodeSize(0x6f485C8BF6fc43eA212E93BBF8ce046C7f1cb475)>0){ //ethereum-bridge
OAR = OraclizeAddrResolverI(0x6f485C8BF6fc43eA212E93BBF8ce046C7f1cb475);
return true;
}
if (getCodeSize(0x20e12A1F859B3FeaE5Fb2A0A32C18F5a65555bBF)>0){ //ether.camp ide
OAR = OraclizeAddrResolverI(0x20e12A1F859B3FeaE5Fb2A0A32C18F5a65555bBF);
return true;
}
if (getCodeSize(0x51efaF4c8B3C9AfBD5aB9F4bbC82784Ab6ef8fAA)>0){ //browser-solidity
OAR = OraclizeAddrResolverI(0x51efaF4c8B3C9AfBD5aB9F4bbC82784Ab6ef8fAA);
return true;
}
return false;
}
function __callback(bytes32 myid, string result) public {
__callback(myid, result, new bytes(0));
}
function __callback(bytes32 myid, string result, bytes proof) public {
return;
myid; result; proof; // Silence compiler warnings
}
function oraclize_getPrice(string datasource) oraclizeAPI internal returns (uint){
return oraclize.getPrice(datasource);
}
function oraclize_getPrice(string datasource, uint gaslimit) oraclizeAPI internal returns (uint){
return oraclize.getPrice(datasource, gaslimit);
}
function oraclize_query(string datasource, string arg) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource);
if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
return oraclize.query.value(price)(0, datasource, arg);
}
function oraclize_query(uint timestamp, string datasource, string arg) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource);
if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
return oraclize.query.value(price)(timestamp, datasource, arg);
}
function oraclize_query(uint timestamp, string datasource, string arg, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource, gaslimit);
if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price
return oraclize.query_withGasLimit.value(price)(timestamp, datasource, arg, gaslimit);
}
function oraclize_query(string datasource, string arg, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource, gaslimit);
if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price
return oraclize.query_withGasLimit.value(price)(0, datasource, arg, gaslimit);
}
function oraclize_query(string datasource, string arg1, string arg2) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource);
if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
return oraclize.query2.value(price)(0, datasource, arg1, arg2);
}
function oraclize_query(uint timestamp, string datasource, string arg1, string arg2) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource);
if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
return oraclize.query2.value(price)(timestamp, datasource, arg1, arg2);
}
function oraclize_query(uint timestamp, string datasource, string arg1, string arg2, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource, gaslimit);
if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price
return oraclize.query2_withGasLimit.value(price)(timestamp, datasource, arg1, arg2, gaslimit);
}
function oraclize_query(string datasource, string arg1, string arg2, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource, gaslimit);
if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price
return oraclize.query2_withGasLimit.value(price)(0, datasource, arg1, arg2, gaslimit);
}
function oraclize_query(string datasource, string[] argN) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource);
if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
bytes memory args = stra2cbor(argN);
return oraclize.queryN.value(price)(0, datasource, args);
}
function oraclize_query(uint timestamp, string datasource, string[] argN) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource);
if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
bytes memory args = stra2cbor(argN);
return oraclize.queryN.value(price)(timestamp, datasource, args);
}
function oraclize_query(uint timestamp, string datasource, string[] argN, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource, gaslimit);
if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price
bytes memory args = stra2cbor(argN);
return oraclize.queryN_withGasLimit.value(price)(timestamp, datasource, args, gaslimit);
}
function oraclize_query(string datasource, string[] argN, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource, gaslimit);
if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price
bytes memory args = stra2cbor(argN);
return oraclize.queryN_withGasLimit.value(price)(0, datasource, args, gaslimit);
}
function oraclize_query(string datasource, string[1] args) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](1);
dynargs[0] = args[0];
return oraclize_query(datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, string[1] args) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](1);
dynargs[0] = args[0];
return oraclize_query(timestamp, datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, string[1] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](1);
dynargs[0] = args[0];
return oraclize_query(timestamp, datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, string[1] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](1);
dynargs[0] = args[0];
return oraclize_query(datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, string[2] args) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](2);
dynargs[0] = args[0];
dynargs[1] = args[1];
return oraclize_query(datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, string[2] args) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](2);
dynargs[0] = args[0];
dynargs[1] = args[1];
return oraclize_query(timestamp, datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, string[2] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](2);
dynargs[0] = args[0];
dynargs[1] = args[1];
return oraclize_query(timestamp, datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, string[2] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](2);
dynargs[0] = args[0];
dynargs[1] = args[1];
return oraclize_query(datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, string[3] args) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](3);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
return oraclize_query(datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, string[3] args) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](3);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
return oraclize_query(timestamp, datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, string[3] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](3);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
return oraclize_query(timestamp, datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, string[3] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](3);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
return oraclize_query(datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, string[4] args) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](4);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
dynargs[3] = args[3];
return oraclize_query(datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, string[4] args) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](4);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
dynargs[3] = args[3];
return oraclize_query(timestamp, datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, string[4] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](4);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
dynargs[3] = args[3];
return oraclize_query(timestamp, datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, string[4] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](4);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
dynargs[3] = args[3];
return oraclize_query(datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, string[5] args) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](5);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
dynargs[3] = args[3];
dynargs[4] = args[4];
return oraclize_query(datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, string[5] args) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](5);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
dynargs[3] = args[3];
dynargs[4] = args[4];
return oraclize_query(timestamp, datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, string[5] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](5);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
dynargs[3] = args[3];
dynargs[4] = args[4];
return oraclize_query(timestamp, datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, string[5] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](5);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
dynargs[3] = args[3];
dynargs[4] = args[4];
return oraclize_query(datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, bytes[] argN) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource);
if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
bytes memory args = ba2cbor(argN);
return oraclize.queryN.value(price)(0, datasource, args);
}
function oraclize_query(uint timestamp, string datasource, bytes[] argN) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource);
if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
bytes memory args = ba2cbor(argN);
return oraclize.queryN.value(price)(timestamp, datasource, args);
}
function oraclize_query(uint timestamp, string datasource, bytes[] argN, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource, gaslimit);
if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price
bytes memory args = ba2cbor(argN);
return oraclize.queryN_withGasLimit.value(price)(timestamp, datasource, args, gaslimit);
}
function oraclize_query(string datasource, bytes[] argN, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource, gaslimit);
if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price
bytes memory args = ba2cbor(argN);
return oraclize.queryN_withGasLimit.value(price)(0, datasource, args, gaslimit);
}
function oraclize_query(string datasource, bytes[1] args) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](1);
dynargs[0] = args[0];
return oraclize_query(datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, bytes[1] args) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](1);
dynargs[0] = args[0];
return oraclize_query(timestamp, datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, bytes[1] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](1);
dynargs[0] = args[0];
return oraclize_query(timestamp, datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, bytes[1] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](1);
dynargs[0] = args[0];
return oraclize_query(datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, bytes[2] args) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](2);
dynargs[0] = args[0];
dynargs[1] = args[1];
return oraclize_query(datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, bytes[2] args) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](2);
dynargs[0] = args[0];
dynargs[1] = args[1];
return oraclize_query(timestamp, datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, bytes[2] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](2);
dynargs[0] = args[0];
dynargs[1] = args[1];
return oraclize_query(timestamp, datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, bytes[2] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](2);
dynargs[0] = args[0];
dynargs[1] = args[1];
return oraclize_query(datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, bytes[3] args) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](3);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
return oraclize_query(datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, bytes[3] args) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](3);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
return oraclize_query(timestamp, datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, bytes[3] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](3);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
return oraclize_query(timestamp, datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, bytes[3] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](3);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
return oraclize_query(datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, bytes[4] args) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](4);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
dynargs[3] = args[3];
return oraclize_query(datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, bytes[4] args) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](4);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
dynargs[3] = args[3];
return oraclize_query(timestamp, datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, bytes[4] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](4);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
dynargs[3] = args[3];
return oraclize_query(timestamp, datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, bytes[4] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](4);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
dynargs[3] = args[3];
return oraclize_query(datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, bytes[5] args) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](5);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
dynargs[3] = args[3];
dynargs[4] = args[4];
return oraclize_query(datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, bytes[5] args) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](5);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
dynargs[3] = args[3];
dynargs[4] = args[4];
return oraclize_query(timestamp, datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, bytes[5] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](5);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
dynargs[3] = args[3];
dynargs[4] = args[4];
return oraclize_query(timestamp, datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, bytes[5] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](5);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
dynargs[3] = args[3];
dynargs[4] = args[4];
return oraclize_query(datasource, dynargs, gaslimit);
}
function oraclize_cbAddress() oraclizeAPI internal returns (address){
return oraclize.cbAddress();
}
function oraclize_setProof(byte proofP) oraclizeAPI internal {
return oraclize.setProofType(proofP);
}
function oraclize_setCustomGasPrice(uint gasPrice) oraclizeAPI internal {
return oraclize.setCustomGasPrice(gasPrice);
}
function oraclize_randomDS_getSessionPubKeyHash() oraclizeAPI internal returns (bytes32){
return oraclize.randomDS_getSessionPubKeyHash();
}
function getCodeSize(address _addr) constant internal returns(uint _size) {
assembly {
_size := extcodesize(_addr)
}
}
function parseAddr(string _a) internal pure returns (address){
bytes memory tmp = bytes(_a);
uint160 iaddr = 0;
uint160 b1;
uint160 b2;
for (uint i=2; i<2+2*20; i+=2){
iaddr *= 256;
b1 = uint160(tmp[i]);
b2 = uint160(tmp[i+1]);
if ((b1 >= 97)&&(b1 <= 102)) b1 -= 87;
else if ((b1 >= 65)&&(b1 <= 70)) b1 -= 55;
else if ((b1 >= 48)&&(b1 <= 57)) b1 -= 48;
if ((b2 >= 97)&&(b2 <= 102)) b2 -= 87;
else if ((b2 >= 65)&&(b2 <= 70)) b2 -= 55;
else if ((b2 >= 48)&&(b2 <= 57)) b2 -= 48;
iaddr += (b1*16+b2);
}
return address(iaddr);
}
function strCompare(string _a, string _b) internal pure returns (int) {
bytes memory a = bytes(_a);
bytes memory b = bytes(_b);
uint minLength = a.length;
if (b.length < minLength) minLength = b.length;
for (uint i = 0; i < minLength; i ++)
if (a[i] < b[i])
return -1;
else if (a[i] > b[i])
return 1;
if (a.length < b.length)
return -1;
else if (a.length > b.length)
return 1;
else
return 0;
}
function indexOf(string _haystack, string _needle) internal pure returns (int) {
bytes memory h = bytes(_haystack);
bytes memory n = bytes(_needle);
if(h.length < 1 || n.length < 1 || (n.length > h.length))
return -1;
else if(h.length > (2**128 -1))
return -1;
else
{
uint subindex = 0;
for (uint i = 0; i < h.length; i ++)
{
if (h[i] == n[0])
{
subindex = 1;
while(subindex < n.length && (i + subindex) < h.length && h[i + subindex] == n[subindex])
{
subindex++;
}
if(subindex == n.length)
return int(i);
}
}
return -1;
}
}
function strConcat(string _a, string _b, string _c, string _d, string _e) internal pure returns (string) {
bytes memory _ba = bytes(_a);
bytes memory _bb = bytes(_b);
bytes memory _bc = bytes(_c);
bytes memory _bd = bytes(_d);
bytes memory _be = bytes(_e);
string memory abcde = new string(_ba.length + _bb.length + _bc.length + _bd.length + _be.length);
bytes memory babcde = bytes(abcde);
uint k = 0;
for (uint i = 0; i < _ba.length; i++) babcde[k++] = _ba[i];
for (i = 0; i < _bb.length; i++) babcde[k++] = _bb[i];
for (i = 0; i < _bc.length; i++) babcde[k++] = _bc[i];
for (i = 0; i < _bd.length; i++) babcde[k++] = _bd[i];
for (i = 0; i < _be.length; i++) babcde[k++] = _be[i];
return string(babcde);
}
function strConcat(string _a, string _b, string _c, string _d) internal pure returns (string) {
return strConcat(_a, _b, _c, _d, "");
}
function strConcat(string _a, string _b, string _c) internal pure returns (string) {
return strConcat(_a, _b, _c, "", "");
}
function strConcat(string _a, string _b) internal pure returns (string) {
return strConcat(_a, _b, "", "", "");
}
// parseInt
function parseInt(string _a) internal pure returns (uint) {
return parseInt(_a, 0);
}
// parseInt(parseFloat*10^_b)
function parseInt(string _a, uint _b) internal pure returns (uint) {
bytes memory bresult = bytes(_a);
uint mint = 0;
bool decimals = false;
for (uint i=0; i<bresult.length; i++){
if ((bresult[i] >= 48)&&(bresult[i] <= 57)){
if (decimals){
if (_b == 0) break;
else _b--;
}
mint *= 10;
mint += uint(bresult[i]) - 48;
} else if (bresult[i] == 46) decimals = true;
}
if (_b > 0) mint *= 10**_b;
return mint;
}
function uint2str(uint i) internal pure returns (string){
if (i == 0) return "0";
uint j = i;
uint len;
while (j != 0){
len++;
j /= 10;
}
bytes memory bstr = new bytes(len);
uint k = len - 1;
while (i != 0){
bstr[k--] = byte(48 + i % 10);
i /= 10;
}
return string(bstr);
}
using CBOR for Buffer.buffer;
function stra2cbor(string[] arr) internal pure returns (bytes) {
safeMemoryCleaner();
Buffer.buffer memory buf;
Buffer.init(buf, 1024);
buf.startArray();
for (uint i = 0; i < arr.length; i++) {
buf.encodeString(arr[i]);
}
buf.endSequence();
return buf.buf;
}
function ba2cbor(bytes[] arr) internal pure returns (bytes) {
safeMemoryCleaner();
Buffer.buffer memory buf;
Buffer.init(buf, 1024);
buf.startArray();
for (uint i = 0; i < arr.length; i++) {
buf.encodeBytes(arr[i]);
}
buf.endSequence();
return buf.buf;
}
string oraclize_network_name;
function oraclize_setNetworkName(string _network_name) internal {
oraclize_network_name = _network_name;
}
function oraclize_getNetworkName() internal view returns (string) {
return oraclize_network_name;
}
function oraclize_newRandomDSQuery(uint _delay, uint _nbytes, uint _customGasLimit) internal returns (bytes32){
require((_nbytes > 0) && (_nbytes <= 32));
// Convert from seconds to ledger timer ticks
_delay *= 10;
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)
// the following variables can be relaxed
// check relaxed random contract under ethereum-examples repo
// for an idea on how to override and replace comit hash vars
mstore(add(unonce, 0x20), xor(blockhash(sub(number, 1)), xor(coinbase, timestamp)))
mstore(sessionKeyHash, 0x20)
mstore(add(sessionKeyHash, 0x20), sessionKeyHash_bytes32)
}
bytes memory delay = new bytes(32);
assembly {
mstore(add(delay, 0x20), _delay)
}
bytes memory delay_bytes8 = new bytes(8);
copyBytes(delay, 24, 8, delay_bytes8, 0);
bytes[4] memory args = [unonce, nbytes, sessionKeyHash, delay];
bytes32 queryId = oraclize_query("random", args, _customGasLimit);
bytes memory delay_bytes8_left = new bytes(8);
assembly {
let x := mload(add(delay_bytes8, 0x20))
mstore8(add(delay_bytes8_left, 0x27), div(x, 0x100000000000000000000000000000000000000000000000000000000000000))
mstore8(add(delay_bytes8_left, 0x26), div(x, 0x1000000000000000000000000000000000000000000000000000000000000))
mstore8(add(delay_bytes8_left, 0x25), div(x, 0x10000000000000000000000000000000000000000000000000000000000))
mstore8(add(delay_bytes8_left, 0x24), div(x, 0x100000000000000000000000000000000000000000000000000000000))
mstore8(add(delay_bytes8_left, 0x23), div(x, 0x1000000000000000000000000000000000000000000000000000000))
mstore8(add(delay_bytes8_left, 0x22), div(x, 0x10000000000000000000000000000000000000000000000000000))
mstore8(add(delay_bytes8_left, 0x21), div(x, 0x100000000000000000000000000000000000000000000000000))
mstore8(add(delay_bytes8_left, 0x20), div(x, 0x1000000000000000000000000000000000000000000000000))
}
oraclize_randomDS_setCommitment(queryId, keccak256(delay_bytes8_left, args[1], sha256(args[0]), args[2]));
return queryId;
}
function oraclize_randomDS_setCommitment(bytes32 queryId, bytes32 commitment) internal {
oraclize_randomDS_args[queryId] = commitment;
}
mapping(bytes32=>bytes32) oraclize_randomDS_args;
mapping(bytes32=>bool) oraclize_randomDS_sessionKeysHashVerified;
function verifySig(bytes32 tosignh, bytes dersig, bytes pubkey) internal returns (bool){
bool sigok;
address signer;
bytes32 sigr;
bytes32 sigs;
bytes memory sigr_ = new bytes(32);
uint offset = 4+(uint(dersig[3]) - 0x20);
sigr_ = copyBytes(dersig, offset, 32, sigr_, 0);
bytes memory sigs_ = new bytes(32);
offset += 32 + 2;
sigs_ = copyBytes(dersig, offset+(uint(dersig[offset-1]) - 0x20), 32, sigs_, 0);
assembly {
sigr := mload(add(sigr_, 32))
sigs := mload(add(sigs_, 32))
}
(sigok, signer) = safer_ecrecover(tosignh, 27, sigr, sigs);
if (address(keccak256(pubkey)) == signer) return true;
else {
(sigok, signer) = safer_ecrecover(tosignh, 28, sigr, sigs);
return (address(keccak256(pubkey)) == signer);
}
}
function oraclize_randomDS_proofVerify__sessionKeyValidity(bytes proof, uint sig2offset) internal returns (bool) {
bool sigok;
// Step 6: verify the attestation signature, APPKEY1 must sign the sessionKey from the correct ledger app (CODEHASH)
bytes memory sig2 = new bytes(uint(proof[sig2offset+1])+2);
copyBytes(proof, sig2offset, sig2.length, sig2, 0);
bytes memory appkey1_pubkey = new bytes(64);
copyBytes(proof, 3+1, 64, appkey1_pubkey, 0);
bytes memory tosign2 = new bytes(1+65+32);
tosign2[0] = byte(1); //role
copyBytes(proof, sig2offset-65, 65, tosign2, 1);
bytes memory CODEHASH = hex"fd94fa71bc0ba10d39d464d0d8f465efeef0a2764e3887fcc9df41ded20f505c";
copyBytes(CODEHASH, 0, 32, tosign2, 1+65);
sigok = verifySig(sha256(tosign2), sig2, appkey1_pubkey);
if (sigok == false) return false;
// Step 7: verify the APPKEY1 provenance (must be signed by Ledger)
bytes memory LEDGERKEY = hex"7fb956469c5c9b89840d55b43537e66a98dd4811ea0a27224272c2e5622911e8537a2f8e86a46baec82864e98dd01e9ccc2f8bc5dfc9cbe5a91a290498dd96e4";
bytes memory tosign3 = new bytes(1+65);
tosign3[0] = 0xFE;
copyBytes(proof, 3, 65, tosign3, 1);
bytes memory sig3 = new bytes(uint(proof[3+65+1])+2);
copyBytes(proof, 3+65, sig3.length, sig3, 0);
sigok = verifySig(sha256(tosign3), sig3, LEDGERKEY);
return sigok;
}
modifier oraclize_randomDS_proofVerify(bytes32 _queryId, string _result, bytes _proof) {
// Step 1: the prefix has to match 'LP\x01' (Ledger Proof version 1)
require((_proof[0] == "L") && (_proof[1] == "P") && (_proof[2] == 1));
bool proofVerified = oraclize_randomDS_proofVerify__main(_proof, _queryId, bytes(_result), oraclize_getNetworkName());
require(proofVerified);
_;
}
function oraclize_randomDS_proofVerify__returnCode(bytes32 _queryId, string _result, bytes _proof) internal returns (uint8){
// Step 1: the prefix has to match 'LP\x01' (Ledger Proof version 1)
if ((_proof[0] != "L")||(_proof[1] != "P")||(_proof[2] != 1)) return 1;
bool proofVerified = oraclize_randomDS_proofVerify__main(_proof, _queryId, bytes(_result), oraclize_getNetworkName());
if (proofVerified == false) return 2;
return 0;
}
function matchBytes32Prefix(bytes32 content, bytes prefix, uint n_random_bytes) internal pure returns (bool){
bool match_ = true;
require(prefix.length == n_random_bytes);
for (uint256 i=0; i< n_random_bytes; i++) {
if (content[i] != prefix[i]) match_ = false;
}
return match_;
}
function oraclize_randomDS_proofVerify__main(bytes proof, bytes32 queryId, bytes result, string context_name) internal returns (bool){
// Step 2: the unique keyhash has to match with the sha256 of (context name + queryId)
uint ledgerProofLength = 3+65+(uint(proof[3+65+1])+2)+32;
bytes memory keyhash = new bytes(32);
copyBytes(proof, ledgerProofLength, 32, keyhash, 0);
if (!(keccak256(keyhash) == keccak256(sha256(context_name, queryId)))) return false;
bytes memory sig1 = new bytes(uint(proof[ledgerProofLength+(32+8+1+32)+1])+2);
copyBytes(proof, ledgerProofLength+(32+8+1+32), sig1.length, sig1, 0);
// Step 3: we assume sig1 is valid (it will be verified during step 5) and we verify if 'result' is the prefix of sha256(sig1)
if (!matchBytes32Prefix(sha256(sig1), result, uint(proof[ledgerProofLength+32+8]))) return false;
// Step 4: commitment match verification, keccak256(delay, nbytes, unonce, sessionKeyHash) == commitment in storage.
// This is to verify that the computed args match with the ones specified in the query.
bytes memory commitmentSlice1 = new bytes(8+1+32);
copyBytes(proof, ledgerProofLength+32, 8+1+32, commitmentSlice1, 0);
bytes memory sessionPubkey = new bytes(64);
uint sig2offset = ledgerProofLength+32+(8+1+32)+sig1.length+65;
copyBytes(proof, sig2offset-64, 64, sessionPubkey, 0);
bytes32 sessionPubkeyHash = sha256(sessionPubkey);
if (oraclize_randomDS_args[queryId] == keccak256(commitmentSlice1, sessionPubkeyHash)){ //unonce, nbytes and sessionKeyHash match
delete oraclize_randomDS_args[queryId];
} else return false;
// Step 5: validity verification for sig1 (keyhash and args signed with the sessionKey)
bytes memory tosign1 = new bytes(32+8+1+32);
copyBytes(proof, ledgerProofLength, 32+8+1+32, tosign1, 0);
if (!verifySig(sha256(tosign1), sig1, sessionPubkey)) return false;
// verify if sessionPubkeyHash was verified already, if not.. let's do it!
if (oraclize_randomDS_sessionKeysHashVerified[sessionPubkeyHash] == false){
oraclize_randomDS_sessionKeysHashVerified[sessionPubkeyHash] = oraclize_randomDS_proofVerify__sessionKeyValidity(proof, sig2offset);
}
return oraclize_randomDS_sessionKeysHashVerified[sessionPubkeyHash];
}
// the following function has been written by Alex Beregszaszi (@axic), use it under the terms of the MIT license
function copyBytes(bytes from, uint fromOffset, uint length, bytes to, uint toOffset) internal pure returns (bytes) {
uint minLength = length + toOffset;
// Buffer too small
require(to.length >= minLength); // Should be a better way?
// NOTE: the offset 32 is added to skip the `size` field of both bytes variables
uint i = 32 + fromOffset;
uint j = 32 + toOffset;
while (i < (32 + fromOffset + length)) {
assembly {
let tmp := mload(add(from, i))
mstore(add(to, j), tmp)
}
i += 32;
j += 32;
}
return to;
}
// the following function has been written by Alex Beregszaszi (@axic), use it under the terms of the MIT license
// Duplicate Solidity's ecrecover, but catching the CALL return value
function safer_ecrecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal returns (bool, address) {
// We do our own memory management here. Solidity uses memory offset
// 0x40 to store the current end of memory. We write past it (as
// writes are memory extensions), but don't update the offset so
// Solidity will reuse it. The memory used here is only needed for
// this context.
// FIXME: inline assembly can't access return values
bool ret;
address addr;
assembly {
let size := mload(0x40)
mstore(size, hash)
mstore(add(size, 32), v)
mstore(add(size, 64), r)
mstore(add(size, 96), s)
// NOTE: we can reuse the request memory because we deal with
// the return code
ret := call(3000, 1, 0, size, 128, size, 32)
addr := mload(size)
}
return (ret, addr);
}
// the following function has been written by Alex Beregszaszi (@axic), use it under the terms of the MIT license
function ecrecovery(bytes32 hash, bytes sig) internal returns (bool, address) {
bytes32 r;
bytes32 s;
uint8 v;
if (sig.length != 65)
return (false, 0);
// The signature format is a compact form of:
// {bytes32 r}{bytes32 s}{uint8 v}
// Compact means, uint8 is not padded to 32 bytes.
assembly {
r := mload(add(sig, 32))
s := mload(add(sig, 64))
// Here we are loading the last 32 bytes. We exploit the fact that
// 'mload' will pad with zeroes if we overread.
// There is no 'mload8' to do this, but that would be nicer.
v := byte(0, mload(add(sig, 96)))
// Alternative solution:
// 'byte' is not working due to the Solidity parser, so lets
// use the second best option, 'and'
// v := and(mload(add(sig, 65)), 255)
}
// albeit non-transactional signatures are not specified by the YP, one would expect it
// to match the YP range of [27, 28]
//
// geth uses [0, 1] and some clients have followed. This might change, see:
// https://github.com/ethereum/go-ethereum/issues/2053
if (v < 27)
v += 27;
if (v != 27 && v != 28)
return (false, 0);
return safer_ecrecover(hash, v, r, s);
}
function safeMemoryCleaner() internal pure {
assembly {
let fmem := mload(0x40)
codecopy(fmem, codesize, sub(msize, fmem))
}
}
}
// </ORACLIZE_API>
// File: installed_contracts/stringutils/strings.sol
/*
* @title String & slice utility library for Solidity contracts.
* @author Nick Johnson <arachnid@notdot.net>
*
* @dev Functionality in this library is largely implemented using an
* abstraction called a 'slice'. A slice represents a part of a string -
* anything from the entire string to a single character, or even no
* characters at all (a 0-length slice). Since a slice only has to specify
* an offset and a length, copying and manipulating slices is a lot less
* expensive than copying and manipulating the strings they reference.
*
* To further reduce gas costs, most functions on slice that need to return
* a slice modify the original one instead of allocating a new one; for
* instance, `s.split(".")` will return the text up to the first '.',
* modifying s to only contain the remainder of the string after the '.'.
* In situations where you do not want to modify the original slice, you
* can make a copy first with `.copy()`, for example:
* `s.copy().split(".")`. Try and avoid using this idiom in loops; since
* Solidity has no memory management, it will result in allocating many
* short-lived slices that are later discarded.
*
* Functions that return two slices come in two versions: a non-allocating
* version that takes the second slice as an argument, modifying it in
* place, and an allocating version that allocates and returns the second
* slice; see `nextRune` for example.
*
* Functions that have to copy string data will return strings rather than
* slices; these can be cast back to slices for further processing if
* required.
*
* For convenience, some functions are provided with non-modifying
* variants that create a new slice and return both; for instance,
* `s.splitNew('.')` leaves s unmodified, and returns two values
* corresponding to the left and right parts of the string.
*/
pragma solidity ^0.4.14;
library strings {
struct slice {
uint _len;
uint _ptr;
}
function memcpy(uint dest, uint src, uint len) private pure {
// Copy word-length chunks while possible
for(; len >= 32; len -= 32) {
assembly {
mstore(dest, mload(src))
}
dest += 32;
src += 32;
}
// Copy remaining bytes
uint mask = 256 ** (32 - len) - 1;
assembly {
let srcpart := and(mload(src), not(mask))
let destpart := and(mload(dest), mask)
mstore(dest, or(destpart, srcpart))
}
}
/*
* @dev Returns a slice containing the entire string.
* @param self The string to make a slice from.
* @return A newly allocated slice containing the entire string.
*/
function toSlice(string memory self) internal pure returns (slice memory) {
uint ptr;
assembly {
ptr := add(self, 0x20)
}
return slice(bytes(self).length, ptr);
}
/*
* @dev Returns the length of a null-terminated bytes32 string.
* @param self The value to find the length of.
* @return The length of the string, from 0 to 32.
*/
function len(bytes32 self) internal pure returns (uint) {
uint ret;
if (self == 0)
return 0;
if (self & 0xffffffffffffffffffffffffffffffff == 0) {
ret += 16;
self = bytes32(uint(self) / 0x100000000000000000000000000000000);
}
if (self & 0xffffffffffffffff == 0) {
ret += 8;
self = bytes32(uint(self) / 0x10000000000000000);
}
if (self & 0xffffffff == 0) {
ret += 4;
self = bytes32(uint(self) / 0x100000000);
}
if (self & 0xffff == 0) {
ret += 2;
self = bytes32(uint(self) / 0x10000);
}
if (self & 0xff == 0) {
ret += 1;
}
return 32 - ret;
}
/*
* @dev Returns a slice containing the entire bytes32, interpreted as a
* null-terminated utf-8 string.
* @param self The bytes32 value to convert to a slice.
* @return A new slice containing the value of the input argument up to the
* first null.
*/
function toSliceB32(bytes32 self) internal pure returns (slice memory ret) {
// Allocate space for `self` in memory, copy it there, and point ret at it
assembly {
let ptr := mload(0x40)
mstore(0x40, add(ptr, 0x20))
mstore(ptr, self)
mstore(add(ret, 0x20), ptr)
}
ret._len = len(self);
}
/*
* @dev Returns a new slice containing the same data as the current slice.
* @param self The slice to copy.
* @return A new slice containing the same data as `self`.
*/
function copy(slice memory self) internal pure returns (slice memory) {
return slice(self._len, self._ptr);
}
/*
* @dev Copies a slice to a new string.
* @param self The slice to copy.
* @return A newly allocated string containing the slice's text.
*/
function toString(slice memory self) internal pure returns (string memory) {
string memory ret = new string(self._len);
uint retptr;
assembly { retptr := add(ret, 32) }
memcpy(retptr, self._ptr, self._len);
return ret;
}
/*
* @dev Returns the length in runes of the slice. Note that this operation
* takes time proportional to the length of the slice; avoid using it
* in loops, and call `slice.empty()` if you only need to know whether
* the slice is empty or not.
* @param self The slice to operate on.
* @return The length of the slice in runes.
*/
function len(slice memory self) internal pure returns (uint l) {
// Starting at ptr-31 means the LSB will be the byte we care about
uint ptr = self._ptr - 31;
uint end = ptr + self._len;
for (l = 0; ptr < end; l++) {
uint8 b;
assembly { b := and(mload(ptr), 0xFF) }
if (b < 0x80) {
ptr += 1;
} else if(b < 0xE0) {
ptr += 2;
} else if(b < 0xF0) {
ptr += 3;
} else if(b < 0xF8) {
ptr += 4;
} else if(b < 0xFC) {
ptr += 5;
} else {
ptr += 6;
}
}
}
/*
* @dev Returns true if the slice is empty (has a length of 0).
* @param self The slice to operate on.
* @return True if the slice is empty, False otherwise.
*/
function empty(slice memory self) internal pure returns (bool) {
return self._len == 0;
}
/*
* @dev Returns a positive number if `other` comes lexicographically after
* `self`, a negative number if it comes before, or zero if the
* contents of the two slices are equal. Comparison is done per-rune,
* on unicode codepoints.
* @param self The first slice to compare.
* @param other The second slice to compare.
* @return The result of the comparison.
*/
function compare(slice memory self, slice memory other) internal pure returns (int) {
uint shortest = self._len;
if (other._len < self._len)
shortest = other._len;
uint selfptr = self._ptr;
uint otherptr = other._ptr;
for (uint idx = 0; idx < shortest; idx += 32) {
uint a;
uint b;
assembly {
a := mload(selfptr)
b := mload(otherptr)
}
if (a != b) {
// Mask out irrelevant bytes and check again
uint256 mask = uint256(-1); // 0xffff...
if(shortest < 32) {
mask = ~(2 ** (8 * (32 - shortest + idx)) - 1);
}
uint256 diff = (a & mask) - (b & mask);
if (diff != 0)
return int(diff);
}
selfptr += 32;
otherptr += 32;
}
return int(self._len) - int(other._len);
}
/*
* @dev Returns true if the two slices contain the same text.
* @param self The first slice to compare.
* @param self The second slice to compare.
* @return True if the slices are equal, false otherwise.
*/
function equals(slice memory self, slice memory other) internal pure returns (bool) {
return compare(self, other) == 0;
}
/*
* @dev Extracts the first rune in the slice into `rune`, advancing the
* slice to point to the next rune and returning `self`.
* @param self The slice to operate on.
* @param rune The slice that will contain the first rune.
* @return `rune`.
*/
function nextRune(slice memory self, slice memory rune) internal pure returns (slice memory) {
rune._ptr = self._ptr;
if (self._len == 0) {
rune._len = 0;
return rune;
}
uint l;
uint b;
// Load the first byte of the rune into the LSBs of b
assembly { b := and(mload(sub(mload(add(self, 32)), 31)), 0xFF) }
if (b < 0x80) {
l = 1;
} else if(b < 0xE0) {
l = 2;
} else if(b < 0xF0) {
l = 3;
} else {
l = 4;
}
// Check for truncated codepoints
if (l > self._len) {
rune._len = self._len;
self._ptr += self._len;
self._len = 0;
return rune;
}
self._ptr += l;
self._len -= l;
rune._len = l;
return rune;
}
/*
* @dev Returns the first rune in the slice, advancing the slice to point
* to the next rune.
* @param self The slice to operate on.
* @return A slice containing only the first rune from `self`.
*/
function nextRune(slice memory self) internal pure returns (slice memory ret) {
nextRune(self, ret);
}
/*
* @dev Returns the number of the first codepoint in the slice.
* @param self The slice to operate on.
* @return The number of the first codepoint in the slice.
*/
function ord(slice memory self) internal pure returns (uint ret) {
if (self._len == 0) {
return 0;
}
uint word;
uint length;
uint divisor = 2 ** 248;
// Load the rune into the MSBs of b
assembly { word:= mload(mload(add(self, 32))) }
uint b = word / divisor;
if (b < 0x80) {
ret = b;
length = 1;
} else if(b < 0xE0) {
ret = b & 0x1F;
length = 2;
} else if(b < 0xF0) {
ret = b & 0x0F;
length = 3;
} else {
ret = b & 0x07;
length = 4;
}
// Check for truncated codepoints
if (length > self._len) {
return 0;
}
for (uint i = 1; i < length; i++) {
divisor = divisor / 256;
b = (word / divisor) & 0xFF;
if (b & 0xC0 != 0x80) {
// Invalid UTF-8 sequence
return 0;
}
ret = (ret * 64) | (b & 0x3F);
}
return ret;
}
/*
* @dev Returns the keccak-256 hash of the slice.
* @param self The slice to hash.
* @return The hash of the slice.
*/
function keccak(slice memory self) internal pure returns (bytes32 ret) {
assembly {
ret := keccak256(mload(add(self, 32)), mload(self))
}
}
/*
* @dev Returns true if `self` starts with `needle`.
* @param self The slice to operate on.
* @param needle The slice to search for.
* @return True if the slice starts with the provided text, false otherwise.
*/
function startsWith(slice memory self, slice memory needle) internal pure returns (bool) {
if (self._len < needle._len) {
return false;
}
if (self._ptr == needle._ptr) {
return true;
}
bool equal;
assembly {
let length := mload(needle)
let selfptr := mload(add(self, 0x20))
let needleptr := mload(add(needle, 0x20))
equal := eq(keccak256(selfptr, length), keccak256(needleptr, length))
}
return equal;
}
/*
* @dev If `self` starts with `needle`, `needle` is removed from the
* beginning of `self`. Otherwise, `self` is unmodified.
* @param self The slice to operate on.
* @param needle The slice to search for.
* @return `self`
*/
function beyond(slice memory self, slice memory needle) internal pure returns (slice memory) {
if (self._len < needle._len) {
return self;
}
bool equal = true;
if (self._ptr != needle._ptr) {
assembly {
let length := mload(needle)
let selfptr := mload(add(self, 0x20))
let needleptr := mload(add(needle, 0x20))
equal := eq(keccak256(selfptr, length), keccak256(needleptr, length))
}
}
if (equal) {
self._len -= needle._len;
self._ptr += needle._len;
}
return self;
}
/*
* @dev Returns true if the slice ends with `needle`.
* @param self The slice to operate on.
* @param needle The slice to search for.
* @return True if the slice starts with the provided text, false otherwise.
*/
function endsWith(slice memory self, slice memory needle) internal pure returns (bool) {
if (self._len < needle._len) {
return false;
}
uint selfptr = self._ptr + self._len - needle._len;
if (selfptr == needle._ptr) {
return true;
}
bool equal;
assembly {
let length := mload(needle)
let needleptr := mload(add(needle, 0x20))
equal := eq(keccak256(selfptr, length), keccak256(needleptr, length))
}
return equal;
}
/*
* @dev If `self` ends with `needle`, `needle` is removed from the
* end of `self`. Otherwise, `self` is unmodified.
* @param self The slice to operate on.
* @param needle The slice to search for.
* @return `self`
*/
function until(slice memory self, slice memory needle) internal pure returns (slice memory) {
if (self._len < needle._len) {
return self;
}
uint selfptr = self._ptr + self._len - needle._len;
bool equal = true;
if (selfptr != needle._ptr) {
assembly {
let length := mload(needle)
let needleptr := mload(add(needle, 0x20))
equal := eq(keccak256(selfptr, length), keccak256(needleptr, length))
}
}
if (equal) {
self._len -= needle._len;
}
return self;
}
// Returns the memory address of the first byte of the first occurrence of
// `needle` in `self`, or the first byte after `self` if not found.
function findPtr(uint selflen, uint selfptr, uint needlelen, uint needleptr) private pure returns (uint) {
uint ptr = selfptr;
uint idx;
if (needlelen <= selflen) {
if (needlelen <= 32) {
bytes32 mask = bytes32(~(2 ** (8 * (32 - needlelen)) - 1));
bytes32 needledata;
assembly { needledata := and(mload(needleptr), mask) }
uint end = selfptr + selflen - needlelen;
bytes32 ptrdata;
assembly { ptrdata := and(mload(ptr), mask) }
while (ptrdata != needledata) {
if (ptr >= end)
return selfptr + selflen;
ptr++;
assembly { ptrdata := and(mload(ptr), mask) }
}
return ptr;
} else {
// For long needles, use hashing
bytes32 hash;
assembly { hash := keccak256(needleptr, needlelen) }
for (idx = 0; idx <= selflen - needlelen; idx++) {
bytes32 testHash;
assembly { testHash := keccak256(ptr, needlelen) }
if (hash == testHash)
return ptr;
ptr += 1;
}
}
}
return selfptr + selflen;
}
// Returns the memory address of the first byte after the last occurrence of
// `needle` in `self`, or the address of `self` if not found.
function rfindPtr(uint selflen, uint selfptr, uint needlelen, uint needleptr) private pure returns (uint) {
uint ptr;
if (needlelen <= selflen) {
if (needlelen <= 32) {
bytes32 mask = bytes32(~(2 ** (8 * (32 - needlelen)) - 1));
bytes32 needledata;
assembly { needledata := and(mload(needleptr), mask) }
ptr = selfptr + selflen - needlelen;
bytes32 ptrdata;
assembly { ptrdata := and(mload(ptr), mask) }
while (ptrdata != needledata) {
if (ptr <= selfptr)
return selfptr;
ptr--;
assembly { ptrdata := and(mload(ptr), mask) }
}
return ptr + needlelen;
} else {
// For long needles, use hashing
bytes32 hash;
assembly { hash := keccak256(needleptr, needlelen) }
ptr = selfptr + (selflen - needlelen);
while (ptr >= selfptr) {
bytes32 testHash;
assembly { testHash := keccak256(ptr, needlelen) }
if (hash == testHash)
return ptr + needlelen;
ptr -= 1;
}
}
}
return selfptr;
}
/*
* @dev Modifies `self` to contain everything from the first occurrence of
* `needle` to the end of the slice. `self` is set to the empty slice
* if `needle` is not found.
* @param self The slice to search and modify.
* @param needle The text to search for.
* @return `self`.
*/
function find(slice memory self, slice memory needle) internal pure returns (slice memory) {
uint ptr = findPtr(self._len, self._ptr, needle._len, needle._ptr);
self._len -= ptr - self._ptr;
self._ptr = ptr;
return self;
}
/*
* @dev Modifies `self` to contain the part of the string from the start of
* `self` to the end of the first occurrence of `needle`. If `needle`
* is not found, `self` is set to the empty slice.
* @param self The slice to search and modify.
* @param needle The text to search for.
* @return `self`.
*/
function rfind(slice memory self, slice memory needle) internal pure returns (slice memory) {
uint ptr = rfindPtr(self._len, self._ptr, needle._len, needle._ptr);
self._len = ptr - self._ptr;
return self;
}
/*
* @dev Splits the slice, setting `self` to everything after the first
* occurrence of `needle`, and `token` to everything before it. If
* `needle` does not occur in `self`, `self` is set to the empty slice,
* and `token` is set to the entirety of `self`.
* @param self The slice to split.
* @param needle The text to search for in `self`.
* @param token An output parameter to which the first token is written.
* @return `token`.
*/
function split(slice memory self, slice memory needle, slice memory token) internal pure returns (slice memory) {
uint ptr = findPtr(self._len, self._ptr, needle._len, needle._ptr);
token._ptr = self._ptr;
token._len = ptr - self._ptr;
if (ptr == self._ptr + self._len) {
// Not found
self._len = 0;
} else {
self._len -= token._len + needle._len;
self._ptr = ptr + needle._len;
}
return token;
}
/*
* @dev Splits the slice, setting `self` to everything after the first
* occurrence of `needle`, and returning everything before it. If
* `needle` does not occur in `self`, `self` is set to the empty slice,
* and the entirety of `self` is returned.
* @param self The slice to split.
* @param needle The text to search for in `self`.
* @return The part of `self` up to the first occurrence of `delim`.
*/
function split(slice memory self, slice memory needle) internal pure returns (slice memory token) {
split(self, needle, token);
}
/*
* @dev Splits the slice, setting `self` to everything before the last
* occurrence of `needle`, and `token` to everything after it. If
* `needle` does not occur in `self`, `self` is set to the empty slice,
* and `token` is set to the entirety of `self`.
* @param self The slice to split.
* @param needle The text to search for in `self`.
* @param token An output parameter to which the first token is written.
* @return `token`.
*/
function rsplit(slice memory self, slice memory needle, slice memory token) internal pure returns (slice memory) {
uint ptr = rfindPtr(self._len, self._ptr, needle._len, needle._ptr);
token._ptr = ptr;
token._len = self._len - (ptr - self._ptr);
if (ptr == self._ptr) {
// Not found
self._len = 0;
} else {
self._len -= token._len + needle._len;
}
return token;
}
/*
* @dev Splits the slice, setting `self` to everything before the last
* occurrence of `needle`, and returning everything after it. If
* `needle` does not occur in `self`, `self` is set to the empty slice,
* and the entirety of `self` is returned.
* @param self The slice to split.
* @param needle The text to search for in `self`.
* @return The part of `self` after the last occurrence of `delim`.
*/
function rsplit(slice memory self, slice memory needle) internal pure returns (slice memory token) {
rsplit(self, needle, token);
}
/*
* @dev Counts the number of nonoverlapping occurrences of `needle` in `self`.
* @param self The slice to search.
* @param needle The text to search for in `self`.
* @return The number of occurrences of `needle` found in `self`.
*/
function count(slice memory self, slice memory needle) internal pure returns (uint cnt) {
uint ptr = findPtr(self._len, self._ptr, needle._len, needle._ptr) + needle._len;
while (ptr <= self._ptr + self._len) {
cnt++;
ptr = findPtr(self._len - (ptr - self._ptr), ptr, needle._len, needle._ptr) + needle._len;
}
}
/*
* @dev Returns True if `self` contains `needle`.
* @param self The slice to search.
* @param needle The text to search for in `self`.
* @return True if `needle` is found in `self`, false otherwise.
*/
function contains(slice memory self, slice memory needle) internal pure returns (bool) {
return rfindPtr(self._len, self._ptr, needle._len, needle._ptr) != self._ptr;
}
/*
* @dev Returns a newly allocated string containing the concatenation of
* `self` and `other`.
* @param self The first slice to concatenate.
* @param other The second slice to concatenate.
* @return The concatenation of the two strings.
*/
function concat(slice memory self, slice memory other) internal pure returns (string memory) {
string memory ret = new string(self._len + other._len);
uint retptr;
assembly { retptr := add(ret, 32) }
memcpy(retptr, self._ptr, self._len);
memcpy(retptr + self._len, other._ptr, other._len);
return ret;
}
/*
* @dev Joins an array of slices, using `self` as a delimiter, returning a
* newly allocated string.
* @param self The delimiter to use.
* @param parts A list of slices to join.
* @return A newly allocated string containing all the slices in `parts`,
* joined with `self`.
*/
function join(slice memory self, slice[] memory parts) internal pure returns (string memory) {
if (parts.length == 0)
return "";
uint length = self._len * (parts.length - 1);
for(uint i = 0; i < parts.length; i++)
length += parts[i]._len;
string memory ret = new string(length);
uint retptr;
assembly { retptr := add(ret, 32) }
for(i = 0; i < parts.length; i++) {
memcpy(retptr, parts[i]._ptr, parts[i]._len);
retptr += parts[i]._len;
if (i < parts.length - 1) {
memcpy(retptr, self._ptr, self._len);
retptr += self._len;
}
}
return ret;
}
}
// File: zeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
// File: zeppelin-solidity/contracts/lifecycle/Pausable.sol
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() public onlyOwner whenNotPaused {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() public onlyOwner whenPaused {
paused = false;
emit Unpause();
}
}
// File: zeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (_a == 0) {
return 0;
}
c = _a * _b;
assert(c / _a == _b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
// assert(_b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = _a / _b;
// assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold
return _a / _b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
assert(_b <= _a);
return _a - _b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
c = _a + _b;
assert(c >= _a);
return c;
}
}
// File: contracts/PlayToken.sol
interface ERC20Token {
function totalSupply() external view returns (uint);
function balanceOf(address who) external constant returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
}
contract PlayToken is Pausable{
ERC20Token Token;
bool public registeredToken = false;
uint public tokenDecimalPlaces = 2;
address public tokenAddress;
uint public tokenWinRatio = 555555555555555 wei; //1800
uint public tokenLossRatio = 5000000000000000 wei; //200
modifier TokenCheck() {
if (registeredToken != true) { //check balance
revert();
}
_;
}
function registerToken(address _tokenAddress, uint decimalPlaces) public onlyOwner{
Token = ERC20Token(_tokenAddress);
tokenAddress = _tokenAddress;
registeredToken = true;
tokenDecimalPlaces = decimalPlaces;
}
function remainingTokens(address who) public constant returns (uint){
return Token.balanceOf(who)/(10 ** tokenDecimalPlaces);
}
function getTokenWinValue(uint betInWei) public view returns(uint){
return betInWei/tokenWinRatio;
}
function getTokenLossValue(uint betInWei) public view returns(uint){
return betInWei/tokenLossRatio;
}
function setWinLossAmount(uint winAmount, uint lossAmount)public onlyOwner{
tokenWinRatio = 1 ether/winAmount;
tokenLossRatio = 1 ether/lossAmount;
}
function getWinTokenAmount()public constant returns(uint){
return 1 ether/tokenWinRatio;
}
function getLossTokenAmount()public constant returns(uint){
return 1 ether/tokenLossRatio;
}
}
// File: contracts/CustomEvents.sol
contract CustomEvents{
event betPayout(address indexed playerAddr, uint amount);
event betPayoutToken(address indexed playerAddr, uint amount);
event dealtCards(address indexed player, bytes32 orcID, uint dealerHand, uint playerHand, uint dealerSuit, uint playerSuit);
event currentOrcID(bytes32 orcID);
event DEBUG_betSplit(uint mainBet, uint sideBet, uint percent);
event DEBUG_str(string msg);
event DEBUG_invalidOp(string error);
event DEBUG_addr(address addr);
event DEBUG_byte(bytes32 thing);
event DEBUG_uint(uint thing);
}
// File: contracts/TestMode.sol
contract TestMode is Pausable {
bool public TEST_MODE = false;
uint public TEST_HOUSE = 111;
uint public TEST_PLAYER = 111;
function ToggleTestMode(bool state) public onlyOwner{
TEST_MODE = state;
}
function SetTestModeHands(uint house, uint player) public onlyOwner{
require(house <= 416 && house >= 1);
require(player <= 416 && player >= 1);
TEST_HOUSE = house;
TEST_PLAYER = player;
}
}
// File: contracts/War.sol
contract War is usingOraclize, Pausable, PlayToken, CustomEvents, TestMode {
using strings for *;
using SafeMath for uint;
// default game settings
uint public sideBetPercent_MAX = 80;
uint public bet_MAX = 10 ether;
uint public bet_MIN = 0.05 ether;
uint public gasForShuffle = 185000;
// player info store
struct Info{
address playerAddress;
uint fees;
uint mainBetAmount;
uint sideBetAmount;
uint sideBetPercentage;
uint playerHand;
uint houseHand;
}
struct FirstHand{
bool isTied;
uint fees;
uint mainBetAmount;
}
mapping (bytes32 => Info) public hand_info;
mapping (address => FirstHand) public firstHandInfo;
mapping (address => bool) public hasHandInProgress;
mapping (address => uint) public refundPool;
constructor() public {
oraclize_setCustomGasPrice(20000000000);
}
function() public payable {}
//=====================
// Game Settings
//=====================
function setGasPrice(uint gasPrice) public onlyOwner{
oraclize_setCustomGasPrice(gasPrice);
}
function setOraclizeGas(uint32 gasAmount) public onlyOwner{
gasForShuffle = gasAmount;
}
function setBetMinMax(uint min_bet, uint max_bet) public onlyOwner{
require(min_bet > max_bet);
bet_MIN = min_bet;
bet_MAX = max_bet;
}
function setSideBetPercentage(uint percentage) public onlyOwner{
require(percentage >= 0 && percentage <= 100);
sideBetPercent_MAX = percentage;
}
//=====================
// Main gameplay
//=====================
function playWar(uint sideBetPercent) public whenNotPaused TokenCheck payable {
require(sideBetPercent >= 0 && sideBetPercent <= sideBetPercent_MAX);
require(hasHandInProgress[msg.sender]==false);
require(msg.value <= bet_MAX && msg.value >= bet_MIN);
uint betAmount = msg.value;
uint sideBetAmount = betAmount.mul(sideBetPercent).div(100);
uint mainBetAmount = betAmount.sub(sideBetAmount);
emit DEBUG_betSplit(mainBetAmount, sideBetAmount, sideBetPercent);
//Initiate oraclize call
bytes32 orcID = oraclize_query("WolframAlpha", "RandomSample[Range[416],2]",gasForShuffle);
emit currentOrcID(orcID);
uint orcFees = oraclize_getPrice("WolframAlpha", gasForShuffle);
//check if previous hand was a tie and player chose to go to WAR
if(firstHandInfo[msg.sender].isTied){
assert(msg.value == firstHandInfo[msg.sender].mainBetAmount);
assert(sideBetAmount == 0);
}
else{
FirstHand memory thisHand = FirstHand({
isTied : false,
fees: orcFees,
mainBetAmount : mainBetAmount
});
firstHandInfo[msg.sender] = thisHand;
}
Info memory info = Info({
playerAddress : msg.sender,
mainBetAmount : mainBetAmount,
sideBetAmount : sideBetAmount,
fees: orcFees,
sideBetPercentage : sideBetPercent,
playerHand : 0,
houseHand : 0
});
hand_info[orcID] = info;
refundPool[msg.sender] = msg.value.sub(orcFees);
hasHandInProgress[msg.sender] = true;
}
function parseResult(bytes32 orcID, string result, address playerAddr) private returns(uint, uint){
strings.slice memory partition = result.toSlice();
partition.beyond("{".toSlice()).until("}".toSlice());
strings.slice memory delim = ",".toSlice();
uint houseRaw = parseInt(partition.split(delim).toString());
uint playerRaw = parseInt(partition.split(delim).toString());
if(TEST_MODE){
houseRaw = TEST_HOUSE;
playerRaw = TEST_PLAYER;
}
hand_info[orcID].houseHand = getCardValue(houseRaw);
hand_info[orcID].playerHand = getCardValue(playerRaw);
uint houseHand = hand_info[orcID].houseHand;
uint playerHand = hand_info[orcID].playerHand;
emit dealtCards(playerAddr, orcID, houseHand, playerHand, houseRaw, playerRaw);
return(playerHand, houseHand);
}
function __callback(bytes32 orcID, string result) public{
//security checks
require(msg.sender == oraclize_cbAddress());
require(hand_info[orcID].playerAddress!=0x0);
address playerAddr = hand_info[orcID].playerAddress;
require(hasHandInProgress[playerAddr]==true);
hasHandInProgress[playerAddr] = false;
delete refundPool[playerAddr];
uint playerHand;
uint houseHand;
(playerHand, houseHand) = parseResult(orcID, result, playerAddr);
uint fees;
if(playerHand == houseHand){
uint betAmount = firstHandInfo[playerAddr].mainBetAmount;
fees = firstHandInfo[playerAddr].fees;
if(firstHandInfo[playerAddr].isTied){
pay(playerAddr, betAmount,fees);
payToken(playerAddr, getTokenWinValue(betAmount).mul(3));
delete firstHandInfo[playerAddr];
}
else{
firstHandInfo[playerAddr].isTied = true;
Info memory hand = hand_info[orcID];
if(hand.sideBetAmount > 0){
sideBetPay(orcID);
sideBetPayToken(orcID);
}
else{
payToken(playerAddr, getTokenLossValue(betAmount));
}
}
}
uint winAmount = hand_info[orcID].mainBetAmount;
fees = hand_info[orcID].fees;
//Pay winner
if(playerHand > houseHand){
uint winTokenAmount = getTokenWinValue(winAmount);
pay(playerAddr,winAmount,fees);
payToken(playerAddr,winTokenAmount);
delete firstHandInfo[playerAddr];
delete hand_info[orcID];
}
else if(playerHand < houseHand){
uint lossTokenAmount = getTokenLossValue(winAmount);
payToken(playerAddr,lossTokenAmount);
delete firstHandInfo[playerAddr];
delete hand_info[orcID];
}
}
function playerSurrender() public whenNotPaused payable {
if(firstHandInfo[msg.sender].isTied){
emit DEBUG_str("player surrendering");
// uint returnAmount = div(firstHandInfo[msg.sender].mainBetAmount,2);
uint returnAmount = (firstHandInfo[msg.sender].mainBetAmount).div(2);
uint fees = firstHandInfo[msg.sender].fees;
pay(msg.sender,returnAmount,fees);
delete firstHandInfo[msg.sender];
}
else{
emit DEBUG_str("nothing to surrender"); //change this function to return false
}
}
//=====================
// Payment methods
//=====================
function pay(address _addr, uint amount, uint fees) private {
amount = amount.sub(fees);
_addr.transfer(amount);
emit betPayout(_addr, amount);
}
function payToken(address _addr, uint amount) private {
Token.transfer(_addr,amount * 10 ** tokenDecimalPlaces);
emit betPayoutToken(_addr, amount);
}
function sideBetPay(bytes32 orcID) private{
Info memory hand = hand_info[orcID];
if(hand.sideBetAmount > 0) {
pay(hand.playerAddress,hand.sideBetAmount,hand.fees);
}
}
function sideBetPayToken(bytes32 orcID) private{
Info memory hand = hand_info[orcID];
if(hand.sideBetAmount > 0){
uint sideBetWin = getTokenWinValue(hand.sideBetAmount).mul(10);
payToken(hand.playerAddress,sideBetWin);
}
}
function refund() whenNotPaused public returns(uint){
address _addr = msg.sender;
uint amount = refundPool[_addr];
require(hasHandInProgress[_addr]==true);
require(amount>0);
require(amount<=bet_MAX);
_addr.transfer(amount);
emit betPayout(_addr, amount);
hasHandInProgress[_addr]=false;
delete refundPool[_addr];
return amount;
}
function houseBankRoll() view public returns(uint){
return address(this).balance;
}
//=====================
// Owner
//=====================
function withdrawFunds() public onlyOwner{
msg.sender.transfer(address(this).balance);
}
function withdrawTokens() public onlyOwner{
uint amount = Token.balanceOf(address(this));
Token.transfer(msg.sender, amount);
}
//=====================
// Special
//=====================
function getCardValue(uint card) private pure returns(uint){
if (card > 416 || card < 1) {
return 0;
}
card = card % 52;
if (card == 0) {
return 13;
} else if (card <= 4) {
return 14;
} else if (card % 4 > 0) {
card = card.div(4).add(1);
} else {
card = card.div(4);
}
return card == 1 ? 14 : card;
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"firstHandInfo","outputs":[{"name":"isTied","type":"bool"},{"name":"fees","type":"uint256"},{"name":"mainBetAmount","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_tokenAddress","type":"address"},{"name":"decimalPlaces","type":"uint256"}],"name":"registerToken","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"percentage","type":"uint256"}],"name":"setSideBetPercentage","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"tokenDecimalPlaces","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"who","type":"address"}],"name":"remainingTokens","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"withdrawFunds","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"orcID","type":"bytes32"},{"name":"result","type":"string"}],"name":"__callback","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getWinTokenAmount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"playerSurrender","outputs":[],"payable":true,"stateMutability":"payable","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":false,"inputs":[],"name":"unpause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"gasForShuffle","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"refund","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"betInWei","type":"uint256"}],"name":"getTokenWinValue","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"registeredToken","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"betInWei","type":"uint256"}],"name":"getTokenLossValue","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"winAmount","type":"uint256"},{"name":"lossAmount","type":"uint256"}],"name":"setWinLossAmount","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"tokenWinRatio","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"pause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"gasAmount","type":"uint32"}],"name":"setOraclizeGas","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"TEST_HOUSE","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"withdrawTokens","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"hasHandInProgress","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"tokenLossRatio","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"tokenAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"TEST_MODE","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"sideBetPercent_MAX","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"min_bet","type":"uint256"},{"name":"max_bet","type":"uint256"}],"name":"setBetMinMax","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"state","type":"bool"}],"name":"ToggleTestMode","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"houseBankRoll","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"house","type":"uint256"},{"name":"player","type":"uint256"}],"name":"SetTestModeHands","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"gasPrice","type":"uint256"}],"name":"setGasPrice","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"hand_info","outputs":[{"name":"playerAddress","type":"address"},{"name":"fees","type":"uint256"},{"name":"mainBetAmount","type":"uint256"},{"name":"sideBetAmount","type":"uint256"},{"name":"sideBetPercentage","type":"uint256"},{"name":"playerHand","type":"uint256"},{"name":"houseHand","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"sideBetPercent","type":"uint256"}],"name":"playWar","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"TEST_PLAYER","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"bet_MAX","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"refundPool","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getLossTokenAmount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"bet_MIN","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"playerAddr","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"betPayout","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"playerAddr","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"betPayoutToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"player","type":"address"},{"indexed":false,"name":"orcID","type":"bytes32"},{"indexed":false,"name":"dealerHand","type":"uint256"},{"indexed":false,"name":"playerHand","type":"uint256"},{"indexed":false,"name":"dealerSuit","type":"uint256"},{"indexed":false,"name":"playerSuit","type":"uint256"}],"name":"dealtCards","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"orcID","type":"bytes32"}],"name":"currentOrcID","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"mainBet","type":"uint256"},{"indexed":false,"name":"sideBet","type":"uint256"},{"indexed":false,"name":"percent","type":"uint256"}],"name":"DEBUG_betSplit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"msg","type":"string"}],"name":"DEBUG_str","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"error","type":"string"}],"name":"DEBUG_invalidOp","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"addr","type":"address"}],"name":"DEBUG_addr","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"thing","type":"bytes32"}],"name":"DEBUG_byte","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"thing","type":"uint256"}],"name":"DEBUG_uint","type":"event"},{"anonymous":false,"inputs":[],"name":"Pause","type":"event"},{"anonymous":false,"inputs":[],"name":"Unpause","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"}],"name":"OwnershipRenounced","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]Contract Creation Code
60806040526005805460a060020a60ff021990811690915560068054909116905560026007556601f9465b8ab8e36009556611c37937e08000600a55600b805460ff19169055606f600c819055600d556050600e55678ac7230489e80000600f5566b1a2bc2ec500006010556202d2a86011553480156200007f57600080fd5b5060058054600160a060020a03191633179055620000ab6404a817c800640100000000620000b1810204565b62000778565b600054600160a060020a03161580620000e75750600054620000e590600160a060020a0316640100000000620002f1810204565b155b156200010457620001026000640100000000620002f5810204565b505b6000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1580156200017057600080fd5b505af115801562000185573d6000803e3d6000fd5b505050506040513d60208110156200019c57600080fd5b5051600154600160a060020a039081169116146200026e576000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1580156200022057600080fd5b505af115801562000235573d6000803e3d6000fd5b505050506040513d60208110156200024c57600080fd5b505160018054600160a060020a031916600160a060020a039092169190911790555b600154604080517fca6ad1e4000000000000000000000000000000000000000000000000000000008152600481018490529051600160a060020a039092169163ca6ad1e49160248082019260009290919082900301818387803b158015620002d557600080fd5b505af1158015620002ea573d6000803e3d6000fd5b5050505050565b3b90565b60006200030a64010000000062000310810204565b92915050565b6000806200033b731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed640100000000620002f1810204565b1115620003b95760008054600160a060020a031916731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed17905560408051808201909152600b81527f6574685f6d61696e6e65740000000000000000000000000000000000000000006020820152620003b090640100000000620006bd810204565b506001620006ba565b6000620003e373c03a2615d5efaf5f49f60b7bb6583eaec212fdf1640100000000620002f1810204565b1115620004585760008054600160a060020a03191673c03a2615d5efaf5f49f60b7bb6583eaec212fdf117905560408051808201909152600c81527f6574685f726f707374656e3300000000000000000000000000000000000000006020820152620003b090640100000000620006bd810204565b60006200048273b7a07bcf2ba2f2703b24c0691b5278999c59ac7e640100000000620002f1810204565b1115620004f75760008054600160a060020a03191673b7a07bcf2ba2f2703b24c0691b5278999c59ac7e17905560408051808201909152600981527f6574685f6b6f76616e00000000000000000000000000000000000000000000006020820152620003b090640100000000620006bd810204565b60006200052173146500cfd35b22e4a392fe0adc06de1a1368ed48640100000000620002f1810204565b1115620005965760008054600160a060020a03191673146500cfd35b22e4a392fe0adc06de1a1368ed4817905560408051808201909152600b81527f6574685f72696e6b6562790000000000000000000000000000000000000000006020820152620003b090640100000000620006bd810204565b6000620005c0736f485c8bf6fc43ea212e93bbf8ce046c7f1cb475640100000000620002f1810204565b1115620005f6575060008054600160a060020a031916736f485c8bf6fc43ea212e93bbf8ce046c7f1cb4751790556001620006ba565b6000620006207320e12a1f859b3feae5fb2a0a32c18f5a65555bbf640100000000620002f1810204565b111562000656575060008054600160a060020a0319167320e12a1f859b3feae5fb2a0a32c18f5a65555bbf1790556001620006ba565b6000620006807351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa640100000000620002f1810204565b1115620006b6575060008054600160a060020a0319167351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa1790556001620006ba565b5060005b90565b8051620006d2906002906020840190620006d6565b5050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200071957805160ff191683800117855562000749565b8280016001018555821562000749579182015b82811115620007495782518255916020019190600101906200072c565b50620007579291506200075b565b5090565b620006ba91905b8082111562000757576000815560010162000762565b61312680620007886000396000f3006080604052600436106101f45763ffffffff60e060020a600035041662ecd31181146101f657806302ca59941461023757806316a540851461025b5780631792cc6114610273578063236f86a11461029a57806324600fc3146102bb57806327dc297e146102d0578063282651fe1461032e578063339ac1741461034357806338bbfa501461034b5780633f4ba83a146103e757806358aaf48a146103fc578063590e1ae3146104115780635b5e760c146104265780635c975abb1461043e57806362eb6da11461046757806365e807ab1461047c578063715018a614610494578063778317c4146104a95780637ea5d50e146104c45780638456cb59146104d957806389ed0b30146104ee5780638a25aefa1461050c5780638d8f2adb146105215780638da5cb5b146105365780639429d2d914610567578063963d62fb146105885780639d76ea581461059d578063a4009e23146105b2578063aa3dacac146105c7578063b1648152146105dc578063b2f3319e146105f7578063b45cff5f14610611578063b46631cd14610626578063bf1fe42014610641578063c6e2a07114610659578063d02cc69f146106b3578063df065d78146106be578063e3206975146106d3578063e4db0c5e146106e8578063f2fde38b14610709578063f91a545b1461072a578063fc0808e51461073f575b005b34801561020257600080fd5b50610217600160a060020a0360043516610754565b604080519315158452602084019290925282820152519081900360600190f35b34801561024357600080fd5b506101f4600160a060020a0360043516602435610779565b34801561026757600080fd5b506101f46004356107e3565b34801561027f57600080fd5b5061028861081c565b60408051918252519081900360200190f35b3480156102a657600080fd5b50610288600160a060020a0360043516610822565b3480156102c757600080fd5b506101f46108d2565b3480156102dc57600080fd5b5060408051602060046024803582810135601f81018590048502860185019096528585526101f49583359536956044949193909101919081908401838280828437509497506109199650505050505050565b34801561033a57600080fd5b50610288610c7e565b6101f4610c9c565b34801561035757600080fd5b5060408051602060046024803582810135601f81018590048502860185019096528585526101f495833595369560449491939091019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a999881019791965091820194509250829150840183828082843750949750610e049650505050505050565b3480156103f357600080fd5b506101f4610e09565b34801561040857600080fd5b50610288610e81565b34801561041d57600080fd5b50610288610e87565b34801561043257600080fd5b50610288600435610f97565b34801561044a57600080fd5b50610453610fa6565b604080519115158252519081900360200190f35b34801561047357600080fd5b50610453610fb6565b34801561048857600080fd5b50610288600435610fc6565b3480156104a057600080fd5b506101f4610fd5565b3480156104b557600080fd5b506101f4600435602435611036565b3480156104d057600080fd5b5061028861107f565b3480156104e557600080fd5b506101f4611085565b3480156104fa57600080fd5b506101f463ffffffff60043516611102565b34801561051857600080fd5b50610288611124565b34801561052d57600080fd5b506101f461112a565b34801561054257600080fd5b5061054b611270565b60408051600160a060020a039092168252519081900360200190f35b34801561057357600080fd5b50610453600160a060020a036004351661127f565b34801561059457600080fd5b50610288611294565b3480156105a957600080fd5b5061054b61129a565b3480156105be57600080fd5b506104536112a9565b3480156105d357600080fd5b506102886112b2565b3480156105e857600080fd5b506101f46004356024356112b8565b34801561060357600080fd5b506101f460043515156112e6565b34801561061d57600080fd5b50610288611310565b34801561063257600080fd5b506101f4600435602435611315565b34801561064d57600080fd5b506101f4600435611373565b34801561066557600080fd5b50610671600435611393565b60408051600160a060020a0390981688526020880196909652868601949094526060860192909252608085015260a084015260c0830152519081900360e00190f35b6101f46004356113da565b3480156106ca57600080fd5b5061028861173b565b3480156106df57600080fd5b50610288611741565b3480156106f457600080fd5b50610288600160a060020a0360043516611747565b34801561071557600080fd5b506101f4600160a060020a0360043516611759565b34801561073657600080fd5b50610288611779565b34801561074b57600080fd5b50610288611790565b60136020526000908152604090208054600182015460029092015460ff909116919083565b600554600160a060020a0316331461079057600080fd5b6006805460088054600160a060020a0395909516600160a060020a0319958616811790915560a060020a949091161774ff0000000000000000000000000000000000000000191692909217909155600755565b600554600160a060020a031633146107fa57600080fd5b6000811015801561080c575060648111155b151561081757600080fd5b600e55565b60075481565b600754600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152600160a060020a0385811660048301529151600094600a0a9392909216916370a082319160248082019260209290919082900301818887803b15801561089457600080fd5b505af11580156108a8573d6000803e3d6000fd5b505050506040513d60208110156108be57600080fd5b50518115156108c957fe5b0490505b919050565b600554600160a060020a031633146108e957600080fd5b6040513390303180156108fc02916000818181858888f19350505050158015610916573d6000803e3d6000fd5b50565b6000806000806000610929612fe0565b6000806000610936611796565b600160a060020a0316331461094a57600080fd5b60008b815260126020526040902054600160a060020a0316151561096d57600080fd5b60008b815260126020908152604080832054600160a060020a031680845260149092529091205490995060ff1615156001146109a857600080fd5b600160a060020a0389166000908152601460209081526040808320805460ff1916905560159091528120556109de8b8b8b611987565b909850965087871415610b2957600160a060020a0389166000908152601360205260409020600281015460018201549154919750955060ff1615610a7a57610a27898688611b85565b610a4a89610a456003610a3989610f97565b9063ffffffff611c1316565b611c42565b600160a060020a0389166000908152601360205260408120805460ff191681556001810182905560020155610b29565b600160a060020a03808a166000908152601360209081526040808320805460ff191660019081179091558f845260128352818420825160e08101845281549096168652908101549285019290925260028201549084015260038101546060840181905260048201546080850152600582015460a085015260069091015460c08401529195501015610b1c57610b0e8b611d29565b610b178b611dba565b610b29565b610b2989610a4587610fc6565b60008b815260126020526040902060028101546001909101549650925086881115610be357610b5783610f97565b9150610b64898488611b85565b610b6e8983611c42565b600160a060020a0389166000908152601360209081526040808320805460ff19168155600180820185905560029182018590558f855260129093529083208054600160a060020a0319168155918201839055810182905560038101829055600481018290556005810182905560060155610c71565b86881015610c7157610bf483610fc6565b9050610c008982611c42565b600160a060020a0389166000908152601360209081526040808320805460ff19168155600180820185905560029182018590558f855260129093529083208054600160a060020a03191681559182018390558101829055600381018290556004810182905560058101829055600601555b5050505050505050505050565b6000600954670de0b6b3a7640000811515610c9557fe5b0490505b90565b600554600090819060a060020a900460ff1615610cb857600080fd5b3360009081526013602052604090205460ff1615610d9f576040805160208082526013908201527f706c617965722073757272656e646572696e67000000000000000000000000008183015290517f6e4a8547a0f2d6541a77a459eff545d4777c23401787089993b1780e7ab979a09181900360600190a1336000908152601360205260409020600290810154610d549163ffffffff611e5816565b33600081815260136020526040902060010154919350909150610d78908383611b85565b336000908152601360205260408120805460ff191681556001810182905560020155610e00565b6040805160208082526014908201527f6e6f7468696e6720746f2073757272656e6465720000000000000000000000008183015290517f6e4a8547a0f2d6541a77a459eff545d4777c23401787089993b1780e7ab979a09181900360600190a15b5050565b505050565b600554600160a060020a03163314610e2057600080fd5b60055460a060020a900460ff161515610e3857600080fd5b6005805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b60115481565b6005546000908190819060a060020a900460ff1615610ea557600080fd5b50503360008181526015602090815260408083205460149092529091205460ff161515600114610ed457600080fd5b60008111610ee157600080fd5b600f54811115610ef057600080fd5b604051600160a060020a0383169082156108fc029083906000818181858888f19350505050158015610f26573d6000803e3d6000fd5b50604080518281529051600160a060020a038416917f325741c2c5ea17ea8829fb19547120786d784369cacb62dce5bad13aed3df6e5919081900360200190a2600160a060020a0382166000908152601460209081526040808320805460ff19169055601590915281205591505090565b6000600954828115156108c957fe5b60055460a060020a900460ff1681565b60065460a060020a900460ff1681565b6000600a54828115156108c957fe5b600554600160a060020a03163314610fec57600080fd5b600554604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a260058054600160a060020a0319169055565b600554600160a060020a0316331461104d57600080fd5b81670de0b6b3a764000081151561106057fe5b0460095580670de0b6b3a764000081151561107757fe5b04600a555050565b60095481565b600554600160a060020a0316331461109c57600080fd5b60055460a060020a900460ff16156110b357600080fd5b6005805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600554600160a060020a0316331461111957600080fd5b63ffffffff16601155565b600c5481565b600554600090600160a060020a0316331461114457600080fd5b600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a03909216916370a08231916024808201926020929091908290030181600087803b1580156111aa57600080fd5b505af11580156111be573d6000803e3d6000fd5b505050506040513d60208110156111d457600080fd5b5051600654604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018490529051929350600160a060020a039091169163a9059cbb916044808201926020929091908290030181600087803b15801561124657600080fd5b505af115801561125a573d6000803e3d6000fd5b505050506040513d6020811015610e0457600080fd5b600554600160a060020a031681565b60146020526000908152604090205460ff1681565b600a5481565b600854600160a060020a031681565b600b5460ff1681565b600e5481565b600554600160a060020a031633146112cf57600080fd5b8082116112db57600080fd5b601091909155600f55565b600554600160a060020a031633146112fd57600080fd5b600b805460ff1916911515919091179055565b303190565b600554600160a060020a0316331461132c57600080fd5b6101a0821115801561133f575060018210155b151561134a57600080fd5b6101a0811115801561135d575060018110155b151561136857600080fd5b600c91909155600d55565b600554600160a060020a0316331461138a57600080fd5b61091681611e6d565b6012602052600090815260409020805460018201546002830154600384015460048501546005860154600690960154600160a060020a039095169593949293919290919087565b60008060008060006113ea613027565b6113f2612fe0565b60055460a060020a900460ff161561140957600080fd5b60065460a060020a900460ff16151560011461142457600080fd5b600088101580156114375750600e548811155b151561144257600080fd5b3360009081526014602052604090205460ff161561145f57600080fd5b600f54341115801561147357506010543410155b151561147e57600080fd5b3496506114a26064611496898b63ffffffff611c1316565b9063ffffffff611e5816565b95506114b4878763ffffffff61205a16565b60408051828152602081018990528082018b905290519196507fb82d4524d34e03b0c1b0d83049ea84e18809aab1d6b3274cbb96d1617e45c3fd919081900360600190a161156f6040805190810160405280600c81526020017f576f6c6672616d416c70686100000000000000000000000000000000000000008152506040805190810160405280601a81526020017f52616e646f6d53616d706c655b52616e67655b3431365d2c325d00000000000081525060115461206c565b6040805182815290519195507f8415f67b82459151888994d7f123752ba9004f85aa373a5d717ae79a063c3faf919081900360200190a16115e76040805190810160405280600c81526020017f576f6c6672616d416c706861000000000000000000000000000000000000000081525060115461246d565b3360009081526013602052604090205490935060ff161561162a5733600090815260136020526040902060020154341461161d57fe5b851561162557fe5b611675565b60408051606081018252600080825260208083018781528385018a81523384526013909252939091208251815460ff1916901515178155925160018401555160029092019190915591505b506040805160e0810182523381526020808201858152828401888152606084018a8152608085018d8152600060a0870181815260c088018281528c8352601290975297902086518154600160a060020a031916600160a060020a039091161781559351600185015591516002840155516003830155516004820155925160058401555160069092019190915561170b348461205a565b336000908152601560209081526040808320939093556014905220805460ff191660011790555050505050505050565b600d5481565b600f5481565b60156020526000908152604090205481565b600554600160a060020a0316331461177057600080fd5b610916816126da565b6000600a54670de0b6b3a7640000811515610c9557fe5b60105481565b60008054600160a060020a031615806117c157506000546117bf90600160a060020a031661274b565b155b156117d2576117d0600061274f565b505b6000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561182457600080fd5b505af1158015611838573d6000803e3d6000fd5b505050506040513d602081101561184e57600080fd5b5051600154600160a060020a03908116911614611903576000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156118b757600080fd5b505af11580156118cb573d6000803e3d6000fd5b505050506040513d60208110156118e157600080fd5b505160018054600160a060020a031916600160a060020a039092169190911790555b600160009054906101000a9004600160a060020a0316600160a060020a031663c281d19e6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561195657600080fd5b505af115801561196a573d6000803e3d6000fd5b505050506040513d602081101561198057600080fd5b5051905090565b60008061199261304b565b61199a61304b565b6000806000806119a98a612759565b9550611a466119ec6040805190810160405280600181526020017f7d00000000000000000000000000000000000000000000000000000000000000815250612759565b611a3a611a2d6040805190810160405280600181526020017f7b00000000000000000000000000000000000000000000000000000000000000815250612759565b899063ffffffff61277f16565b9063ffffffff6127ea16565b50611a856040805190810160405280600181526020017f2c00000000000000000000000000000000000000000000000000000000000000815250612759565b9450611aa7611aa2611a9d888863ffffffff61285316565b612866565b6128b9565b9350611abf611aa2611a9d888863ffffffff61285316565b600b5490935060ff1615611ad857600c549350600d5492505b611ae1846128c6565b60008c815260126020526040902060060155611afc836128c6565b60008c815260126020908152604091829020600581018490556006015482518f815291820181905281830184905260608201889052608082018790529151919450919250600160a060020a038b16917fa3afae828658e1e58da778b78eeab7f29d71765dbd93a09381b6bcad486866e5919081900360a00190a29a909950975050505050505050565b611b95828263ffffffff61205a16565b604051909250600160a060020a0384169083156108fc029084906000818181858888f19350505050158015611bce573d6000803e3d6000fd5b50604080518381529051600160a060020a038516917f325741c2c5ea17ea8829fb19547120786d784369cacb62dce5bad13aed3df6e5919081900360200190a2505050565b6000821515611c2457506000611c3c565b50818102818382811515611c3457fe5b0414611c3c57fe5b92915050565b600654600754604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038681166004830152600a9390930a850260248201529051919092169163a9059cbb9160448083019260209291908290030181600087803b158015611cba57600080fd5b505af1158015611cce573d6000803e3d6000fd5b505050506040513d6020811015611ce457600080fd5b5050604080518281529051600160a060020a038416917f636445730b1bbf400b84597c178e4bd11b72e774f51f9f3c524e51ad8f88a2aa919081900360200190a25050565b611d31612fe0565b506000818152601260209081526040808320815160e0810183528154600160a060020a0316815260018201549381019390935260028101549183019190915260038101546060830181905260048201546080840152600582015460a084015260069091015460c083015290911015610e0057610e00816000015182606001518360200151611b85565b611dc2612fe0565b506000818152601260209081526040808320815160e0810183528154600160a060020a0316815260018201549381019390935260028101549183019190915260038101546060830181905260048201546080840152600582015460a084015260069091015460c0830152909190811015610e0457611e48600a610a398460600151610f97565b9050610e04826000015182611c42565b60008183811515611e6557fe5b049392505050565b600054600160a060020a03161580611e975750600054611e9590600160a060020a031661274b565b155b15611ea857611ea6600061274f565b505b6000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015611efa57600080fd5b505af1158015611f0e573d6000803e3d6000fd5b505050506040513d6020811015611f2457600080fd5b5051600154600160a060020a03908116911614611fd9576000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015611f8d57600080fd5b505af1158015611fa1573d6000803e3d6000fd5b505050506040513d6020811015611fb757600080fd5b505160018054600160a060020a031916600160a060020a039092169190911790555b600154604080517fca6ad1e4000000000000000000000000000000000000000000000000000000008152600481018490529051600160a060020a039092169163ca6ad1e49160248082019260009290919082900301818387803b15801561203f57600080fd5b505af1158015612053573d6000803e3d6000fd5b5050505050565b60008282111561206657fe5b50900390565b600080548190600160a060020a03161580612099575060005461209790600160a060020a031661274b565b155b156120aa576120a8600061274f565b505b6000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156120fc57600080fd5b505af1158015612110573d6000803e3d6000fd5b505050506040513d602081101561212657600080fd5b5051600154600160a060020a039081169116146121db576000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561218f57600080fd5b505af11580156121a3573d6000803e3d6000fd5b505050506040513d60208110156121b957600080fd5b505160018054600160a060020a031916600160a060020a039092169190911790555b600154604080517f2ef3accc0000000000000000000000000000000000000000000000000000000081526024810186905260048101918252875160448201528751600160a060020a0390931692632ef3accc9289928892829160640190602086019080838360005b8381101561225b578181015183820152602001612243565b50505050905090810190601f1680156122885780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b1580156122a857600080fd5b505af11580156122bc573d6000803e3d6000fd5b505050506040513d60208110156122d257600080fd5b50519050670de0b6b3a76400003a8402018111156122f35760009150612465565b6001546040517fc51be90f00000000000000000000000000000000000000000000000000000000815260006004820181815260648301879052608060248401908152895160848501528951600160a060020a039095169463c51be90f948794938c938c938c93604481019160a49091019060208801908083838c5b8381101561238657818101518382015260200161236e565b50505050905090810190601f1680156123b35780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156123e65781810151838201526020016123ce565b50505050905090810190601f1680156124135780820380516001836020036101000a031916815260200191505b5096505050505050506020604051808303818588803b15801561243557600080fd5b505af1158015612449573d6000803e3d6000fd5b50505050506040513d602081101561246057600080fd5b505191505b509392505050565b60008054600160a060020a03161580612498575060005461249690600160a060020a031661274b565b155b156124a9576124a7600061274f565b505b6000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156124fb57600080fd5b505af115801561250f573d6000803e3d6000fd5b505050506040513d602081101561252557600080fd5b5051600154600160a060020a039081169116146125da576000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561258e57600080fd5b505af11580156125a2573d6000803e3d6000fd5b505050506040513d60208110156125b857600080fd5b505160018054600160a060020a031916600160a060020a039092169190911790555b600154604080517f2ef3accc0000000000000000000000000000000000000000000000000000000081526024810185905260048101918252855160448201528551600160a060020a0390931692632ef3accc9287928792829160640190602086019080838360005b8381101561265a578181015183820152602001612642565b50505050905090810190601f1680156126875780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b1580156126a757600080fd5b505af11580156126bb573d6000803e3d6000fd5b505050506040513d60208110156126d157600080fd5b50519392505050565b600160a060020a03811615156126ef57600080fd5b600554604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a360058054600160a060020a031916600160a060020a0392909216919091179055565b3b90565b6000611c3c612969565b61276161304b565b50604080518082019091528151815260209182019181019190915290565b61278761304b565b81518351600091111561279c578391506127e3565b5060208083015190840151600191146127c45750815160208481015190840151829020919020145b80156127df5782518451038452825160208501805190910190525b8391505b5092915050565b6127f261304b565b81518351600091829110156128095784925061284b565b50508151835160208086015190850151910191909103906001908214612839575082516020840151819020908220145b801561284757835185510385525b8492505b505092915050565b61285b61304b565b6127e3838383612c91565b606080600083600001516040519080825280601f01601f19166020018201604052801561289d578160200160208202803883390190505b5091506020820190506127e38185602001518660000151612d02565b6000611c3c826000612d46565b60006101a08211806128d85750600182105b156128e5575060006108cd565b6034820691508115156128fa5750600d6108cd565b6004821161290a5750600e6108cd565b600060048306111561293f57612938600161292c84600463ffffffff611e5816565b9063ffffffff612f0016565b9150612953565b61295082600463ffffffff611e5816565b91505b816001146129615781611c3c565b50600e919050565b600080612989731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed61274b565b11156129fa5760008054600160a060020a031916731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed17905560408051808201909152600b81527f6574685f6d61696e6e657400000000000000000000000000000000000000000060208201526129f290612f0d565b506001610c99565b6000612a1973c03a2615d5efaf5f49f60b7bb6583eaec212fdf161274b565b1115612a825760008054600160a060020a03191673c03a2615d5efaf5f49f60b7bb6583eaec212fdf117905560408051808201909152600c81527f6574685f726f707374656e33000000000000000000000000000000000000000060208201526129f290612f0d565b6000612aa173b7a07bcf2ba2f2703b24c0691b5278999c59ac7e61274b565b1115612b0a5760008054600160a060020a03191673b7a07bcf2ba2f2703b24c0691b5278999c59ac7e17905560408051808201909152600981527f6574685f6b6f76616e000000000000000000000000000000000000000000000060208201526129f290612f0d565b6000612b2973146500cfd35b22e4a392fe0adc06de1a1368ed4861274b565b1115612b925760008054600160a060020a03191673146500cfd35b22e4a392fe0adc06de1a1368ed4817905560408051808201909152600b81527f6574685f72696e6b65627900000000000000000000000000000000000000000060208201526129f290612f0d565b6000612bb1736f485c8bf6fc43ea212e93bbf8ce046c7f1cb47561274b565b1115612be5575060008054600160a060020a031916736f485c8bf6fc43ea212e93bbf8ce046c7f1cb4751790556001610c99565b6000612c047320e12a1f859b3feae5fb2a0a32c18f5a65555bbf61274b565b1115612c38575060008054600160a060020a0319167320e12a1f859b3feae5fb2a0a32c18f5a65555bbf1790556001610c99565b6000612c577351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa61274b565b1115612c8b575060008054600160a060020a0319167351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa1790556001610c99565b50600090565b612c9961304b565b6000612cb78560000151866020015186600001518760200151612f20565b60208087018051918601919091528051820385528651905191925001811415612ce35760008552612cf9565b8351835186519101900385528351810160208601525b50909392505050565b60005b60208210612d27578251845260209384019390920191601f1990910190612d05565b50905182516020929092036101000a6000190180199091169116179052565b6000828180805b8351811015612ee35783517f300000000000000000000000000000000000000000000000000000000000000090859083908110612d8657fe5b90602001015160f860020a900460f860020a027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191610158015612e2c575083517f390000000000000000000000000000000000000000000000000000000000000090859083908110612df457fe5b90602001015160f860020a900460f860020a027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191611155b15612e85578115612e4b57851515612e4357612ee3565b600019909501945b600a8302925060308482815181101515612e6157fe5b90602001015160f860020a900460f860020a0260f860020a90040383019250612edb565b8381815181101515612e9357fe5b90602001015160f860020a900460f860020a027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916602e60f860020a021415612edb57600191505b600101612d4d565b6000861115612ef55785600a0a830292505b509095945050505050565b81810182811015611c3c57fe5b8051610e00906002906020840190613062565b600083818080808080808c8b11612fca5760208b11612f935760018b60200360080260020a03196001029550858a511694508a8d8d010393508588511692505b828514612f8b57838810612f78578c8c019850612fd0565b8780600101985050858851169250612f60565b879850612fd0565b8a8a209150600096505b8a8d038711612fca575089872081811415612fba57879850612fd0565b6001978801979690960195612f9d565b8c8c0198505b5050505050505050949350505050565b60e0604051908101604052806000600160a060020a031681526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b60606040519081016040528060001515815260200160008152602001600081525090565b604080518082019091526000808252602082015290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106130a357805160ff19168380011785556130d0565b828001600101855582156130d0579182015b828111156130d05782518255916020019190600101906130b5565b506130dc9291506130e0565b5090565b610c9991905b808211156130dc57600081556001016130e65600a165627a7a72305820568d83d79f1cca9262832853ca0c1eebd639e6bbfd0fff1c9e845ca3bc82545c0029
Deployed Bytecode
0x6080604052600436106101f45763ffffffff60e060020a600035041662ecd31181146101f657806302ca59941461023757806316a540851461025b5780631792cc6114610273578063236f86a11461029a57806324600fc3146102bb57806327dc297e146102d0578063282651fe1461032e578063339ac1741461034357806338bbfa501461034b5780633f4ba83a146103e757806358aaf48a146103fc578063590e1ae3146104115780635b5e760c146104265780635c975abb1461043e57806362eb6da11461046757806365e807ab1461047c578063715018a614610494578063778317c4146104a95780637ea5d50e146104c45780638456cb59146104d957806389ed0b30146104ee5780638a25aefa1461050c5780638d8f2adb146105215780638da5cb5b146105365780639429d2d914610567578063963d62fb146105885780639d76ea581461059d578063a4009e23146105b2578063aa3dacac146105c7578063b1648152146105dc578063b2f3319e146105f7578063b45cff5f14610611578063b46631cd14610626578063bf1fe42014610641578063c6e2a07114610659578063d02cc69f146106b3578063df065d78146106be578063e3206975146106d3578063e4db0c5e146106e8578063f2fde38b14610709578063f91a545b1461072a578063fc0808e51461073f575b005b34801561020257600080fd5b50610217600160a060020a0360043516610754565b604080519315158452602084019290925282820152519081900360600190f35b34801561024357600080fd5b506101f4600160a060020a0360043516602435610779565b34801561026757600080fd5b506101f46004356107e3565b34801561027f57600080fd5b5061028861081c565b60408051918252519081900360200190f35b3480156102a657600080fd5b50610288600160a060020a0360043516610822565b3480156102c757600080fd5b506101f46108d2565b3480156102dc57600080fd5b5060408051602060046024803582810135601f81018590048502860185019096528585526101f49583359536956044949193909101919081908401838280828437509497506109199650505050505050565b34801561033a57600080fd5b50610288610c7e565b6101f4610c9c565b34801561035757600080fd5b5060408051602060046024803582810135601f81018590048502860185019096528585526101f495833595369560449491939091019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a999881019791965091820194509250829150840183828082843750949750610e049650505050505050565b3480156103f357600080fd5b506101f4610e09565b34801561040857600080fd5b50610288610e81565b34801561041d57600080fd5b50610288610e87565b34801561043257600080fd5b50610288600435610f97565b34801561044a57600080fd5b50610453610fa6565b604080519115158252519081900360200190f35b34801561047357600080fd5b50610453610fb6565b34801561048857600080fd5b50610288600435610fc6565b3480156104a057600080fd5b506101f4610fd5565b3480156104b557600080fd5b506101f4600435602435611036565b3480156104d057600080fd5b5061028861107f565b3480156104e557600080fd5b506101f4611085565b3480156104fa57600080fd5b506101f463ffffffff60043516611102565b34801561051857600080fd5b50610288611124565b34801561052d57600080fd5b506101f461112a565b34801561054257600080fd5b5061054b611270565b60408051600160a060020a039092168252519081900360200190f35b34801561057357600080fd5b50610453600160a060020a036004351661127f565b34801561059457600080fd5b50610288611294565b3480156105a957600080fd5b5061054b61129a565b3480156105be57600080fd5b506104536112a9565b3480156105d357600080fd5b506102886112b2565b3480156105e857600080fd5b506101f46004356024356112b8565b34801561060357600080fd5b506101f460043515156112e6565b34801561061d57600080fd5b50610288611310565b34801561063257600080fd5b506101f4600435602435611315565b34801561064d57600080fd5b506101f4600435611373565b34801561066557600080fd5b50610671600435611393565b60408051600160a060020a0390981688526020880196909652868601949094526060860192909252608085015260a084015260c0830152519081900360e00190f35b6101f46004356113da565b3480156106ca57600080fd5b5061028861173b565b3480156106df57600080fd5b50610288611741565b3480156106f457600080fd5b50610288600160a060020a0360043516611747565b34801561071557600080fd5b506101f4600160a060020a0360043516611759565b34801561073657600080fd5b50610288611779565b34801561074b57600080fd5b50610288611790565b60136020526000908152604090208054600182015460029092015460ff909116919083565b600554600160a060020a0316331461079057600080fd5b6006805460088054600160a060020a0395909516600160a060020a0319958616811790915560a060020a949091161774ff0000000000000000000000000000000000000000191692909217909155600755565b600554600160a060020a031633146107fa57600080fd5b6000811015801561080c575060648111155b151561081757600080fd5b600e55565b60075481565b600754600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152600160a060020a0385811660048301529151600094600a0a9392909216916370a082319160248082019260209290919082900301818887803b15801561089457600080fd5b505af11580156108a8573d6000803e3d6000fd5b505050506040513d60208110156108be57600080fd5b50518115156108c957fe5b0490505b919050565b600554600160a060020a031633146108e957600080fd5b6040513390303180156108fc02916000818181858888f19350505050158015610916573d6000803e3d6000fd5b50565b6000806000806000610929612fe0565b6000806000610936611796565b600160a060020a0316331461094a57600080fd5b60008b815260126020526040902054600160a060020a0316151561096d57600080fd5b60008b815260126020908152604080832054600160a060020a031680845260149092529091205490995060ff1615156001146109a857600080fd5b600160a060020a0389166000908152601460209081526040808320805460ff1916905560159091528120556109de8b8b8b611987565b909850965087871415610b2957600160a060020a0389166000908152601360205260409020600281015460018201549154919750955060ff1615610a7a57610a27898688611b85565b610a4a89610a456003610a3989610f97565b9063ffffffff611c1316565b611c42565b600160a060020a0389166000908152601360205260408120805460ff191681556001810182905560020155610b29565b600160a060020a03808a166000908152601360209081526040808320805460ff191660019081179091558f845260128352818420825160e08101845281549096168652908101549285019290925260028201549084015260038101546060840181905260048201546080850152600582015460a085015260069091015460c08401529195501015610b1c57610b0e8b611d29565b610b178b611dba565b610b29565b610b2989610a4587610fc6565b60008b815260126020526040902060028101546001909101549650925086881115610be357610b5783610f97565b9150610b64898488611b85565b610b6e8983611c42565b600160a060020a0389166000908152601360209081526040808320805460ff19168155600180820185905560029182018590558f855260129093529083208054600160a060020a0319168155918201839055810182905560038101829055600481018290556005810182905560060155610c71565b86881015610c7157610bf483610fc6565b9050610c008982611c42565b600160a060020a0389166000908152601360209081526040808320805460ff19168155600180820185905560029182018590558f855260129093529083208054600160a060020a03191681559182018390558101829055600381018290556004810182905560058101829055600601555b5050505050505050505050565b6000600954670de0b6b3a7640000811515610c9557fe5b0490505b90565b600554600090819060a060020a900460ff1615610cb857600080fd5b3360009081526013602052604090205460ff1615610d9f576040805160208082526013908201527f706c617965722073757272656e646572696e67000000000000000000000000008183015290517f6e4a8547a0f2d6541a77a459eff545d4777c23401787089993b1780e7ab979a09181900360600190a1336000908152601360205260409020600290810154610d549163ffffffff611e5816565b33600081815260136020526040902060010154919350909150610d78908383611b85565b336000908152601360205260408120805460ff191681556001810182905560020155610e00565b6040805160208082526014908201527f6e6f7468696e6720746f2073757272656e6465720000000000000000000000008183015290517f6e4a8547a0f2d6541a77a459eff545d4777c23401787089993b1780e7ab979a09181900360600190a15b5050565b505050565b600554600160a060020a03163314610e2057600080fd5b60055460a060020a900460ff161515610e3857600080fd5b6005805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b60115481565b6005546000908190819060a060020a900460ff1615610ea557600080fd5b50503360008181526015602090815260408083205460149092529091205460ff161515600114610ed457600080fd5b60008111610ee157600080fd5b600f54811115610ef057600080fd5b604051600160a060020a0383169082156108fc029083906000818181858888f19350505050158015610f26573d6000803e3d6000fd5b50604080518281529051600160a060020a038416917f325741c2c5ea17ea8829fb19547120786d784369cacb62dce5bad13aed3df6e5919081900360200190a2600160a060020a0382166000908152601460209081526040808320805460ff19169055601590915281205591505090565b6000600954828115156108c957fe5b60055460a060020a900460ff1681565b60065460a060020a900460ff1681565b6000600a54828115156108c957fe5b600554600160a060020a03163314610fec57600080fd5b600554604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a260058054600160a060020a0319169055565b600554600160a060020a0316331461104d57600080fd5b81670de0b6b3a764000081151561106057fe5b0460095580670de0b6b3a764000081151561107757fe5b04600a555050565b60095481565b600554600160a060020a0316331461109c57600080fd5b60055460a060020a900460ff16156110b357600080fd5b6005805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600554600160a060020a0316331461111957600080fd5b63ffffffff16601155565b600c5481565b600554600090600160a060020a0316331461114457600080fd5b600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a03909216916370a08231916024808201926020929091908290030181600087803b1580156111aa57600080fd5b505af11580156111be573d6000803e3d6000fd5b505050506040513d60208110156111d457600080fd5b5051600654604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018490529051929350600160a060020a039091169163a9059cbb916044808201926020929091908290030181600087803b15801561124657600080fd5b505af115801561125a573d6000803e3d6000fd5b505050506040513d6020811015610e0457600080fd5b600554600160a060020a031681565b60146020526000908152604090205460ff1681565b600a5481565b600854600160a060020a031681565b600b5460ff1681565b600e5481565b600554600160a060020a031633146112cf57600080fd5b8082116112db57600080fd5b601091909155600f55565b600554600160a060020a031633146112fd57600080fd5b600b805460ff1916911515919091179055565b303190565b600554600160a060020a0316331461132c57600080fd5b6101a0821115801561133f575060018210155b151561134a57600080fd5b6101a0811115801561135d575060018110155b151561136857600080fd5b600c91909155600d55565b600554600160a060020a0316331461138a57600080fd5b61091681611e6d565b6012602052600090815260409020805460018201546002830154600384015460048501546005860154600690960154600160a060020a039095169593949293919290919087565b60008060008060006113ea613027565b6113f2612fe0565b60055460a060020a900460ff161561140957600080fd5b60065460a060020a900460ff16151560011461142457600080fd5b600088101580156114375750600e548811155b151561144257600080fd5b3360009081526014602052604090205460ff161561145f57600080fd5b600f54341115801561147357506010543410155b151561147e57600080fd5b3496506114a26064611496898b63ffffffff611c1316565b9063ffffffff611e5816565b95506114b4878763ffffffff61205a16565b60408051828152602081018990528082018b905290519196507fb82d4524d34e03b0c1b0d83049ea84e18809aab1d6b3274cbb96d1617e45c3fd919081900360600190a161156f6040805190810160405280600c81526020017f576f6c6672616d416c70686100000000000000000000000000000000000000008152506040805190810160405280601a81526020017f52616e646f6d53616d706c655b52616e67655b3431365d2c325d00000000000081525060115461206c565b6040805182815290519195507f8415f67b82459151888994d7f123752ba9004f85aa373a5d717ae79a063c3faf919081900360200190a16115e76040805190810160405280600c81526020017f576f6c6672616d416c706861000000000000000000000000000000000000000081525060115461246d565b3360009081526013602052604090205490935060ff161561162a5733600090815260136020526040902060020154341461161d57fe5b851561162557fe5b611675565b60408051606081018252600080825260208083018781528385018a81523384526013909252939091208251815460ff1916901515178155925160018401555160029092019190915591505b506040805160e0810182523381526020808201858152828401888152606084018a8152608085018d8152600060a0870181815260c088018281528c8352601290975297902086518154600160a060020a031916600160a060020a039091161781559351600185015591516002840155516003830155516004820155925160058401555160069092019190915561170b348461205a565b336000908152601560209081526040808320939093556014905220805460ff191660011790555050505050505050565b600d5481565b600f5481565b60156020526000908152604090205481565b600554600160a060020a0316331461177057600080fd5b610916816126da565b6000600a54670de0b6b3a7640000811515610c9557fe5b60105481565b60008054600160a060020a031615806117c157506000546117bf90600160a060020a031661274b565b155b156117d2576117d0600061274f565b505b6000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561182457600080fd5b505af1158015611838573d6000803e3d6000fd5b505050506040513d602081101561184e57600080fd5b5051600154600160a060020a03908116911614611903576000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156118b757600080fd5b505af11580156118cb573d6000803e3d6000fd5b505050506040513d60208110156118e157600080fd5b505160018054600160a060020a031916600160a060020a039092169190911790555b600160009054906101000a9004600160a060020a0316600160a060020a031663c281d19e6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561195657600080fd5b505af115801561196a573d6000803e3d6000fd5b505050506040513d602081101561198057600080fd5b5051905090565b60008061199261304b565b61199a61304b565b6000806000806119a98a612759565b9550611a466119ec6040805190810160405280600181526020017f7d00000000000000000000000000000000000000000000000000000000000000815250612759565b611a3a611a2d6040805190810160405280600181526020017f7b00000000000000000000000000000000000000000000000000000000000000815250612759565b899063ffffffff61277f16565b9063ffffffff6127ea16565b50611a856040805190810160405280600181526020017f2c00000000000000000000000000000000000000000000000000000000000000815250612759565b9450611aa7611aa2611a9d888863ffffffff61285316565b612866565b6128b9565b9350611abf611aa2611a9d888863ffffffff61285316565b600b5490935060ff1615611ad857600c549350600d5492505b611ae1846128c6565b60008c815260126020526040902060060155611afc836128c6565b60008c815260126020908152604091829020600581018490556006015482518f815291820181905281830184905260608201889052608082018790529151919450919250600160a060020a038b16917fa3afae828658e1e58da778b78eeab7f29d71765dbd93a09381b6bcad486866e5919081900360a00190a29a909950975050505050505050565b611b95828263ffffffff61205a16565b604051909250600160a060020a0384169083156108fc029084906000818181858888f19350505050158015611bce573d6000803e3d6000fd5b50604080518381529051600160a060020a038516917f325741c2c5ea17ea8829fb19547120786d784369cacb62dce5bad13aed3df6e5919081900360200190a2505050565b6000821515611c2457506000611c3c565b50818102818382811515611c3457fe5b0414611c3c57fe5b92915050565b600654600754604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038681166004830152600a9390930a850260248201529051919092169163a9059cbb9160448083019260209291908290030181600087803b158015611cba57600080fd5b505af1158015611cce573d6000803e3d6000fd5b505050506040513d6020811015611ce457600080fd5b5050604080518281529051600160a060020a038416917f636445730b1bbf400b84597c178e4bd11b72e774f51f9f3c524e51ad8f88a2aa919081900360200190a25050565b611d31612fe0565b506000818152601260209081526040808320815160e0810183528154600160a060020a0316815260018201549381019390935260028101549183019190915260038101546060830181905260048201546080840152600582015460a084015260069091015460c083015290911015610e0057610e00816000015182606001518360200151611b85565b611dc2612fe0565b506000818152601260209081526040808320815160e0810183528154600160a060020a0316815260018201549381019390935260028101549183019190915260038101546060830181905260048201546080840152600582015460a084015260069091015460c0830152909190811015610e0457611e48600a610a398460600151610f97565b9050610e04826000015182611c42565b60008183811515611e6557fe5b049392505050565b600054600160a060020a03161580611e975750600054611e9590600160a060020a031661274b565b155b15611ea857611ea6600061274f565b505b6000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015611efa57600080fd5b505af1158015611f0e573d6000803e3d6000fd5b505050506040513d6020811015611f2457600080fd5b5051600154600160a060020a03908116911614611fd9576000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015611f8d57600080fd5b505af1158015611fa1573d6000803e3d6000fd5b505050506040513d6020811015611fb757600080fd5b505160018054600160a060020a031916600160a060020a039092169190911790555b600154604080517fca6ad1e4000000000000000000000000000000000000000000000000000000008152600481018490529051600160a060020a039092169163ca6ad1e49160248082019260009290919082900301818387803b15801561203f57600080fd5b505af1158015612053573d6000803e3d6000fd5b5050505050565b60008282111561206657fe5b50900390565b600080548190600160a060020a03161580612099575060005461209790600160a060020a031661274b565b155b156120aa576120a8600061274f565b505b6000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156120fc57600080fd5b505af1158015612110573d6000803e3d6000fd5b505050506040513d602081101561212657600080fd5b5051600154600160a060020a039081169116146121db576000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561218f57600080fd5b505af11580156121a3573d6000803e3d6000fd5b505050506040513d60208110156121b957600080fd5b505160018054600160a060020a031916600160a060020a039092169190911790555b600154604080517f2ef3accc0000000000000000000000000000000000000000000000000000000081526024810186905260048101918252875160448201528751600160a060020a0390931692632ef3accc9289928892829160640190602086019080838360005b8381101561225b578181015183820152602001612243565b50505050905090810190601f1680156122885780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b1580156122a857600080fd5b505af11580156122bc573d6000803e3d6000fd5b505050506040513d60208110156122d257600080fd5b50519050670de0b6b3a76400003a8402018111156122f35760009150612465565b6001546040517fc51be90f00000000000000000000000000000000000000000000000000000000815260006004820181815260648301879052608060248401908152895160848501528951600160a060020a039095169463c51be90f948794938c938c938c93604481019160a49091019060208801908083838c5b8381101561238657818101518382015260200161236e565b50505050905090810190601f1680156123b35780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156123e65781810151838201526020016123ce565b50505050905090810190601f1680156124135780820380516001836020036101000a031916815260200191505b5096505050505050506020604051808303818588803b15801561243557600080fd5b505af1158015612449573d6000803e3d6000fd5b50505050506040513d602081101561246057600080fd5b505191505b509392505050565b60008054600160a060020a03161580612498575060005461249690600160a060020a031661274b565b155b156124a9576124a7600061274f565b505b6000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156124fb57600080fd5b505af115801561250f573d6000803e3d6000fd5b505050506040513d602081101561252557600080fd5b5051600154600160a060020a039081169116146125da576000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561258e57600080fd5b505af11580156125a2573d6000803e3d6000fd5b505050506040513d60208110156125b857600080fd5b505160018054600160a060020a031916600160a060020a039092169190911790555b600154604080517f2ef3accc0000000000000000000000000000000000000000000000000000000081526024810185905260048101918252855160448201528551600160a060020a0390931692632ef3accc9287928792829160640190602086019080838360005b8381101561265a578181015183820152602001612642565b50505050905090810190601f1680156126875780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b1580156126a757600080fd5b505af11580156126bb573d6000803e3d6000fd5b505050506040513d60208110156126d157600080fd5b50519392505050565b600160a060020a03811615156126ef57600080fd5b600554604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a360058054600160a060020a031916600160a060020a0392909216919091179055565b3b90565b6000611c3c612969565b61276161304b565b50604080518082019091528151815260209182019181019190915290565b61278761304b565b81518351600091111561279c578391506127e3565b5060208083015190840151600191146127c45750815160208481015190840151829020919020145b80156127df5782518451038452825160208501805190910190525b8391505b5092915050565b6127f261304b565b81518351600091829110156128095784925061284b565b50508151835160208086015190850151910191909103906001908214612839575082516020840151819020908220145b801561284757835185510385525b8492505b505092915050565b61285b61304b565b6127e3838383612c91565b606080600083600001516040519080825280601f01601f19166020018201604052801561289d578160200160208202803883390190505b5091506020820190506127e38185602001518660000151612d02565b6000611c3c826000612d46565b60006101a08211806128d85750600182105b156128e5575060006108cd565b6034820691508115156128fa5750600d6108cd565b6004821161290a5750600e6108cd565b600060048306111561293f57612938600161292c84600463ffffffff611e5816565b9063ffffffff612f0016565b9150612953565b61295082600463ffffffff611e5816565b91505b816001146129615781611c3c565b50600e919050565b600080612989731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed61274b565b11156129fa5760008054600160a060020a031916731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed17905560408051808201909152600b81527f6574685f6d61696e6e657400000000000000000000000000000000000000000060208201526129f290612f0d565b506001610c99565b6000612a1973c03a2615d5efaf5f49f60b7bb6583eaec212fdf161274b565b1115612a825760008054600160a060020a03191673c03a2615d5efaf5f49f60b7bb6583eaec212fdf117905560408051808201909152600c81527f6574685f726f707374656e33000000000000000000000000000000000000000060208201526129f290612f0d565b6000612aa173b7a07bcf2ba2f2703b24c0691b5278999c59ac7e61274b565b1115612b0a5760008054600160a060020a03191673b7a07bcf2ba2f2703b24c0691b5278999c59ac7e17905560408051808201909152600981527f6574685f6b6f76616e000000000000000000000000000000000000000000000060208201526129f290612f0d565b6000612b2973146500cfd35b22e4a392fe0adc06de1a1368ed4861274b565b1115612b925760008054600160a060020a03191673146500cfd35b22e4a392fe0adc06de1a1368ed4817905560408051808201909152600b81527f6574685f72696e6b65627900000000000000000000000000000000000000000060208201526129f290612f0d565b6000612bb1736f485c8bf6fc43ea212e93bbf8ce046c7f1cb47561274b565b1115612be5575060008054600160a060020a031916736f485c8bf6fc43ea212e93bbf8ce046c7f1cb4751790556001610c99565b6000612c047320e12a1f859b3feae5fb2a0a32c18f5a65555bbf61274b565b1115612c38575060008054600160a060020a0319167320e12a1f859b3feae5fb2a0a32c18f5a65555bbf1790556001610c99565b6000612c577351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa61274b565b1115612c8b575060008054600160a060020a0319167351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa1790556001610c99565b50600090565b612c9961304b565b6000612cb78560000151866020015186600001518760200151612f20565b60208087018051918601919091528051820385528651905191925001811415612ce35760008552612cf9565b8351835186519101900385528351810160208601525b50909392505050565b60005b60208210612d27578251845260209384019390920191601f1990910190612d05565b50905182516020929092036101000a6000190180199091169116179052565b6000828180805b8351811015612ee35783517f300000000000000000000000000000000000000000000000000000000000000090859083908110612d8657fe5b90602001015160f860020a900460f860020a027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191610158015612e2c575083517f390000000000000000000000000000000000000000000000000000000000000090859083908110612df457fe5b90602001015160f860020a900460f860020a027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191611155b15612e85578115612e4b57851515612e4357612ee3565b600019909501945b600a8302925060308482815181101515612e6157fe5b90602001015160f860020a900460f860020a0260f860020a90040383019250612edb565b8381815181101515612e9357fe5b90602001015160f860020a900460f860020a027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916602e60f860020a021415612edb57600191505b600101612d4d565b6000861115612ef55785600a0a830292505b509095945050505050565b81810182811015611c3c57fe5b8051610e00906002906020840190613062565b600083818080808080808c8b11612fca5760208b11612f935760018b60200360080260020a03196001029550858a511694508a8d8d010393508588511692505b828514612f8b57838810612f78578c8c019850612fd0565b8780600101985050858851169250612f60565b879850612fd0565b8a8a209150600096505b8a8d038711612fca575089872081811415612fba57879850612fd0565b6001978801979690960195612f9d565b8c8c0198505b5050505050505050949350505050565b60e0604051908101604052806000600160a060020a031681526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b60606040519081016040528060001515815260200160008152602001600081525090565b604080518082019091526000808252602082015290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106130a357805160ff19168380011785556130d0565b828001600101855582156130d0579182015b828111156130d05782518255916020019190600101906130b5565b506130dc9291506130e0565b5090565b610c9991905b808211156130dc57600081556001016130e65600a165627a7a72305820568d83d79f1cca9262832853ca0c1eebd639e6bbfd0fff1c9e845ca3bc82545c0029
Swarm Source
bzzr://568d83d79f1cca9262832853ca0c1eebd639e6bbfd0fff1c9e845ca3bc82545c
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
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.