@josojo/realitytoken-contracts
Version:
realitytoken basic contracts
969 lines • 32.6 kB
JSON
{
"contractName": "MarketMaker",
"abi": [
{
"constant": true,
"inputs": [
{
"name": "market",
"type": "address"
},
{
"name": "outcomeTokenIndex",
"type": "uint8"
},
{
"name": "outcomeTokenCount",
"type": "uint256"
}
],
"name": "calcCost",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "market",
"type": "address"
},
{
"name": "outcomeTokenIndex",
"type": "uint8"
},
{
"name": "outcomeTokenCount",
"type": "uint256"
}
],
"name": "calcProfit",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "market",
"type": "address"
},
{
"name": "outcomeTokenIndex",
"type": "uint8"
}
],
"name": "calcMarginalPrice",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
],
"bytecode": "0x",
"deployedBytecode": "0x",
"sourceMap": "",
"deployedSourceMap": "",
"source": "pragma solidity ^0.4.15;\nimport \"../Markets/Market.sol\";\n\n\n/// @title Abstract market maker contract - Functions to be implemented by market maker contracts\ncontract MarketMaker {\n\n /*\n * Public functions\n */\n function calcCost(Market market, uint8 outcomeTokenIndex, uint outcomeTokenCount) public constant returns (uint);\n function calcProfit(Market market, uint8 outcomeTokenIndex, uint outcomeTokenCount) public constant returns (uint);\n function calcMarginalPrice(Market market, uint8 outcomeTokenIndex) public constant returns (uint);\n}\n",
"sourcePath": "@gnosis.pm/pm-contracts/contracts/MarketMakers/MarketMaker.sol",
"ast": {
"absolutePath": "@gnosis.pm/pm-contracts/contracts/MarketMakers/MarketMaker.sol",
"exportedSymbols": {
"MarketMaker": [
2251
]
},
"id": 2252,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 2218,
"literals": [
"solidity",
"^",
"0.4",
".15"
],
"nodeType": "PragmaDirective",
"src": "0:24:8"
},
{
"absolutePath": "@gnosis.pm/pm-contracts/contracts/Markets/Market.sol",
"file": "../Markets/Market.sol",
"id": 2219,
"nodeType": "ImportDirective",
"scope": 2252,
"sourceUnit": 2375,
"src": "25:31:8",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": "@title Abstract market maker contract - Functions to be implemented by market maker contracts",
"fullyImplemented": false,
"id": 2251,
"linearizedBaseContracts": [
2251
],
"name": "MarketMaker",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": null,
"documentation": null,
"id": 2230,
"implemented": false,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "calcCost",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2226,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2221,
"name": "market",
"nodeType": "VariableDeclaration",
"scope": 2230,
"src": "243:13:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Market_$2374",
"typeString": "contract Market"
},
"typeName": {
"contractScope": null,
"id": 2220,
"name": "Market",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 2374,
"src": "243:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Market_$2374",
"typeString": "contract Market"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2223,
"name": "outcomeTokenIndex",
"nodeType": "VariableDeclaration",
"scope": 2230,
"src": "258:23:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
},
"typeName": {
"id": 2222,
"name": "uint8",
"nodeType": "ElementaryTypeName",
"src": "258:5:8",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2225,
"name": "outcomeTokenCount",
"nodeType": "VariableDeclaration",
"scope": 2230,
"src": "283:22:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2224,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "283:4:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "242:64:8"
},
"payable": false,
"returnParameters": {
"id": 2229,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2228,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 2230,
"src": "332:4:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2227,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "332:4:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "331:6:8"
},
"scope": 2251,
"src": "225:113:8",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": null,
"documentation": null,
"id": 2241,
"implemented": false,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "calcProfit",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2237,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2232,
"name": "market",
"nodeType": "VariableDeclaration",
"scope": 2241,
"src": "363:13:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Market_$2374",
"typeString": "contract Market"
},
"typeName": {
"contractScope": null,
"id": 2231,
"name": "Market",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 2374,
"src": "363:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Market_$2374",
"typeString": "contract Market"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2234,
"name": "outcomeTokenIndex",
"nodeType": "VariableDeclaration",
"scope": 2241,
"src": "378:23:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
},
"typeName": {
"id": 2233,
"name": "uint8",
"nodeType": "ElementaryTypeName",
"src": "378:5:8",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2236,
"name": "outcomeTokenCount",
"nodeType": "VariableDeclaration",
"scope": 2241,
"src": "403:22:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2235,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "403:4:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "362:64:8"
},
"payable": false,
"returnParameters": {
"id": 2240,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2239,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 2241,
"src": "452:4:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2238,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "452:4:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "451:6:8"
},
"scope": 2251,
"src": "343:115:8",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": null,
"documentation": null,
"id": 2250,
"implemented": false,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "calcMarginalPrice",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2246,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2243,
"name": "market",
"nodeType": "VariableDeclaration",
"scope": 2250,
"src": "490:13:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Market_$2374",
"typeString": "contract Market"
},
"typeName": {
"contractScope": null,
"id": 2242,
"name": "Market",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 2374,
"src": "490:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Market_$2374",
"typeString": "contract Market"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2245,
"name": "outcomeTokenIndex",
"nodeType": "VariableDeclaration",
"scope": 2250,
"src": "505:23:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
},
"typeName": {
"id": 2244,
"name": "uint8",
"nodeType": "ElementaryTypeName",
"src": "505:5:8",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "489:40:8"
},
"payable": false,
"returnParameters": {
"id": 2249,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2248,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 2250,
"src": "555:4:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2247,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "555:4:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "554:6:8"
},
"scope": 2251,
"src": "463:98:8",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
}
],
"scope": 2252,
"src": "157:406:8"
}
],
"src": "0:564:8"
},
"legacyAST": {
"absolutePath": "@gnosis.pm/pm-contracts/contracts/MarketMakers/MarketMaker.sol",
"exportedSymbols": {
"MarketMaker": [
2251
]
},
"id": 2252,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 2218,
"literals": [
"solidity",
"^",
"0.4",
".15"
],
"nodeType": "PragmaDirective",
"src": "0:24:8"
},
{
"absolutePath": "@gnosis.pm/pm-contracts/contracts/Markets/Market.sol",
"file": "../Markets/Market.sol",
"id": 2219,
"nodeType": "ImportDirective",
"scope": 2252,
"sourceUnit": 2375,
"src": "25:31:8",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": "@title Abstract market maker contract - Functions to be implemented by market maker contracts",
"fullyImplemented": false,
"id": 2251,
"linearizedBaseContracts": [
2251
],
"name": "MarketMaker",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": null,
"documentation": null,
"id": 2230,
"implemented": false,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "calcCost",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2226,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2221,
"name": "market",
"nodeType": "VariableDeclaration",
"scope": 2230,
"src": "243:13:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Market_$2374",
"typeString": "contract Market"
},
"typeName": {
"contractScope": null,
"id": 2220,
"name": "Market",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 2374,
"src": "243:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Market_$2374",
"typeString": "contract Market"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2223,
"name": "outcomeTokenIndex",
"nodeType": "VariableDeclaration",
"scope": 2230,
"src": "258:23:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
},
"typeName": {
"id": 2222,
"name": "uint8",
"nodeType": "ElementaryTypeName",
"src": "258:5:8",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2225,
"name": "outcomeTokenCount",
"nodeType": "VariableDeclaration",
"scope": 2230,
"src": "283:22:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2224,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "283:4:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "242:64:8"
},
"payable": false,
"returnParameters": {
"id": 2229,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2228,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 2230,
"src": "332:4:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2227,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "332:4:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "331:6:8"
},
"scope": 2251,
"src": "225:113:8",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": null,
"documentation": null,
"id": 2241,
"implemented": false,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "calcProfit",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2237,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2232,
"name": "market",
"nodeType": "VariableDeclaration",
"scope": 2241,
"src": "363:13:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Market_$2374",
"typeString": "contract Market"
},
"typeName": {
"contractScope": null,
"id": 2231,
"name": "Market",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 2374,
"src": "363:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Market_$2374",
"typeString": "contract Market"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2234,
"name": "outcomeTokenIndex",
"nodeType": "VariableDeclaration",
"scope": 2241,
"src": "378:23:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
},
"typeName": {
"id": 2233,
"name": "uint8",
"nodeType": "ElementaryTypeName",
"src": "378:5:8",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2236,
"name": "outcomeTokenCount",
"nodeType": "VariableDeclaration",
"scope": 2241,
"src": "403:22:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2235,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "403:4:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "362:64:8"
},
"payable": false,
"returnParameters": {
"id": 2240,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2239,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 2241,
"src": "452:4:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2238,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "452:4:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "451:6:8"
},
"scope": 2251,
"src": "343:115:8",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": null,
"documentation": null,
"id": 2250,
"implemented": false,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "calcMarginalPrice",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2246,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2243,
"name": "market",
"nodeType": "VariableDeclaration",
"scope": 2250,
"src": "490:13:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Market_$2374",
"typeString": "contract Market"
},
"typeName": {
"contractScope": null,
"id": 2242,
"name": "Market",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 2374,
"src": "490:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Market_$2374",
"typeString": "contract Market"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2245,
"name": "outcomeTokenIndex",
"nodeType": "VariableDeclaration",
"scope": 2250,
"src": "505:23:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
},
"typeName": {
"id": 2244,
"name": "uint8",
"nodeType": "ElementaryTypeName",
"src": "505:5:8",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "489:40:8"
},
"payable": false,
"returnParameters": {
"id": 2249,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2248,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 2250,
"src": "555:4:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2247,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "555:4:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "554:6:8"
},
"scope": 2251,
"src": "463:98:8",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
}
],
"scope": 2252,
"src": "157:406:8"
}
],
"src": "0:564:8"
},
"compiler": {
"name": "solc",
"version": "0.4.25+commit.59dbf8f1.Emscripten.clang"
},
"networks": {},
"schemaVersion": "3.0.0-beta.1",
"updatedAt": "2018-10-27T21:23:29.096Z"
}