@josojo/realitytoken-contracts
Version:
realitytoken basic contracts
1,299 lines (1,298 loc) • 325 kB
JSON
{
"contractName": "Event",
"abi": [
{
"constant": true,
"inputs": [],
"name": "outcome",
"outputs": [
{
"name": "",
"type": "int256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "oracle",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "outcomeTokens",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "collateralToken",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "isOutcomeSet",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_collateralToken",
"type": "address"
},
{
"name": "_oracle",
"type": "address"
},
{
"name": "outcomeCount",
"type": "uint8"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "outcomeToken",
"type": "address"
},
{
"indexed": false,
"name": "index",
"type": "uint8"
}
],
"name": "OutcomeTokenCreation",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "buyer",
"type": "address"
},
{
"indexed": false,
"name": "collateralTokenCount",
"type": "uint256"
}
],
"name": "OutcomeTokenSetIssuance",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "seller",
"type": "address"
},
{
"indexed": false,
"name": "outcomeTokenCount",
"type": "uint256"
}
],
"name": "OutcomeTokenSetRevocation",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "outcome",
"type": "int256"
}
],
"name": "OutcomeAssignment",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "receiver",
"type": "address"
},
{
"indexed": false,
"name": "winnings",
"type": "uint256"
}
],
"name": "WinningsRedemption",
"type": "event"
},
{
"constant": false,
"inputs": [
{
"name": "collateralTokenCount",
"type": "uint256"
}
],
"name": "buyAllOutcomes",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "outcomeTokenCount",
"type": "uint256"
}
],
"name": "sellAllOutcomes",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "setOutcome",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getOutcomeCount",
"outputs": [
{
"name": "",
"type": "uint8"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getOutcomeTokens",
"outputs": [
{
"name": "",
"type": "address[]"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "owner",
"type": "address"
}
],
"name": "getOutcomeTokenDistribution",
"outputs": [
{
"name": "outcomeTokenDistribution",
"type": "uint256[]"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getEventHash",
"outputs": [
{
"name": "",
"type": "bytes32"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "redeemWinnings",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
}
],
"bytecode": "0x",
"deployedBytecode": "0x",
"sourceMap": "",
"deployedSourceMap": "",
"source": "pragma solidity ^0.4.15;\nimport \"../Tokens/Token.sol\";\nimport \"../Tokens/OutcomeToken.sol\";\nimport \"../Oracles/Oracle.sol\";\n\n\n/// @title Event contract - Provide basic functionality required by different event types\n/// @author Stefan George - <stefan@gnosis.pm>\ncontract Event {\n\n /*\n * Events\n */\n event OutcomeTokenCreation(OutcomeToken outcomeToken, uint8 index);\n event OutcomeTokenSetIssuance(address indexed buyer, uint collateralTokenCount);\n event OutcomeTokenSetRevocation(address indexed seller, uint outcomeTokenCount);\n event OutcomeAssignment(int outcome);\n event WinningsRedemption(address indexed receiver, uint winnings);\n\n /*\n * Storage\n */\n Token public collateralToken;\n Oracle public oracle;\n bool public isOutcomeSet;\n int public outcome;\n OutcomeToken[] public outcomeTokens;\n\n /*\n * Public functions\n */\n /// @dev Contract constructor validates and sets basic event properties\n /// @param _collateralToken Tokens used as collateral in exchange for outcome tokens\n /// @param _oracle Oracle contract used to resolve the event\n /// @param outcomeCount Number of event outcomes\n function Event(Token _collateralToken, Oracle _oracle, uint8 outcomeCount)\n public\n {\n // Validate input\n require(address(_collateralToken) != 0 && address(_oracle) != 0 && outcomeCount >= 2);\n collateralToken = _collateralToken;\n oracle = _oracle;\n // Create an outcome token for each outcome\n for (uint8 i = 0; i < outcomeCount; i++) {\n OutcomeToken outcomeToken = new OutcomeToken();\n outcomeTokens.push(outcomeToken);\n OutcomeTokenCreation(outcomeToken, i);\n }\n }\n\n /// @dev Buys equal number of tokens of all outcomes, exchanging collateral tokens and sets of outcome tokens 1:1\n /// @param collateralTokenCount Number of collateral tokens\n function buyAllOutcomes(uint collateralTokenCount)\n public\n {\n // Transfer collateral tokens to events contract\n require(collateralToken.transferFrom(msg.sender, this, collateralTokenCount));\n // Issue new outcome tokens to sender\n for (uint8 i = 0; i < outcomeTokens.length; i++)\n outcomeTokens[i].issue(msg.sender, collateralTokenCount);\n OutcomeTokenSetIssuance(msg.sender, collateralTokenCount);\n }\n\n /// @dev Sells equal number of tokens of all outcomes, exchanging collateral tokens and sets of outcome tokens 1:1\n /// @param outcomeTokenCount Number of outcome tokens\n function sellAllOutcomes(uint outcomeTokenCount)\n public\n {\n // Revoke sender's outcome tokens of all outcomes\n for (uint8 i = 0; i < outcomeTokens.length; i++)\n outcomeTokens[i].revoke(msg.sender, outcomeTokenCount);\n // Transfer collateral tokens to sender\n require(collateralToken.transfer(msg.sender, outcomeTokenCount));\n OutcomeTokenSetRevocation(msg.sender, outcomeTokenCount);\n }\n\n /// @dev Sets winning event outcome\n function setOutcome()\n public\n {\n // Winning outcome is not set yet in event contract but in oracle contract\n require(!isOutcomeSet && oracle.isOutcomeSet());\n // Set winning outcome\n outcome = oracle.getOutcome();\n isOutcomeSet = true;\n OutcomeAssignment(outcome);\n }\n\n /// @dev Returns outcome count\n /// @return Outcome count\n function getOutcomeCount()\n public\n constant\n returns (uint8)\n {\n return uint8(outcomeTokens.length);\n }\n\n /// @dev Returns outcome tokens array\n /// @return Outcome tokens\n function getOutcomeTokens()\n public\n constant\n returns (OutcomeToken[])\n {\n return outcomeTokens;\n }\n\n /// @dev Returns the amount of outcome tokens held by owner\n /// @return Outcome token distribution\n function getOutcomeTokenDistribution(address owner)\n public\n constant\n returns (uint[] outcomeTokenDistribution)\n {\n outcomeTokenDistribution = new uint[](outcomeTokens.length);\n for (uint8 i = 0; i < outcomeTokenDistribution.length; i++)\n outcomeTokenDistribution[i] = outcomeTokens[i].balanceOf(owner);\n }\n\n /// @dev Calculates and returns event hash\n /// @return Event hash\n function getEventHash() public constant returns (bytes32);\n\n /// @dev Exchanges sender's winning outcome tokens for collateral tokens\n /// @return Sender's winnings\n function redeemWinnings() public returns (uint);\n}\n",
"sourcePath": "@gnosis.pm/pm-contracts/contracts/Events/Event.sol",
"ast": {
"absolutePath": "@gnosis.pm/pm-contracts/contracts/Events/Event.sol",
"exportedSymbols": {
"Event": [
1680
]
},
"id": 1681,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1389,
"literals": [
"solidity",
"^",
"0.4",
".15"
],
"nodeType": "PragmaDirective",
"src": "0:24:6"
},
{
"absolutePath": "@gnosis.pm/pm-contracts/contracts/Tokens/Token.sol",
"file": "../Tokens/Token.sol",
"id": 1390,
"nodeType": "ImportDirective",
"scope": 1681,
"sourceUnit": 3361,
"src": "25:29:6",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "@gnosis.pm/pm-contracts/contracts/Tokens/OutcomeToken.sol",
"file": "../Tokens/OutcomeToken.sol",
"id": 1391,
"nodeType": "ImportDirective",
"scope": 1681,
"sourceUnit": 3086,
"src": "55:36:6",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "@gnosis.pm/pm-contracts/contracts/Oracles/Oracle.sol",
"file": "../Oracles/Oracle.sol",
"id": 1392,
"nodeType": "ImportDirective",
"scope": 1681,
"sourceUnit": 2978,
"src": "92:31:6",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [],
"contractDependencies": [
3085
],
"contractKind": "contract",
"documentation": "@title Event contract - Provide basic functionality required by different event types\n @author Stefan George - <stefan@gnosis.pm>",
"fullyImplemented": false,
"id": 1680,
"linearizedBaseContracts": [
1680
],
"name": "Event",
"nodeType": "ContractDefinition",
"nodes": [
{
"anonymous": false,
"documentation": null,
"id": 1398,
"name": "OutcomeTokenCreation",
"nodeType": "EventDefinition",
"parameters": {
"id": 1397,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1394,
"indexed": false,
"name": "outcomeToken",
"nodeType": "VariableDeclaration",
"scope": 1398,
"src": "342:25:6",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_OutcomeToken_$3085",
"typeString": "contract OutcomeToken"
},
"typeName": {
"contractScope": null,
"id": 1393,
"name": "OutcomeToken",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 3085,
"src": "342:12:6",
"typeDescriptions": {
"typeIdentifier": "t_contract$_OutcomeToken_$3085",
"typeString": "contract OutcomeToken"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1396,
"indexed": false,
"name": "index",
"nodeType": "VariableDeclaration",
"scope": 1398,
"src": "369:11:6",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
},
"typeName": {
"id": 1395,
"name": "uint8",
"nodeType": "ElementaryTypeName",
"src": "369:5:6",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "341:40:6"
},
"src": "315:67:6"
},
{
"anonymous": false,
"documentation": null,
"id": 1404,
"name": "OutcomeTokenSetIssuance",
"nodeType": "EventDefinition",
"parameters": {
"id": 1403,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1400,
"indexed": true,
"name": "buyer",
"nodeType": "VariableDeclaration",
"scope": 1404,
"src": "417:21:6",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1399,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "417:7:6",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1402,
"indexed": false,
"name": "collateralTokenCount",
"nodeType": "VariableDeclaration",
"scope": 1404,
"src": "440:25:6",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1401,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "440:4:6",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "416:50:6"
},
"src": "387:80:6"
},
{
"anonymous": false,
"documentation": null,
"id": 1410,
"name": "OutcomeTokenSetRevocation",
"nodeType": "EventDefinition",
"parameters": {
"id": 1409,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1406,
"indexed": true,
"name": "seller",
"nodeType": "VariableDeclaration",
"scope": 1410,
"src": "504:22:6",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1405,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "504:7:6",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1408,
"indexed": false,
"name": "outcomeTokenCount",
"nodeType": "VariableDeclaration",
"scope": 1410,
"src": "528:22:6",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1407,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "528:4:6",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "503:48:6"
},
"src": "472:80:6"
},
{
"anonymous": false,
"documentation": null,
"id": 1414,
"name": "OutcomeAssignment",
"nodeType": "EventDefinition",
"parameters": {
"id": 1413,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1412,
"indexed": false,
"name": "outcome",
"nodeType": "VariableDeclaration",
"scope": 1414,
"src": "581:11:6",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"typeName": {
"id": 1411,
"name": "int",
"nodeType": "ElementaryTypeName",
"src": "581:3:6",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "580:13:6"
},
"src": "557:37:6"
},
{
"anonymous": false,
"documentation": null,
"id": 1420,
"name": "WinningsRedemption",
"nodeType": "EventDefinition",
"parameters": {
"id": 1419,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1416,
"indexed": true,
"name": "receiver",
"nodeType": "VariableDeclaration",
"scope": 1420,
"src": "624:24:6",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1415,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "624:7:6",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1418,
"indexed": false,
"name": "winnings",
"nodeType": "VariableDeclaration",
"scope": 1420,
"src": "650:13:6",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1417,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "650:4:6",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "623:41:6"
},
"src": "599:66:6"
},
{
"constant": false,
"id": 1422,
"name": "collateralToken",
"nodeType": "VariableDeclaration",
"scope": 1680,
"src": "702:28:6",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Token_$3360",
"typeString": "contract Token"
},
"typeName": {
"contractScope": null,
"id": 1421,
"name": "Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 3360,
"src": "702:5:6",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Token_$3360",
"typeString": "contract Token"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 1424,
"name": "oracle",
"nodeType": "VariableDeclaration",
"scope": 1680,
"src": "736:20:6",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Oracle_$2977",
"typeString": "contract Oracle"
},
"typeName": {
"contractScope": null,
"id": 1423,
"name": "Oracle",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 2977,
"src": "736:6:6",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Oracle_$2977",
"typeString": "contract Oracle"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 1426,
"name": "isOutcomeSet",
"nodeType": "VariableDeclaration",
"scope": 1680,
"src": "762:24:6",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1425,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "762:4:6",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 1428,
"name": "outcome",
"nodeType": "VariableDeclaration",
"scope": 1680,
"src": "792:18:6",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"typeName": {
"id": 1427,
"name": "int",
"nodeType": "ElementaryTypeName",
"src": "792:3:6",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 1431,
"name": "outcomeTokens",
"nodeType": "VariableDeclaration",
"scope": 1680,
"src": "816:35:6",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_OutcomeToken_$3085_$dyn_storage",
"typeString": "contract OutcomeToken[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 1429,
"name": "OutcomeToken",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 3085,
"src": "816:12:6",
"typeDescriptions": {
"typeIdentifier": "t_contract$_OutcomeToken_$3085",
"typeString": "contract OutcomeToken"
}
},
"id": 1430,
"length": null,
"nodeType": "ArrayTypeName",
"src": "816:14:6",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_OutcomeToken_$3085_$dyn_storage_ptr",
"typeString": "contract OutcomeToken[]"
}
},
"value": null,
"visibility": "public"
},
{
"body": {
"id": 1495,
"nodeType": "Block",
"src": "1275:468:6",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 1455,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 1451,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 1445,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1442,
"name": "_collateralToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1433,
"src": "1327:16:6",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Token_$3360",
"typeString": "contract Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_Token_$3360",
"typeString": "contract Token"
}
],
"id": 1441,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1319:7:6",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": "address"
},
"id": 1443,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1319:25:6",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 1444,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1348:1:6",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "1319:30:6",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 1450,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1447,
"name": "_oracle",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1435,
"src": "1361:7:6",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Oracle_$2977",
"typeString": "contract Oracle"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_Oracle_$2977",
"typeString": "contract Oracle"
}
],
"id": 1446,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1353:7:6",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": "address"
},
"id": 1448,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1353:16:6",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 1449,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1373:1:6",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "1353:21:6",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "1319:55:6",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
},
"id": 1454,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1452,
"name": "outcomeCount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1437,
"src": "1378:12:6",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 1453,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1394:1:6",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "1378:17:6",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "1319:76:6",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 1440,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
9183,
9184
],
"referencedDeclaration": 9183,
"src": "1311:7:6",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 1456,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1311:85:6",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1457,
"nodeType": "ExpressionStatement",
"src": "1311:85:6"
},
{
"expression": {
"argumentTypes": null,
"id": 1460,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1458,
"name": "collateralToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1422,
"src": "1406:15:6",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Token_$3360",
"typeString": "contract Token"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 1459,
"name": "_collateralToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1433,
"src": "1424:16:6",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Token_$3360",
"typeString": "contract Token"
}
},
"src": "1406:34:6",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Token_$3360",
"typeString": "contract Token"
}
},
"id": 1461,
"nodeType": "ExpressionStatement",
"src": "1406:34:6"
},
{
"expression": {
"argumentTypes": null,
"id": 1464,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1462,
"name": "oracle",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1424,
"src": "1450:6:6",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Oracle_$2977",
"typeString": "contract Oracle"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 1463,
"name": "_oracle",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1435,
"src": "1459:7:6",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Oracle_$2977",
"typeString": "contract Oracle"
}
},
"src": "1450:16:6",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Oracle_$2977",
"typeString": "contract Oracle"
}
},
"id": 1465,
"nodeType": "ExpressionStatement",
"src": "1450:16:6"
},
{
"body": {
"id": 1493,
"nodeType": "Block",
"src": "1569:168:6",
"statements": [
{
"assignments": [
1477
],
"declarations": [
{
"constant": false,
"id": 1477,
"name": "outcomeToken",
"nodeType": "VariableDeclaration",
"scope": 1496,
"src": "1583:25:6",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_OutcomeToken_$3085",
"typeString": "contract OutcomeToken"
},
"typeName": {
"contractScope": null,
"id": 1476,
"name": "OutcomeToken",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 3085,
"src": "1583:12:6",
"typeDescriptions": {
"typeIdentifier": "t_contract$_OutcomeToken_$3085",
"typeString": "contract OutcomeToken"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1481,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 1479,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "NewExpression",
"src": "1611:16:6",
"typeDescriptions": {
"typeIdentifier": "t_function_creation_nonpayable$__$returns$_t_contract$_OutcomeToken_$3085_$",
"typeString": "function () returns (contract OutcomeToken)"
},
"typeName": {
"contractScope": null,
"id": 1478,
"name": "OutcomeToken",