@josojo/tokenized-events
Version:
tokenized events for pm markets
1,295 lines • 324 kB
JSON
{
"contractName": "EventData",
"abi": [
{
"constant": true,
"inputs": [],
"name": "outcome",
"outputs": [
{
"name": "",
"type": "bytes32"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "content_hash",
"outputs": [
{
"name": "",
"type": "bytes32"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "collateralBranch",
"outputs": [
{
"name": "",
"type": "bytes32"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "minTimeout",
"outputs": [
{
"name": "",
"type": "uint32"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "minBond",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"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": "forkonomicToken",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "questionId",
"outputs": [
{
"name": "",
"type": "bytes32"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "openingTs",
"outputs": [
{
"name": "",
"type": "uint32"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "fSystem",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"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": true,
"name": "receiver",
"type": "address"
},
{
"indexed": false,
"name": "winnings",
"type": "uint256"
},
{
"indexed": false,
"name": "branch",
"type": "bytes32"
}
],
"name": "WinningsRedemption",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "a",
"type": "bytes32"
}
],
"name": "LogB",
"type": "event"
}
],
"bytecode": "0x60806040526101f46006556007805463ffffffff19166201518017905534801561002857600080fd5b506102a8806100386000396000f3006080604052600436106100a35763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166327793f8781146100a857806328047258146100cf578063413d24b9146100e45780634cf71be4146100f9578063831518b7146101275780638abe59ea1461013c578063942032e31461017d578063b06a5c5214610192578063c7049657146101a7578063d440796e146101bc575b600080fd5b3480156100b457600080fd5b506100bd6101d1565b60408051918252519081900360200190f35b3480156100db57600080fd5b506100bd6101d7565b3480156100f057600080fd5b506100bd6101dd565b34801561010557600080fd5b5061010e6101e3565b6040805163ffffffff9092168252519081900360200190f35b34801561013357600080fd5b506100bd6101ef565b34801561014857600080fd5b506101546004356101f5565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561018957600080fd5b5061015461022a565b34801561019e57600080fd5b506100bd610246565b3480156101b357600080fd5b5061010e61024c565b3480156101c857600080fd5b50610154610260565b60085481565b60055481565b60035481565b60075463ffffffff1681565b60065481565b600080548290811061020357fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b60045481565b600754640100000000900463ffffffff1681565b60025473ffffffffffffffffffffffffffffffffffffffff16815600a165627a7a72305820657d2d2ba784f6722bef807c7619117f28614851a6b94d0c4061bbe92433ac550029",
"deployedBytecode": "0x6080604052600436106100a35763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166327793f8781146100a857806328047258146100cf578063413d24b9146100e45780634cf71be4146100f9578063831518b7146101275780638abe59ea1461013c578063942032e31461017d578063b06a5c5214610192578063c7049657146101a7578063d440796e146101bc575b600080fd5b3480156100b457600080fd5b506100bd6101d1565b60408051918252519081900360200190f35b3480156100db57600080fd5b506100bd6101d7565b3480156100f057600080fd5b506100bd6101dd565b34801561010557600080fd5b5061010e6101e3565b6040805163ffffffff9092168252519081900360200190f35b34801561013357600080fd5b506100bd6101ef565b34801561014857600080fd5b506101546004356101f5565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561018957600080fd5b5061015461022a565b34801561019e57600080fd5b506100bd610246565b3480156101b357600080fd5b5061010e61024c565b3480156101c857600080fd5b50610154610260565b60085481565b60055481565b60035481565b60075463ffffffff1681565b60065481565b600080548290811061020357fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b60045481565b600754640100000000900463ffffffff1681565b60025473ffffffffffffffffffffffffffffffffffffffff16815600a165627a7a72305820657d2d2ba784f6722bef807c7619117f28614851a6b94d0c4061bbe92433ac550029",
"sourceMap": "279:825:0:-;;;972:3;947:28;;981:35;;;-1:-1:-1;;981:35:0;1008:8;981:35;;;279:825;5:2:-1;;;;30:1;27;20:12;5:2;279:825:0;;;;;;;",
"deployedSourceMap": "279:825:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1078:22;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1078:22:0;;;;;;;;;;;;;;;;;;;;914:27;;8:9:-1;5:2;;;30:1;27;20:12;5:2;914:27:0;;;;846:31;;8:9:-1;5:2;;;30:1;27;20:12;5:2;846:31:0;;;;981:35;;8:9:-1;5:2;;;30:1;27;20:12;5:2;981:35:0;;;;;;;;;;;;;;;;;;;;;;;947:28;;8:9:-1;5:2;;;30:1;27;20:12;5:2;947:28:0;;;;722:35;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;722:35:0;;;;;;;;;;;;;;;;;;;;;;;;765:38;;8:9:-1;5:2;;;30:1;27;20:12;5:2;765:38:0;;;;883:25;;8:9:-1;5:2;;;30:1;27;20:12;5:2;883:25:0;;;;1022:23;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1022:23:0;;;;809:31;;8:9:-1;5:2;;;30:1;27;20:12;5:2;809:31:0;;;;1078:22;;;;:::o;914:27::-;;;;:::o;846:31::-;;;;:::o;981:35::-;;;;;;:::o;947:28::-;;;;:::o;722:35::-;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;722:35:0;:::o;765:38::-;;;;;;:::o;883:25::-;;;;:::o;1022:23::-;;;;;;;;;:::o;809:31::-;;;;;;:::o",
"source": "pragma solidity ^0.4.24;\nimport \"@gnosis.pm/pm-contracts/contracts/Tokens/Token.sol\";\nimport \"./OutcomeToken.sol\";\nimport \"./Proxy.sol\";\nimport \"@josojo/forkonomics-contracts/contracts/ForkonomicToken.sol\";\nimport \"@realitio/realitio-contracts/truffle/contracts/Realitio.sol\";\n\n\ncontract EventData {\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 WinningsRedemption(address indexed receiver, uint winnings, bytes32 branch);\n event LogB(bytes32 a);\n /*\n * Storage\n */\n OutcomeToken[] public outcomeTokens;\n\n\n ForkonomicToken public forkonomicToken;\n ForkonomicSystem public fSystem;\n bytes32 public collateralBranch;\n bytes32 public questionId;\n bytes32 public content_hash;\n uint256 public minBond = 500;\n uint32 public minTimeout = 60*60*24;\n uint32 public openingTs;\n Realitio realityCheck;\n bytes32 public outcome;\n\n}\n\n/// @title Event contract - Provide basic functionality required by different event types\ncontract Event is Proxied, EventData {\n\n /*\n * Public functions\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(forkonomicToken.transferFrom(msg.sender, this, collateralTokenCount, collateralBranch), \"transfer was not possible\");\n // Issue new outcome tokens to sender\n for (uint8 i = 0; i < outcomeTokens.length; i++)\n outcomeTokens[i].issue(msg.sender, collateralTokenCount);\n emit 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(forkonomicToken.transfer(msg.sender, outcomeTokenCount, collateralBranch), \"transfer failed\");\n emit OutcomeTokenSetRevocation(msg.sender, outcomeTokenCount);\n }\n\n \n /// @dev gets winning event outcome\n /// @param branch is the branch on which a user wants to know the result\n function getOutcome(bytes32 branch, address arbitrator)\n public\n view\n returns (int outcome)\n {\n\n // check that original branch is a father of executionbranch:\n require(fSystem.isFatherOfBranch(collateralBranch, branch), \" not a fahter branch\");\n\n // ensure that arbitrator is white-listed\n require(fSystem.isArbitratorWhitelisted(arbitrator, branch), \"arbitrator not white-listed\");\n\n require(fSystem.branchTimestamp(branch) > realityCheck.getFinalizeTS(questionId) - fSystem.WINDOWTIMESPAN(), \"branch is to old\");\n outcome = int(realityCheck.getFinalAnswerIfMatches(questionId, content_hash, arbitrator, minTimeout, minBond));\n }\n\n /// @dev Returns outcome count\n /// @return Outcome count\n function getOutcomeCount()\n public\n view\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 view\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 view\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}\n",
"sourcePath": "/home/josojo/reality/tokenized-events/contracts/Event.sol",
"ast": {
"absolutePath": "/home/josojo/reality/tokenized-events/contracts/Event.sol",
"exportedSymbols": {
"Event": [
279
],
"EventData": [
66
]
},
"id": 280,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
"^",
"0.4",
".24"
],
"nodeType": "PragmaDirective",
"src": "0:24:0"
},
{
"absolutePath": "@gnosis.pm/pm-contracts/contracts/Tokens/Token.sol",
"file": "@gnosis.pm/pm-contracts/contracts/Tokens/Token.sol",
"id": 2,
"nodeType": "ImportDirective",
"scope": 280,
"sourceUnit": 2704,
"src": "25:60:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/josojo/reality/tokenized-events/contracts/OutcomeToken.sol",
"file": "./OutcomeToken.sol",
"id": 3,
"nodeType": "ImportDirective",
"scope": 280,
"sourceUnit": 1701,
"src": "86:28:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/josojo/reality/tokenized-events/contracts/Proxy.sol",
"file": "./Proxy.sol",
"id": 4,
"nodeType": "ImportDirective",
"scope": 280,
"sourceUnit": 1734,
"src": "115:21:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "@josojo/forkonomics-contracts/contracts/ForkonomicToken.sol",
"file": "@josojo/forkonomics-contracts/contracts/ForkonomicToken.sol",
"id": 5,
"nodeType": "ImportDirective",
"scope": 280,
"sourceUnit": 6227,
"src": "137:69:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "@realitio/realitio-contracts/truffle/contracts/Realitio.sol",
"file": "@realitio/realitio-contracts/truffle/contracts/Realitio.sol",
"id": 6,
"nodeType": "ImportDirective",
"scope": 280,
"sourceUnit": 8290,
"src": "207:69:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 66,
"linearizedBaseContracts": [
66
],
"name": "EventData",
"nodeType": "ContractDefinition",
"nodes": [
{
"anonymous": false,
"documentation": null,
"id": 12,
"name": "OutcomeTokenCreation",
"nodeType": "EventDefinition",
"parameters": {
"id": 11,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8,
"indexed": false,
"name": "outcomeToken",
"nodeType": "VariableDeclaration",
"scope": 12,
"src": "362:25:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_OutcomeToken_$1700",
"typeString": "contract OutcomeToken"
},
"typeName": {
"contractScope": null,
"id": 7,
"name": "OutcomeToken",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 1700,
"src": "362:12:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_OutcomeToken_$1700",
"typeString": "contract OutcomeToken"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 10,
"indexed": false,
"name": "index",
"nodeType": "VariableDeclaration",
"scope": 12,
"src": "389:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
},
"typeName": {
"id": 9,
"name": "uint8",
"nodeType": "ElementaryTypeName",
"src": "389:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "361:40:0"
},
"src": "335:67:0"
},
{
"anonymous": false,
"documentation": null,
"id": 18,
"name": "OutcomeTokenSetIssuance",
"nodeType": "EventDefinition",
"parameters": {
"id": 17,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14,
"indexed": true,
"name": "buyer",
"nodeType": "VariableDeclaration",
"scope": 18,
"src": "437:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 13,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "437:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16,
"indexed": false,
"name": "collateralTokenCount",
"nodeType": "VariableDeclaration",
"scope": 18,
"src": "460:25:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "460:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "436:50:0"
},
"src": "407:80:0"
},
{
"anonymous": false,
"documentation": null,
"id": 24,
"name": "OutcomeTokenSetRevocation",
"nodeType": "EventDefinition",
"parameters": {
"id": 23,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 20,
"indexed": true,
"name": "seller",
"nodeType": "VariableDeclaration",
"scope": 24,
"src": "524:22:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 19,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "524:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 22,
"indexed": false,
"name": "outcomeTokenCount",
"nodeType": "VariableDeclaration",
"scope": 24,
"src": "548:22:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 21,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "548:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "523:48:0"
},
"src": "492:80:0"
},
{
"anonymous": false,
"documentation": null,
"id": 32,
"name": "WinningsRedemption",
"nodeType": "EventDefinition",
"parameters": {
"id": 31,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 26,
"indexed": true,
"name": "receiver",
"nodeType": "VariableDeclaration",
"scope": 32,
"src": "602:24:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 25,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "602:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 28,
"indexed": false,
"name": "winnings",
"nodeType": "VariableDeclaration",
"scope": 32,
"src": "628:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 27,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "628:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 30,
"indexed": false,
"name": "branch",
"nodeType": "VariableDeclaration",
"scope": 32,
"src": "643:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 29,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "643:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "601:57:0"
},
"src": "577:82:0"
},
{
"anonymous": false,
"documentation": null,
"id": 36,
"name": "LogB",
"nodeType": "EventDefinition",
"parameters": {
"id": 35,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 34,
"indexed": false,
"name": "a",
"nodeType": "VariableDeclaration",
"scope": 36,
"src": "675:9:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 33,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "675:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "674:11:0"
},
"src": "664:22:0"
},
{
"constant": false,
"id": 39,
"name": "outcomeTokens",
"nodeType": "VariableDeclaration",
"scope": 66,
"src": "722:35:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_OutcomeToken_$1700_$dyn_storage",
"typeString": "contract OutcomeToken[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 37,
"name": "OutcomeToken",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 1700,
"src": "722:12:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_OutcomeToken_$1700",
"typeString": "contract OutcomeToken"
}
},
"id": 38,
"length": null,
"nodeType": "ArrayTypeName",
"src": "722:14:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_OutcomeToken_$1700_$dyn_storage_ptr",
"typeString": "contract OutcomeToken[]"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 41,
"name": "forkonomicToken",
"nodeType": "VariableDeclaration",
"scope": 66,
"src": "765:38:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ForkonomicToken_$6226",
"typeString": "contract ForkonomicToken"
},
"typeName": {
"contractScope": null,
"id": 40,
"name": "ForkonomicToken",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 6226,
"src": "765:15:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ForkonomicToken_$6226",
"typeString": "contract ForkonomicToken"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 43,
"name": "fSystem",
"nodeType": "VariableDeclaration",
"scope": 66,
"src": "809:31:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ForkonomicSystem_$5270",
"typeString": "contract ForkonomicSystem"
},
"typeName": {
"contractScope": null,
"id": 42,
"name": "ForkonomicSystem",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 5270,
"src": "809:16:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ForkonomicSystem_$5270",
"typeString": "contract ForkonomicSystem"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 45,
"name": "collateralBranch",
"nodeType": "VariableDeclaration",
"scope": 66,
"src": "846:31:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 44,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "846:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 47,
"name": "questionId",
"nodeType": "VariableDeclaration",
"scope": 66,
"src": "883:25:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 46,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "883:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 49,
"name": "content_hash",
"nodeType": "VariableDeclaration",
"scope": 66,
"src": "914:27:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 48,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "914:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 52,
"name": "minBond",
"nodeType": "VariableDeclaration",
"scope": 66,
"src": "947:28:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 50,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "947:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": {
"argumentTypes": null,
"hexValue": "353030",
"id": 51,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "972:3:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_500_by_1",
"typeString": "int_const 500"
},
"value": "500"
},
"visibility": "public"
},
{
"constant": false,
"id": 59,
"name": "minTimeout",
"nodeType": "VariableDeclaration",
"scope": 66,
"src": "981:35:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 53,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "981:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_rational_86400_by_1",
"typeString": "int_const 86400"
},
"id": 58,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_rational_3600_by_1",
"typeString": "int_const 3600"
},
"id": 56,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"hexValue": "3630",
"id": 54,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1008:2:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_60_by_1",
"typeString": "int_const 60"
},
"value": "60"
},
"nodeType": "BinaryOperation",
"operator": "*",
"rightExpression": {
"argumentTypes": null,
"hexValue": "3630",
"id": 55,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1011:2:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_60_by_1",
"typeString": "int_const 60"
},
"value": "60"
},
"src": "1008:5:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_3600_by_1",
"typeString": "int_const 3600"
}
},
"nodeType": "BinaryOperation",
"operator": "*",
"rightExpression": {
"argumentTypes": null,
"hexValue": "3234",
"id": 57,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1014:2:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_24_by_1",
"typeString": "int_const 24"
},
"value": "24"
},
"src": "1008:8:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_86400_by_1",
"typeString": "int_const 86400"
}
},
"visibility": "public"
},
{
"constant": false,
"id": 61,
"name": "openingTs",
"nodeType": "VariableDeclaration",
"scope": 66,
"src": "1022:23:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 60,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "1022:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 63,
"name": "realityCheck",
"nodeType": "VariableDeclaration",
"scope": 66,
"src": "1051:21:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Realitio_$8289",
"typeString": "contract Realitio"
},
"typeName": {
"contractScope": null,
"id": 62,
"name": "Realitio",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 8289,
"src": "1051:8:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Realitio_$8289",
"typeString": "contract Realitio"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 65,
"name": "outcome",
"nodeType": "VariableDeclaration",
"scope": 66,
"src": "1078:22:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 64,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "1078:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "public"
}
],
"scope": 280,
"src": "279:825:0"
},
{
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 67,
"name": "Proxied",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 1705,
"src": "1214:7:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Proxied_$1705",
"typeString": "contract Proxied"
}
},
"id": 68,
"nodeType": "InheritanceSpecifier",
"src": "1214:7:0"
},
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 69,
"name": "EventData",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 66,
"src": "1223:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_EventData_$66",
"typeString": "contract EventData"
}
},
"id": 70,
"nodeType": "InheritanceSpecifier",
"src": "1223:9:0"
}
],
"contractDependencies": [
66,
1705
],
"contractKind": "contract",
"documentation": "@title Event contract - Provide basic functionality required by different event types",
"fullyImplemented": true,
"id": 279,
"linearizedBaseContracts": [
279,
66,
1705
],
"name": "Event",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 114,
"nodeType": "Block",
"src": "1532:443:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 78,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8523,
"src": "1636:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 79,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1636:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 80,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8568,
"src": "1648:4:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Event_$279",
"typeString": "contract Event"
}
},
{
"argumentTypes": null,
"id": 81,
"name": "collateralTokenCount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 72,
"src": "1654:20:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 82,
"name": "collateralBranch",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 45,
"src": "1676:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_contract$_Event_$279",
"typeString": "contract Event"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"expression": {
"argumentTypes": null,
"id": 76,
"name": "forkonomicToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 41,
"src": "1607:15:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ForkonomicToken_$6226",
"typeString": "contract ForkonomicToken"
}
},
"id": 77,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "transferFrom",
"nodeType": "MemberAccess",
"referencedDeclaration": 5822,
"src": "1607:28:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$_t_bytes32_$returns$_t_bool_$",
"typeString": "function (address,address,uint256,bytes32) external returns (bool)"
}
},
"id": 83,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1607:86:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "7472616e7366657220776173206e6f7420706f737369626