dc-protocol
Version:
Start ganache and deploy our contracts
1,125 lines • 283 kB
JSON
{
"contractName": "Platform",
"abi": [
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
}
],
"name": "operatorOf",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function",
"signature": "0x636f35d3"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
}
],
"name": "referrerCount",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function",
"signature": "0x71602692"
},
{
"constant": true,
"inputs": [],
"name": "owner",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function",
"signature": "0x8da5cb5b"
},
{
"constant": true,
"inputs": [],
"name": "minimal",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function",
"signature": "0x94a53d41"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
}
],
"name": "referrerOf",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function",
"signature": "0xd21cacdf"
},
{
"constant": true,
"inputs": [],
"name": "users",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function",
"signature": "0xf2020275"
},
{
"inputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor",
"signature": "constructor"
},
{
"constant": false,
"inputs": [
{
"name": "_newOwner",
"type": "address"
}
],
"name": "ownerTransfership",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function",
"signature": "0x6fdc202f"
},
{
"constant": false,
"inputs": [
{
"name": "_game",
"type": "address"
}
],
"name": "addGame",
"outputs": [
{
"name": "success",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function",
"signature": "0xd72d04db"
},
{
"constant": false,
"inputs": [
{
"name": "_game",
"type": "address"
}
],
"name": "delGame",
"outputs": [
{
"name": "success",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function",
"signature": "0xeda30c9e"
},
{
"constant": true,
"inputs": [
{
"name": "_game",
"type": "address"
}
],
"name": "getStatus",
"outputs": [
{
"name": "status",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function",
"signature": "0x30ccebb5"
},
{
"constant": false,
"inputs": [
{
"name": "_player",
"type": "address"
},
{
"name": "_referrer",
"type": "address"
}
],
"name": "setService",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function",
"signature": "0x29eae053"
},
{
"constant": true,
"inputs": [
{
"name": "_player",
"type": "address"
}
],
"name": "getService",
"outputs": [
{
"name": "_operator",
"type": "address"
},
{
"name": "_referrer",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function",
"signature": "0x15a52302"
},
{
"constant": true,
"inputs": [
{
"name": "_player",
"type": "address"
}
],
"name": "getReferrer",
"outputs": [
{
"name": "_referrer",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function",
"signature": "0x4a9fefc7"
},
{
"constant": true,
"inputs": [
{
"name": "_player",
"type": "address"
}
],
"name": "getOperator",
"outputs": [
{
"name": "_operator",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function",
"signature": "0x5865c60c"
},
{
"constant": false,
"inputs": [
{
"name": "_player",
"type": "address"
},
{
"name": "_amount",
"type": "uint256"
}
],
"name": "setAmountForPlayer",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function",
"signature": "0x08af84f0"
},
{
"constant": true,
"inputs": [
{
"name": "_player",
"type": "address"
}
],
"name": "getMaxAmount",
"outputs": [
{
"name": "_amount",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function",
"signature": "0x15525991"
}
],
"bytecode": "0x6080604052683635c9adc5dea00000600155600060075534801561002257600080fd5b5060008054600160a060020a031916331790556106c7806100446000396000f3006080604052600436106100e55763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166308af84f081146100ea578063155259911461012257806315a523021461015557806329eae0531461019c57806330ccebb5146101c55780634a9fefc7146101e65780635865c60c14610223578063636f35d3146102445780636fdc202f1461026557806371602692146102865780638da5cb5b146102a757806394a53d41146102bc578063d21cacdf146102d1578063d72d04db146102f2578063eda30c9e14610313578063f202027514610334575b600080fd5b3480156100f657600080fd5b5061010e600160a060020a0360043516602435610349565b604080519115158252519081900360200190f35b34801561012e57600080fd5b50610143600160a060020a0360043516610382565b60408051918252519081900360200190f35b34801561016157600080fd5b50610176600160a060020a03600435166103ac565b60408051600160a060020a03938416815291909216602082015281519081900390910190f35b3480156101a857600080fd5b506101c3600160a060020a03600435811690602435166103db565b005b3480156101d157600080fd5b5061010e600160a060020a036004351661051a565b3480156101f257600080fd5b50610207600160a060020a0360043516610538565b60408051600160a060020a039092168252519081900360200190f35b34801561022f57600080fd5b50610207600160a060020a0360043516610556565b34801561025057600080fd5b50610207600160a060020a0360043516610574565b34801561027157600080fd5b506101c3600160a060020a036004351661058f565b34801561029257600080fd5b50610143600160a060020a03600435166105d5565b3480156102b357600080fd5b506102076105e7565b3480156102c857600080fd5b506101436105f6565b3480156102dd57600080fd5b50610207600160a060020a03600435166105fc565b3480156102fe57600080fd5b5061010e600160a060020a0360043516610617565b34801561031f57600080fd5b5061010e600160a060020a0360043516610658565b34801561034057600080fd5b50610143610695565b60008054600160a060020a0316331461036157600080fd5b50600160a060020a0391909116600090815260036020526040902055600190565b600160a060020a0381166000908152600360205260409020548015156103a757506001545b919050565b600160a060020a0390811660009081526005602090815260408083205460049092529091205490821692911690565b600054600160a060020a031633146103f257600080fd5b600160a060020a03828116600090815260046020526040902054161580156104325750600160a060020a0382811660009081526005602052604090205416155b151561043d57600080fd5b600160a060020a038116600081815260066020526040902080546001908101909155600780549091019055156104ad57600160a060020a038281166000908152600460205260409020805473ffffffffffffffffffffffffffffffffffffffff19169183169190911790556104e3565b600160a060020a0382166000908152600460205260409020805473ffffffffffffffffffffffffffffffffffffffff1916331790555b50600160a060020a03166000908152600560205260409020805473ffffffffffffffffffffffffffffffffffffffff191633179055565b600160a060020a031660009081526002602052604090205460ff1690565b600160a060020a039081166000908152600460205260409020541690565b600160a060020a039081166000908152600560205260409020541690565b600560205260009081526040902054600160a060020a031681565b600054600160a060020a031633146105a657600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60066020526000908152604090205481565b600054600160a060020a031681565b60015481565b600460205260009081526040902054600160a060020a031681565b60008054600160a060020a0316331461062f57600080fd5b50600160a060020a03166000908152600260205260409020805460ff1916600190811790915590565b60008054600160a060020a0316331461067057600080fd5b50600160a060020a03166000908152600260205260409020805460ff19169055600190565b600754815600a165627a7a7230582085e1f2629fdeb6a4115bc827990e497f7a8c87031fce98cbf2e9ae0f936740e00029",
"deployedBytecode": "0x6080604052600436106100e55763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166308af84f081146100ea578063155259911461012257806315a523021461015557806329eae0531461019c57806330ccebb5146101c55780634a9fefc7146101e65780635865c60c14610223578063636f35d3146102445780636fdc202f1461026557806371602692146102865780638da5cb5b146102a757806394a53d41146102bc578063d21cacdf146102d1578063d72d04db146102f2578063eda30c9e14610313578063f202027514610334575b600080fd5b3480156100f657600080fd5b5061010e600160a060020a0360043516602435610349565b604080519115158252519081900360200190f35b34801561012e57600080fd5b50610143600160a060020a0360043516610382565b60408051918252519081900360200190f35b34801561016157600080fd5b50610176600160a060020a03600435166103ac565b60408051600160a060020a03938416815291909216602082015281519081900390910190f35b3480156101a857600080fd5b506101c3600160a060020a03600435811690602435166103db565b005b3480156101d157600080fd5b5061010e600160a060020a036004351661051a565b3480156101f257600080fd5b50610207600160a060020a0360043516610538565b60408051600160a060020a039092168252519081900360200190f35b34801561022f57600080fd5b50610207600160a060020a0360043516610556565b34801561025057600080fd5b50610207600160a060020a0360043516610574565b34801561027157600080fd5b506101c3600160a060020a036004351661058f565b34801561029257600080fd5b50610143600160a060020a03600435166105d5565b3480156102b357600080fd5b506102076105e7565b3480156102c857600080fd5b506101436105f6565b3480156102dd57600080fd5b50610207600160a060020a03600435166105fc565b3480156102fe57600080fd5b5061010e600160a060020a0360043516610617565b34801561031f57600080fd5b5061010e600160a060020a0360043516610658565b34801561034057600080fd5b50610143610695565b60008054600160a060020a0316331461036157600080fd5b50600160a060020a0391909116600090815260036020526040902055600190565b600160a060020a0381166000908152600360205260409020548015156103a757506001545b919050565b600160a060020a0390811660009081526005602090815260408083205460049092529091205490821692911690565b600054600160a060020a031633146103f257600080fd5b600160a060020a03828116600090815260046020526040902054161580156104325750600160a060020a0382811660009081526005602052604090205416155b151561043d57600080fd5b600160a060020a038116600081815260066020526040902080546001908101909155600780549091019055156104ad57600160a060020a038281166000908152600460205260409020805473ffffffffffffffffffffffffffffffffffffffff19169183169190911790556104e3565b600160a060020a0382166000908152600460205260409020805473ffffffffffffffffffffffffffffffffffffffff1916331790555b50600160a060020a03166000908152600560205260409020805473ffffffffffffffffffffffffffffffffffffffff191633179055565b600160a060020a031660009081526002602052604090205460ff1690565b600160a060020a039081166000908152600460205260409020541690565b600160a060020a039081166000908152600560205260409020541690565b600560205260009081526040902054600160a060020a031681565b600054600160a060020a031633146105a657600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60066020526000908152604090205481565b600054600160a060020a031681565b60015481565b600460205260009081526040902054600160a060020a031681565b60008054600160a060020a0316331461062f57600080fd5b50600160a060020a03166000908152600260205260409020805460ff1916600190811790915590565b60008054600160a060020a0316331461067057600080fd5b50600160a060020a03166000908152600260205260409020805460ff19169055600190565b600754815600a165627a7a7230582085e1f2629fdeb6a4115bc827990e497f7a8c87031fce98cbf2e9ae0f936740e00029",
"sourceMap": "107:3665:13:-;;;585:10;560:35;;1590:1;1570:21;;187:57;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;219:5:13;:18;;-1:-1:-1;;;;;;219:18:13;227:10;219:18;;;107:3665;;;;;;",
"deployedSourceMap": "107:3665:13:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3292:156;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3292:156:13;-1:-1:-1;;;;;3292:156:13;;;;;;;;;;;;;;;;;;;;;;;;;3574:195;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3574:195:13;-1:-1:-1;;;;;3574:195:13;;;;;;;;;;;;;;;;;;;;;2425:163;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2425:163:13;-1:-1:-1;;;;;2425:163:13;;;;;;;;;-1:-1:-1;;;;;2425:163:13;;;;;;;;;;;;;;;;;;;;;;;;1719:453;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1719:453:13;-1:-1:-1;;;;;1719:453:13;;;;;;;;;;;;1301:110;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1301:110:13;-1:-1:-1;;;;;1301:110:13;;;;;2736:122;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2736:122:13;-1:-1:-1;;;;;2736:122:13;;;;;;;;;-1:-1:-1;;;;;2736:122:13;;;;;;;;;;;;;;3017;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3017:122:13;-1:-1:-1;;;;;3017:122:13;;;;;1468:45;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1468:45:13;-1:-1:-1;;;;;1468:45:13;;;;;431:97;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;431:97:13;-1:-1:-1;;;;;431:97:13;;;;;1519:45;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1519:45:13;-1:-1:-1;;;;;1519:45:13;;;;;534:20;;8:9:-1;5:2;;;30:1;27;20:12;5:2;534:20:13;;;;560:35;;8:9:-1;5:2;;;30:1;27;20:12;5:2;560:35:13;;;;1417:45;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1417:45:13;-1:-1:-1;;;;;1417:45:13;;;;;793:134;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;793:134:13;-1:-1:-1;;;;;793:134:13;;;;;1046:135;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1046:135:13;-1:-1:-1;;;;;1046:135:13;;;;;1570:21;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1570:21:13;;;;3292:156;3376:4;303:5;;-1:-1:-1;;;;;303:5:13;289:10;:19;281:28;;;;;;-1:-1:-1;;;;;;3392:18:13;;;;;;;;:9;:18;;;;;:28;3437:4;;3292:156::o;3574:195::-;-1:-1:-1;;;;;3669:18:13;;3635:12;3669:18;;;:9;:18;;;;;;3701;;3697:66;;;-1:-1:-1;3745:7:13;;3697:66;3574:195;;;:::o;2425:163::-;-1:-1:-1;;;;;2540:19:13;;;2484:17;2540:19;;;:10;:19;;;;;;;;;2561:10;:19;;;;;;;2540;;;;2561;;;2425:163::o;1719:453::-;1814:5;;-1:-1:-1;;;;;1814:5:13;1800:10;:19;1792:28;;;;;;-1:-1:-1;;;;;1838:19:13;;;1869:1;1838:19;;;:10;:19;;;;;;;:33;:70;;;;-1:-1:-1;;;;;;1875:19:13;;;1906:1;1875:19;;;:10;:19;;;;;;;:33;1838:70;1830:79;;;;;;;;-1:-1:-1;;;;;1920:24:13;;;;;;:13;:24;;;;;:26;;;;;;;;;1956:5;:7;;;;;;;1977:23;1973:151;;-1:-1:-1;;;;;2016:19:13;;;;;;;:10;:19;;;;;:31;;-1:-1:-1;;2016:31:13;;;;;;;;;;1973:151;;;-1:-1:-1;;;;;2078:19:13;;;;;;:10;:19;;;;;:32;;-1:-1:-1;;2078:32:13;2100:10;2078:32;;;1973:151;-1:-1:-1;;;;;;2133:19:13;;;;;:10;:19;;;;;:32;;-1:-1:-1;;2133:32:13;2155:10;2133:32;;;1719:453::o;1301:110::-;-1:-1:-1;;;;;1389:15:13;1357:11;1389:15;;;:8;:15;;;;;;;;;1301:110::o;2736:122::-;-1:-1:-1;;;;;2832:19:13;;;2796:17;2832:19;;;:10;:19;;;;;;;;2736:122::o;3017:::-;-1:-1:-1;;;;;3113:19:13;;;3077:17;3113:19;;;:10;:19;;;;;;;;3017:122::o;1468:45::-;;;;;;;;;;;;-1:-1:-1;;;;;1468:45:13;;:::o;431:97::-;303:5;;-1:-1:-1;;;;;303:5:13;289:10;:19;281:28;;;;;;504:5;:17;;-1:-1:-1;;504:17:13;-1:-1:-1;;;;;504:17:13;;;;;;;;;;431:97::o;1519:45::-;;;;;;;;;;;;;:::o;534:20::-;;;-1:-1:-1;;;;;534:20:13;;:::o;560:35::-;;;;:::o;1417:45::-;;;;;;;;;;;;-1:-1:-1;;;;;1417:45:13;;:::o;793:134::-;850:12;303:5;;-1:-1:-1;;;;;303:5:13;289:10;:19;281:28;;;;;;-1:-1:-1;;;;;;874:15:13;;;;;:8;:15;;;;;:22;;-1:-1:-1;;874:22:13;892:4;874:22;;;;;;892:4;793:134::o;1046:135::-;1103:12;303:5;;-1:-1:-1;;;;;303:5:13;289:10;:19;281:28;;;;;;-1:-1:-1;;;;;;1127:15:13;1145:5;1127:15;;;:8;:15;;;;;:23;;-1:-1:-1;;1127:23:13;;;;;1046:135::o;1570:21::-;;;;:::o",
"source": "pragma solidity ^0.4.23;\n\n/**\n@title Whitelist of games\n@notice contract for managing the list of games\n*/\ncontract Platform {\n \n /**\n @notice constructor of contract\n */\n constructor () public {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(msg.sender == owner);\n _;\n }\n\n /**\n @notice change of ownership\n @param _newOwner address of new contract owner\n */\n function ownerTransfership(address _newOwner) public onlyOwner {\n owner = _newOwner;\n }\n\n address public owner;\n uint256 public minimal = 1000 ether;\n mapping (address => bool) gamelist;\n mapping (address => uint) whitelist;\n\n /**\n @notice Set the launch permission\n @param _game address of the game\n @return success\n */\n function addGame(address _game) public onlyOwner returns(bool success) {\n gamelist[_game] = true;\n success = true;\n }\n\n /**\n @notice Delete the launch permission\n @param _game address of the game\n @return success\n */\n function delGame(address _game) public onlyOwner returns(bool success) {\n gamelist[_game] = false;\n success = true;\n }\n\n /**\n @notice Get the launch permission\n @param _game address of the game\n @return game status\n */\n function getStatus(address _game) external view returns(bool status) {\n status = gamelist[_game];\n }\n\n mapping(address => address) public referrerOf;\n mapping(address => address) public operatorOf;\n mapping(address => uint) public referrerCount;\n uint public users = 0;\n\n\n\n /**\n @notice Player registration\n @param _player Player address\n @param _referrer Referrer address\n */\n function setService(address _player, address _referrer) public {\n require(msg.sender == owner);\n require(referrerOf[_player] == address(0) && operatorOf[_player] == address(0)); \n referrerCount[_referrer]++;\n users++;\n if (_referrer != address(0)) {\n referrerOf[_player] = _referrer;\n } else {\n referrerOf[_player] = msg.sender; \n }\n operatorOf[_player] = msg.sender;\n }\n\n /** \n @notice Get address of operator and referrer\n @param _player Address of player\n @return {\n \"_operator\": \"The operator address to receive a reward\",\n \"_referrer\": \"The referrer address to receive a reward\"\n }\n */\n function getService(address _player) external view returns(address _operator, address _referrer) {\n return (operatorOf[_player], referrerOf[_player]);\n }\n\n /** \n @notice Get address of referrer\n @param _player Address of player\n @return The referrer address to receive a reward\n */\n function getReferrer(address _player) external view returns(address _referrer) {\n return referrerOf[_player];\n }\n\n /** \n @notice Get address of operator (platform)\n @param _player Address of player\n @return The operator address to receive a reward\n */\n function getOperator(address _player) external view returns(address _operator) {\n return operatorOf[_player];\n }\n\n /**\n @notice Set the allowed amount\n @param _player address of the player\n @param _amount allowable amount\n @return success\n */\n function setAmountForPlayer(address _player, uint _amount) public onlyOwner returns(bool) {\n whitelist[_player] = _amount;\n return true;\n }\n\n /**\n @notice Get the allowed amount\n @param _player address of the player\n @return allowable amount\n */\n function getMaxAmount(address _player) external view returns(uint _amount) {\n _amount = whitelist[_player];\n if (_amount == uint(0)) {\n _amount = minimal;\n }\n }\n\n}",
"sourcePath": "/Users/fanyshu/Documents/Projects/DCLabs/monorepo/packages/dc-sdk-example/dapp/contracts/platform/Platform.sol",
"ast": {
"absolutePath": "/Users/fanyshu/Documents/Projects/DCLabs/monorepo/packages/dc-sdk-example/dapp/contracts/platform/Platform.sol",
"exportedSymbols": {
"Platform": [
2611
]
},
"id": 2612,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 2340,
"literals": [
"solidity",
"^",
"0.4",
".23"
],
"nodeType": "PragmaDirective",
"src": "0:24:13"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": "@title Whitelist of games\n@notice contract for managing the list of games",
"fullyImplemented": true,
"id": 2611,
"linearizedBaseContracts": [
2611
],
"name": "Platform",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 2348,
"nodeType": "Block",
"src": "209:35:13",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 2346,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 2343,
"name": "owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2374,
"src": "219:5:13",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 2344,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3277,
"src": "227:3:13",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 2345,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "227:10:13",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "219:18:13",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 2347,
"nodeType": "ExpressionStatement",
"src": "219:18:13"
}
]
},
"documentation": "@notice constructor of contract",
"id": 2349,
"implemented": true,
"isConstructor": true,
"isDeclaredConst": false,
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2341,
"nodeType": "ParameterList",
"parameters": [],
"src": "199:2:13"
},
"payable": false,
"returnParameters": {
"id": 2342,
"nodeType": "ParameterList",
"parameters": [],
"src": "209:0:13"
},
"scope": 2611,
"src": "187:57:13",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 2359,
"nodeType": "Block",
"src": "271:56:13",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 2355,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 2352,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3277,
"src": "289:3:13",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 2353,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "289:10:13",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 2354,
"name": "owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2374,
"src": "303:5:13",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "289:19:13",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 2351,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
3280,
3281
],
"referencedDeclaration": 3280,
"src": "281:7:13",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 2356,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "281:28:13",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 2357,
"nodeType": "ExpressionStatement",
"src": "281:28:13"
},
{
"id": 2358,
"nodeType": "PlaceholderStatement",
"src": "319:1:13"
}
]
},
"documentation": null,
"id": 2360,
"name": "onlyOwner",
"nodeType": "ModifierDefinition",
"parameters": {
"id": 2350,
"nodeType": "ParameterList",
"parameters": [],
"src": "268:2:13"
},
"src": "250:77:13",
"visibility": "internal"
},
{
"body": {
"id": 2371,
"nodeType": "Block",
"src": "494:34:13",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 2369,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 2367,
"name": "owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2374,
"src": "504:5:13",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 2368,
"name": "_newOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2362,
"src": "512:9:13",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "504:17:13",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 2370,
"nodeType": "ExpressionStatement",
"src": "504:17:13"
}
]
},
"documentation": "@notice change of ownership\n@param _newOwner address of new contract owner",
"id": 2372,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": null,
"id": 2365,
"modifierName": {
"argumentTypes": null,
"id": 2364,
"name": "onlyOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2360,
"src": "484:9:13",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "484:9:13"
}
],
"name": "ownerTransfership",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2363,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2362,
"name": "_newOwner",
"nodeType": "VariableDeclaration",
"scope": 2372,
"src": "458:17:13",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 2361,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "458:7:13",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "457:19:13"
},
"payable": false,
"returnParameters": {
"id": 2366,
"nodeType": "ParameterList",
"parameters": [],
"src": "494:0:13"
},
"scope": 2611,
"src": "431:97:13",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"constant": false,
"id": 2374,
"name": "owner",
"nodeType": "VariableDeclaration",
"scope": 2611,
"src": "534:20:13",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 2373,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "534:7:13",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 2377,
"name": "minimal",
"nodeType": "VariableDeclaration",
"scope": 2611,
"src": "560:35:13",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2375,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "560:7:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": {
"argumentTypes": null,
"hexValue": "31303030",
"id": 2376,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "585:10:13",
"subdenomination": "ether",
"typeDescriptions": {
"typeIdentifier": "t_rational_1000000000000000000000_by_1",
"typeString": "int_const 1000000000000000000000"
},
"value": "1000"
},
"visibility": "public"
},
{
"constant": false,
"id": 2381,
"name": "gamelist",
"nodeType": "VariableDeclaration",
"scope": 2611,
"src": "601:34:13",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"typeName": {
"id": 2380,
"keyType": {
"id": 2378,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "610:7:13",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "601:25:13",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"valueType": {
"id": 2379,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "621:4:13",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2385,
"name": "whitelist",
"nodeType": "VariableDeclaration",
"scope": 2611,
"src": "641:35:13",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
},
"typeName": {
"id": 2384,
"keyType": {
"id": 2382,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "650:7:13",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "641:25:13",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
},
"valueType": {
"id": 2383,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "661:4:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
"value": null,
"visibility": "internal"
},
{
"body": {
"id": 2404,
"nodeType": "Block",
"src": "864:63:13",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 2398,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 2394,
"name": "gamelist",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2381,
"src": "874:8:13",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 2396,
"indexExpression": {
"argumentTypes": null,
"id": 2395,
"name": "_game",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2387,
"src": "883:5:13",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "874:15:13",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 2397,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "892:4:13",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "874:22:13",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 2399,
"nodeType": "ExpressionStatement",
"src": "874:22:13"
},
{
"expression": {
"argumentTypes": null,
"id": 2402,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 2400,
"name": "success",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2392,
"src": "906:7:13",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 2401,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "916:4:13",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "906:14:13",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 2403,
"nodeType": "ExpressionStatement",
"src": "906:14:13"
}
]
},
"documentation": "@notice Set the launch permission\n@param _game address of the game\n@return success",
"id": 2405,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": null,
"id": 2390,
"modifierName": {
"argumentTypes": null,
"id": 2389,
"name": "onlyOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2360,
"src": "832:9:13",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "832:9:13"
}
],
"name": "addGame",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2388,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2387,
"name": "_game",
"nodeType": "VariableDeclaration",
"scope": 2405,
"src": "810:13:13",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 2386,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "810:7:13",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "809:15:13"
},
"payable": false,
"returnParameters": {
"id": 2393,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2392,
"name": "success",
"nodeType": "VariableDeclaration",
"scope": 2405,
"src": "850:12:13",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 2391,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "850:4:13",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "849:14:13"
},
"scope": 2611,
"src": "793:134:13",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 2424,
"nodeType": "Block",
"src": "1117:64:13",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 2418,
"isConstant": false,
"isLValue": false,
"isPure": false,
"l