dc-protocol
Version:
Start ganache and deploy our contracts
954 lines • 106 kB
JSON
{
"contractName": "GameObject",
"abi": [
{
"constant": true,
"inputs": [
{
"components": [
{
"name": "playerNumber",
"type": "uint256"
},
{
"name": "randomRanges",
"type": "uint256[2][]"
},
{
"name": "seed",
"type": "bytes32"
}
],
"name": "_gameData",
"type": "tuple"
}
],
"name": "hashGameData",
"outputs": [
{
"name": "",
"type": "bytes32"
}
],
"payable": false,
"stateMutability": "pure",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"components": [
{
"name": "playerNumber",
"type": "uint256"
},
{
"name": "randomRanges",
"type": "uint256[2][]"
},
{
"name": "seed",
"type": "bytes32"
}
],
"name": "_gameData",
"type": "tuple"
},
{
"name": "_bets",
"type": "uint256[]"
}
],
"name": "checkGameData",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "pure",
"type": "function"
}
],
"bytecode": "0x608060405234801561001057600080fd5b50610557806100206000396000f30060806040526004361061004b5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416638be2c0c38114610050578063e635844714610086575b600080fd5b34801561005c57600080fd5b5061007061006b3660046103d5565b6100b3565b60405161007d91906104a1565b60405180910390f35b34801561009257600080fd5b506100a66100a1366004610412565b610196565b60405161007d9190610493565b6000816000015182602001518360400151604051602001808481526020018380516000925b8184101561011a57602080850284010151604080838360005b838110156101095781810151838201526020016100f1565b5050505090500192600101926100d8565b9485525050604080518085038152602094850191829052805190965090945084938601925090508083835b602083106101645780518252601f199092019160209182019101610145565b5181516020939093036101000a6000190180199091169216919091179052604051920182900390912095945050505050565b600060018360200151511415806101ae575082516000115b806101bb5750825161ffff105b806101e6575068056bc75e2d631000008260008151811015156101da57fe5b90602001906020020151115b156101f3575060006101f7565b5060015b92915050565b6000601f8201831361020e57600080fd5b813561022161021c826104d6565b6104af565b9150818183526020840193506020810190508385604084028201111561024657600080fd5b60005b83811015610274578161025c888261027e565b84525060209092019160409190910190600101610249565b5050505092915050565b6000601f8201831361028f57600080fd5b600261029d61021c826104f7565b915081838560208402820111156102b357600080fd5b60005b8381101561027457816102c9888261034f565b84525060209283019291909101906001016102b6565b6000601f820183136102f057600080fd5b81356102fe61021c826104d6565b9150818183526020840193506020810190508385602084028201111561032357600080fd5b60005b838110156102745781610339888261034f565b8452506020928301929190910190600101610326565b600061035b823561051a565b9392505050565b60006060828403121561037457600080fd5b61037e60606104af565b9050600061038c848461034f565b825250602082013567ffffffffffffffff8111156103a957600080fd5b6103b5848285016101fd565b60208301525060406103c98482850161034f565b60408301525092915050565b6000602082840312156103e757600080fd5b813567ffffffffffffffff8111156103fe57600080fd5b61040a84828501610362565b949350505050565b6000806040838503121561042557600080fd5b823567ffffffffffffffff81111561043c57600080fd5b61044885828601610362565b925050602083013567ffffffffffffffff81111561046557600080fd5b610471858286016102df565b9150509250929050565b61048481610515565b82525050565b6104848161051a565b602081016101f7828461047b565b602081016101f7828461048a565b60405181810167ffffffffffffffff811182821017156104ce57600080fd5b604052919050565b600067ffffffffffffffff8211156104ed57600080fd5b5060209081020190565b600067ffffffffffffffff82111561050e57600080fd5b5060200290565b151590565b905600a265627a7a72305820c3a9bb28866242b553060c6239d6065ddbb618c720e9a5d6af4a961a1759c0d46c6578706572696d656e74616cf50037",
"deployedBytecode": "0x60806040526004361061004b5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416638be2c0c38114610050578063e635844714610086575b600080fd5b34801561005c57600080fd5b5061007061006b3660046103d5565b6100b3565b60405161007d91906104a1565b60405180910390f35b34801561009257600080fd5b506100a66100a1366004610412565b610196565b60405161007d9190610493565b6000816000015182602001518360400151604051602001808481526020018380516000925b8184101561011a57602080850284010151604080838360005b838110156101095781810151838201526020016100f1565b5050505090500192600101926100d8565b9485525050604080518085038152602094850191829052805190965090945084938601925090508083835b602083106101645780518252601f199092019160209182019101610145565b5181516020939093036101000a6000190180199091169216919091179052604051920182900390912095945050505050565b600060018360200151511415806101ae575082516000115b806101bb5750825161ffff105b806101e6575068056bc75e2d631000008260008151811015156101da57fe5b90602001906020020151115b156101f3575060006101f7565b5060015b92915050565b6000601f8201831361020e57600080fd5b813561022161021c826104d6565b6104af565b9150818183526020840193506020810190508385604084028201111561024657600080fd5b60005b83811015610274578161025c888261027e565b84525060209092019160409190910190600101610249565b5050505092915050565b6000601f8201831361028f57600080fd5b600261029d61021c826104f7565b915081838560208402820111156102b357600080fd5b60005b8381101561027457816102c9888261034f565b84525060209283019291909101906001016102b6565b6000601f820183136102f057600080fd5b81356102fe61021c826104d6565b9150818183526020840193506020810190508385602084028201111561032357600080fd5b60005b838110156102745781610339888261034f565b8452506020928301929190910190600101610326565b600061035b823561051a565b9392505050565b60006060828403121561037457600080fd5b61037e60606104af565b9050600061038c848461034f565b825250602082013567ffffffffffffffff8111156103a957600080fd5b6103b5848285016101fd565b60208301525060406103c98482850161034f565b60408301525092915050565b6000602082840312156103e757600080fd5b813567ffffffffffffffff8111156103fe57600080fd5b61040a84828501610362565b949350505050565b6000806040838503121561042557600080fd5b823567ffffffffffffffff81111561043c57600080fd5b61044885828601610362565b925050602083013567ffffffffffffffff81111561046557600080fd5b610471858286016102df565b9150509250929050565b61048481610515565b82525050565b6104848161051a565b602081016101f7828461047b565b602081016101f7828461048a565b60405181810167ffffffffffffffff811182821017156104ce57600080fd5b604052919050565b600067ffffffffffffffff8211156104ed57600080fd5b5060209081020190565b600067ffffffffffffffff82111561050e57600080fd5b5060200290565b151590565b905600a265627a7a72305820c3a9bb28866242b553060c6239d6065ddbb618c720e9a5d6af4a961a1759c0d46c6578706572696d656e74616cf50037",
"sourceMap": "60:923:3:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;60:923:3;;;;;;;",
"deployedSourceMap": "60:923:3:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;327:268;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;327:268:3;;;;;;;;;;;;;;;;;;;;;;;;;601:379;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;601:379:3;;;;;;;;;;;;;;;;;327:268;389:7;491:9;:22;;;527:9;:22;;;563:9;:14;;;425:162;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;425:162:3;;;;;;;;;;;;;;;;-1:-1:-1;;425:162:3;;;26:21:-1;;;6:49;;425:162:3;;;;;;;;415:173;;425:162;;-1:-1:-1;425:162:3;;-1:-1:-1;425:162:3;;415:173;;;-1:-1:-1;415:173:3;-1:-1:-1;415:173:3;425:162;415:173;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;;254:3;250:22;-1:-1;;246:30;311:9;;295:26;;;340:21;;377:20;;;;365:33;;415:173:3;;;;;;;;;;;;-1:-1:-1;;;;;327:268:3:o;601:379::-;679:4;750:1;712:9;:22;;;:29;:40;;:88;;;-1:-1:-1;768:22:3;;798:1;-1:-1:-1;712:88:3;:149;;;-1:-1:-1;825:22:3;;855:5;-1:-1:-1;712:149:3;:189;;;;892:9;881:5;887:1;881:8;;;;;;;;;;;;;;;;;;:20;712:189;695:258;;;-1:-1:-1;937:5:3;930:12;;695:258;-1:-1:-1;969:4:3;601:379;;;;;:::o;26:756:-1:-;;151:4;139:17;;135:27;-1:-1;125:2;;176:1;173;166:12;125:2;213:6;200:20;235:95;250:79;322:6;250:79;;;235:95;;;226:104;;347:5;372:6;365:5;358:21;402:4;394:6;390:17;380:27;;424:4;419:3;415:14;408:21;;477:6;524:3;516:4;508:6;504:17;499:3;495:27;492:36;489:2;;;541:1;538;531:12;489:2;566:1;551:225;576:6;573:1;570:13;551:225;;;634:3;656:56;708:3;696:10;656:56;;;644:69;;-1:-1;736:4;727:14;;;;764:4;755:14;;;;;598:1;591:9;551:225;;;555:14;118:664;;;;;;;;809:607;;913:4;901:17;;897:27;-1:-1;887:2;;938:1;935;928:12;887:2;962:3;980:74;995:58;1046:6;995:58;;980:74;971:83;;1071:5;1130:6;1177:3;1169:4;1161:6;1157:17;1152:3;1148:27;1145:36;1142:2;;;1194:1;1191;1184:12;1142:2;1219:1;1204:206;1229:6;1226:1;1223:13;1204:206;;;1287:3;1309:37;1342:3;1330:10;1309:37;;;1297:50;;-1:-1;1370:4;1361:14;;;;1389;;;;;1251:1;1244:9;1204:206;;1442:707;;1552:4;1540:17;;1536:27;-1:-1;1526:2;;1577:1;1574;1567:12;1526:2;1614:6;1601:20;1636:80;1651:64;1708:6;1651:64;;1636:80;1627:89;;1733:5;1758:6;1751:5;1744:21;1788:4;1780:6;1776:17;1766:27;;1810:4;1805:3;1801:14;1794:21;;1863:6;1910:3;1902:4;1894:6;1890:17;1885:3;1881:27;1878:36;1875:2;;;1927:1;1924;1917:12;1875:2;1952:1;1937:206;1962:6;1959:1;1956:13;1937:206;;;2020:3;2042:37;2075:3;2063:10;2042:37;;;2030:50;;-1:-1;2103:4;2094:14;;;;2122;;;;;1984:1;1977:9;1937:206;;2157:118;;2224:46;2262:6;2249:20;2224:46;;;2215:55;2209:66;-1:-1;;;2209:66;2315:752;;2429:4;2417:9;2412:3;2408:19;2404:30;2401:2;;;2447:1;2444;2437:12;2401:2;2465:20;2480:4;2465:20;;;2456:29;-1:-1;2543:1;2574:49;2619:3;2599:9;2574:49;;;2550:74;;-1:-1;2721:2;2706:18;;2693:32;2745:18;2734:30;;2731:2;;;2777:1;2774;2767:12;2731:2;2812:89;2897:3;2888:6;2877:9;2873:22;2812:89;;;2805:4;2798:5;2794:16;2787:115;2645:268;2963:2;2996:49;3041:3;3032:6;3021:9;3017:22;2996:49;;;2989:4;2982:5;2978:16;2971:75;2923:134;2395:672;;;;;3199:377;;3328:2;3316:9;3307:7;3303:23;3299:32;3296:2;;;3344:1;3341;3334:12;3296:2;3379:31;;3430:18;3419:30;;3416:2;;;3462:1;3459;3452:12;3416:2;3482:78;3552:7;3543:6;3532:9;3528:22;3482:78;;;3472:88;3290:286;-1:-1;;;;3290:286;3583:638;;;3754:2;3742:9;3733:7;3729:23;3725:32;3722:2;;;3770:1;3767;3760:12;3722:2;3805:31;;3856:18;3845:30;;3842:2;;;3888:1;3885;3878:12;3842:2;3908:78;3978:7;3969:6;3958:9;3954:22;3908:78;;;3898:88;;3784:208;4051:2;4040:9;4036:18;4023:32;4075:18;4067:6;4064:30;4061:2;;;4107:1;4104;4097:12;4061:2;4127:78;4197:7;4188:6;4177:9;4173:22;4127:78;;;4117:88;;4002:209;3716:505;;;;;;4228:101;4295:28;4317:5;4295:28;;;4290:3;4283:41;4277:52;;;4336:110;4409:31;4434:5;4409:31;;4453:181;4555:2;4540:18;;4569:55;4544:9;4597:6;4569:55;;4641:193;4749:2;4734:18;;4763:61;4738:9;4797:6;4763:61;;4841:256;4903:2;4897:9;4929:17;;;5004:18;4989:34;;5025:22;;;4986:62;4983:2;;;5061:1;5058;5051:12;4983:2;5077;5070:22;4881:216;;-1:-1;4881:216;5104:273;;5278:18;5270:6;5267:30;5264:2;;;5310:1;5307;5300:12;5264:2;-1:-1;5339:4;5327:17;;;5357:15;;5201:176;5384:229;;5537:18;5529:6;5526:30;5523:2;;;5569:1;5566;5559:12;5523:2;-1:-1;5598:4;5586:17;;5460:153;5885:92;5958:13;5951:21;;5934:43;5984:79;6053:5;6036:27",
"source": "pragma solidity ^0.4.24;\npragma experimental ABIEncoderV2;\n\ncontract GameObject {\n \n struct gameData {\n //custom field\n uint256 playerNumber;\n \n // required field\n uint256[2][] randomRanges;\n bytes32 seed;\n }\n\n // If you use other custom field, add it in function\n function hashGameData(gameData _gameData) public pure returns(bytes32) {\n return keccak256(abi.encodePacked(\n //_gameData.customField\n _gameData.playerNumber,\n _gameData.randomRanges,\n _gameData.seed\n ));\n }\n\n function checkGameData(gameData _gameData, uint[] _bets) public pure returns (bool) {\n if (\n _gameData.randomRanges.length != uint(1) ||\n _gameData.playerNumber < uint(0) || \n _gameData.playerNumber > uint(65535) ||\n _bets[0] > 100 ether\n ) {\n return false;\n }\n return true;\n }\n\n}",
"sourcePath": "/Users/fanyshu/Documents/Projects/DCLabs/monorepo/packages/dc-sdk-example/dapp/contracts/game/GameObject.sol",
"ast": {
"absolutePath": "/Users/fanyshu/Documents/Projects/DCLabs/monorepo/packages/dc-sdk-example/dapp/contracts/game/GameObject.sol",
"exportedSymbols": {
"GameObject": [
362
]
},
"id": 363,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 286,
"literals": [
"solidity",
"^",
"0.4",
".24"
],
"nodeType": "PragmaDirective",
"src": "0:24:3"
},
{
"id": 287,
"literals": [
"experimental",
"ABIEncoderV2"
],
"nodeType": "PragmaDirective",
"src": "25:33:3"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 362,
"linearizedBaseContracts": [
362
],
"name": "GameObject",
"nodeType": "ContractDefinition",
"nodes": [
{
"canonicalName": "GameObject.gameData",
"id": 297,
"members": [
{
"constant": false,
"id": 289,
"name": "playerNumber",
"nodeType": "VariableDeclaration",
"scope": 297,
"src": "140:20:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 288,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "140:7:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 294,
"name": "randomRanges",
"nodeType": "VariableDeclaration",
"scope": 297,
"src": "205:25:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_uint256_$2_storage_$dyn_storage_ptr",
"typeString": "uint256[2][]"
},
"typeName": {
"baseType": {
"baseType": {
"id": 290,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "205:7:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 292,
"length": {
"argumentTypes": null,
"hexValue": "32",
"id": 291,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "213:1:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
},
"value": "2"
},
"nodeType": "ArrayTypeName",
"src": "205:10:3",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$2_storage_ptr",
"typeString": "uint256[2]"
}
},
"id": 293,
"length": null,
"nodeType": "ArrayTypeName",
"src": "205:12:3",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_uint256_$2_storage_$dyn_storage_ptr",
"typeString": "uint256[2][]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 296,
"name": "seed",
"nodeType": "VariableDeclaration",
"scope": 297,
"src": "240:17:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 295,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "240:7:3",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
}
],
"name": "gameData",
"nodeType": "StructDefinition",
"scope": 362,
"src": "91:173:3",
"visibility": "public"
},
{
"body": {
"id": 316,
"nodeType": "Block",
"src": "398:197:3",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 307,
"name": "_gameData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 299,
"src": "491:9:3",
"typeDescriptions": {
"typeIdentifier": "t_struct$_gameData_$297_memory_ptr",
"typeString": "struct GameObject.gameData memory"
}
},
"id": 308,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "playerNumber",
"nodeType": "MemberAccess",
"referencedDeclaration": 289,
"src": "491:22:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 309,
"name": "_gameData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 299,
"src": "527:9:3",
"typeDescriptions": {
"typeIdentifier": "t_struct$_gameData_$297_memory_ptr",
"typeString": "struct GameObject.gameData memory"
}
},
"id": 310,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "randomRanges",
"nodeType": "MemberAccess",
"referencedDeclaration": 294,
"src": "527:22:3",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_uint256_$2_memory_$dyn_memory",
"typeString": "uint256[2] memory[] memory"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 311,
"name": "_gameData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 299,
"src": "563:9:3",
"typeDescriptions": {
"typeIdentifier": "t_struct$_gameData_$297_memory_ptr",
"typeString": "struct GameObject.gameData memory"
}
},
"id": 312,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "seed",
"nodeType": "MemberAccess",
"referencedDeclaration": 296,
"src": "563:14:3",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_array$_t_array$_t_uint256_$2_memory_$dyn_memory",
"typeString": "uint256[2] memory[] memory"
},
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"expression": {
"argumentTypes": null,
"id": 305,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3264,
"src": "425:3:3",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 306,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "encodePacked",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "425:16:3",
"typeDescriptions": {
"typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$",
"typeString": "function () pure returns (bytes memory)"
}
},
"id": 313,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "425:162:3",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
],
"id": 304,
"name": "keccak256",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3271,
"src": "415:9:3",
"typeDescriptions": {
"typeIdentifier": "t_function_sha3_pure$__$returns$_t_bytes32_$",
"typeString": "function () pure returns (bytes32)"
}
},
"id": 314,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "415:173:3",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"functionReturnParameters": 303,
"id": 315,
"nodeType": "Return",
"src": "408:180:3"
}
]
},
"documentation": null,
"id": 317,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "hashGameData",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 300,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 299,
"name": "_gameData",
"nodeType": "VariableDeclaration",
"scope": 317,
"src": "349:18:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_struct$_gameData_$297_memory_ptr",
"typeString": "struct GameObject.gameData"
},
"typeName": {
"contractScope": null,
"id": 298,
"name": "gameData",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 297,
"src": "349:8:3",
"typeDescriptions": {
"typeIdentifier": "t_struct$_gameData_$297_storage_ptr",
"typeString": "struct GameObject.gameData"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "348:20:3"
},
"payable": false,
"returnParameters": {
"id": 303,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 302,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 317,
"src": "389:7:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 301,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "389:7:3",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "388:9:3"
},
"scope": 362,
"src": "327:268:3",
"stateMutability": "pure",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 360,
"nodeType": "Block",
"src": "685:295:3",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 353,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 347,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 340,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 333,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 327,
"name": "_gameData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 319,
"src": "712:9:3",
"typeDescriptions": {
"typeIdentifier": "t_struct$_gameData_$297_memory_ptr",
"typeString": "struct GameObject.gameData memory"
}
},
"id": 328,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "randomRanges",
"nodeType": "MemberAccess",
"referencedDeclaration": 294,
"src": "712:22:3",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_uint256_$2_memory_$dyn_memory",
"typeString": "uint256[2] memory[] memory"
}
},
"id": 329,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "712:29:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "31",
"id": 331,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "750:1:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
}
],
"id": 330,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "745:4:3",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
},
"typeName": "uint"
},
"id": 332,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "745:7:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "712:40:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "||",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 339,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 334,
"name": "_gameData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 319,
"src": "768:9:3",
"typeDescriptions": {
"typeIdentifier": "t_struct$_gameData_$297_memory_ptr",
"typeString": "struct GameObject.gameData memory"
}
},
"id": 335,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "playerNumber",
"nodeType": "MemberAccess",
"referencedDeclaration": 289,
"src": "768:22:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 337,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "798:1:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 336,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "793:4:3",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
},
"typeName": "uint"
},
"id": 338,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "793:7:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "768:32:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "712:88:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "||",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 346,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 341,
"name": "_gameData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 319,
"src": "825:9:3",
"typeDescriptions": {
"typeIdentifier": "t_struct$_gameData_$297_memory_ptr",
"typeString": "struct GameObject.gameData memory"
}
},
"id": 342,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "playerNumber",
"nodeType": "MemberAccess",
"referencedDeclaration": 289,
"src": "825:22:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "3635353335",
"id": 344,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "855:5:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_65535_by_1",
"typeString": "int_const 65535"
},
"value": "65535"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_65535_by_1",
"typeString": "int_const 65535"
}
],
"id": 343,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "850:4:3",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
},
"typeName": "uint"
},
"id": 345,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "850:11:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "825:36:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "712:149:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "||",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 352,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 348,
"name": "_bets",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 322,
"src": "881:5:3",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 350,
"indexExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 349,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "887:1:3",
"subdenomination"