UNPKG

@realitio/realitio-contracts

Version:

Collection of smart contracts for the Realitio fact verification platform

1,397 lines (1,396 loc) 401 kB
{ "contractName": "Arbitrator", "abi": [ { "constant": true, "inputs": [], "name": "metadata", "outputs": [ { "name": "", "type": "string" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [], "name": "foreignProxy", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "owner", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [], "name": "foreignChainId", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [ { "name": "", "type": "bytes32" } ], "name": "arbitration_bounties", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "realitio", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "name": "newOwner", "type": "address" } ], "name": "transferOwnership", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "payable": true, "stateMutability": "payable", "type": "fallback" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "question_id", "type": "bytes32" }, { "indexed": false, "name": "fee_paid", "type": "uint256" }, { "indexed": false, "name": "requester", "type": "address" }, { "indexed": false, "name": "remaining", "type": "uint256" } ], "name": "LogRequestArbitration", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "name": "realitio", "type": "address" } ], "name": "LogSetRealitio", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "name": "fee", "type": "uint256" } ], "name": "LogSetQuestionFee", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "name": "fee", "type": "uint256" } ], "name": "LogSetDisputeFee", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "question_id", "type": "bytes32" }, { "indexed": false, "name": "fee", "type": "uint256" } ], "name": "LogSetCustomDisputeFee", "type": "event" }, { "constant": true, "inputs": [], "name": "realitycheck", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "name": "addr", "type": "address" } ], "name": "setRealitio", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "fee", "type": "uint256" } ], "name": "setDisputeFee", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "question_id", "type": "bytes32" }, { "name": "fee", "type": "uint256" } ], "name": "setCustomDisputeFee", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [ { "name": "question_id", "type": "bytes32" } ], "name": "getDisputeFee", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "name": "fee", "type": "uint256" } ], "name": "setQuestionFee", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "question_id", "type": "bytes32" }, { "name": "answer", "type": "bytes32" }, { "name": "answerer", "type": "address" } ], "name": "submitAnswerByArbitrator", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "question_id", "type": "bytes32" }, { "name": "answer", "type": "bytes32" }, { "name": "payee_if_wrong", "type": "address" }, { "name": "last_history_hash", "type": "bytes32" }, { "name": "last_answer_or_commitment_id", "type": "bytes32" }, { "name": "last_answerer", "type": "address" } ], "name": "assignWinnerAndSubmitAnswerByArbitrator", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "question_id", "type": "bytes32" } ], "name": "cancelArbitration", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "question_id", "type": "bytes32" }, { "name": "max_previous", "type": "uint256" } ], "name": "requestArbitration", "outputs": [ { "name": "", "type": "bool" } ], "payable": true, "stateMutability": "payable", "type": "function" }, { "constant": false, "inputs": [ { "name": "addr", "type": "address" } ], "name": "withdraw", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "_token", "type": "address" }, { "name": "addr", "type": "address" } ], "name": "withdrawERC20", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [], "name": "callWithdraw", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "_metadata", "type": "string" } ], "name": "setMetaData", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" } ], "bytecode": "0x", "deployedBytecode": "0x", "sourceMap": "", "deployedSourceMap": "", "source": "pragma solidity ^0.4.25;\n\nimport './Owned.sol';\nimport './IArbitrator.sol';\nimport './IRealitio.sol';\nimport './IERC20.sol';\n\ncontract Arbitrator is Owned, IArbitrator {\n\n IRealitio public realitio;\n\n mapping(bytes32 => uint256) public arbitration_bounties;\n\n uint256 dispute_fee;\n mapping(bytes32 => uint256) custom_dispute_fees;\n\n string public metadata;\n\n event LogRequestArbitration(\n bytes32 indexed question_id,\n uint256 fee_paid,\n address requester,\n uint256 remaining\n );\n\n event LogSetRealitio(\n address realitio\n );\n\n event LogSetQuestionFee(\n uint256 fee\n );\n\n\n event LogSetDisputeFee(\n uint256 fee\n );\n\n event LogSetCustomDisputeFee(\n bytes32 indexed question_id,\n uint256 fee\n );\n\n /// @notice Constructor. Sets the deploying address as owner.\n constructor() \n public {\n owner = msg.sender;\n }\n\n /// @notice Returns the Realitio contract address - deprecated in favour of realitio()\n function realitycheck() \n external view returns(IRealitio) {\n return realitio;\n }\n\n /// @notice Set the Reality Check contract address\n /// @param addr The address of the Reality Check contract\n function setRealitio(address addr) \n onlyOwner \n public {\n realitio = IRealitio(addr);\n emit LogSetRealitio(addr);\n }\n\n /// @notice Set the default fee\n /// @param fee The default fee amount\n function setDisputeFee(uint256 fee) \n onlyOwner \n public {\n dispute_fee = fee;\n emit LogSetDisputeFee(fee);\n }\n\n /// @notice Set a custom fee for this particular question\n /// @param question_id The question in question\n /// @param fee The fee amount\n function setCustomDisputeFee(bytes32 question_id, uint256 fee) \n onlyOwner \n public {\n custom_dispute_fees[question_id] = fee;\n emit LogSetCustomDisputeFee(question_id, fee);\n }\n\n /// @notice Return the dispute fee for the specified question. 0 indicates that we won't arbitrate it.\n /// @param question_id The question in question\n /// @dev Uses a general default, but can be over-ridden on a question-by-question basis.\n function getDisputeFee(bytes32 question_id) \n public view returns (uint256) {\n return (custom_dispute_fees[question_id] > 0) ? custom_dispute_fees[question_id] : dispute_fee;\n }\n\n /// @notice Set a fee for asking a question with us as the arbitrator\n /// @param fee The fee amount\n /// @dev Default is no fee. Unlike the dispute fee, 0 is an acceptable setting.\n /// You could set an impossibly high fee if you want to prevent us being used as arbitrator unless we submit the question.\n /// (Submitting the question ourselves is not implemented here.)\n /// This fee can be used as a revenue source, an anti-spam measure, or both.\n function setQuestionFee(uint256 fee) \n onlyOwner \n public {\n realitio.setQuestionFee(fee);\n emit LogSetQuestionFee(fee);\n }\n\n /// @notice Submit the arbitrator's answer to a question.\n /// @param question_id The question in question\n /// @param answer The answer\n /// @param answerer The answerer. If arbitration changed the answer, it should be the payer. If not, the old answerer.\n function submitAnswerByArbitrator(bytes32 question_id, bytes32 answer, address answerer) \n onlyOwner \n public {\n delete arbitration_bounties[question_id];\n realitio.submitAnswerByArbitrator(question_id, answer, answerer);\n }\n\n /// @notice Submit the arbitrator's answer to a question, assigning the winner automatically.\n /// @param question_id The question in question\n /// @param answer The answer\n /// @param payee_if_wrong The account to by credited as winner if the last answer given is wrong, usually the account that paid the arbitrator\n /// @param last_history_hash The history hash before the final one\n /// @param last_answer_or_commitment_id The last answer given, or the commitment ID if it was a commitment.\n /// @param last_answerer The address that supplied the last answer\n function assignWinnerAndSubmitAnswerByArbitrator(bytes32 question_id, bytes32 answer, address payee_if_wrong, bytes32 last_history_hash, bytes32 last_answer_or_commitment_id, address last_answerer) \n onlyOwner \n public {\n delete arbitration_bounties[question_id];\n realitio.assignWinnerAndSubmitAnswerByArbitrator(question_id, answer, payee_if_wrong, last_history_hash, last_answer_or_commitment_id, last_answerer);\n }\n\n /// @notice Cancel a previous arbitration request\n /// @dev This is intended for situations where the arbitration is happening non-atomically and the fee or something change.\n /// @param question_id The question in question\n function cancelArbitration(bytes32 question_id) \n onlyOwner \n public {\n realitio.cancelArbitration(question_id);\n }\n\n /// @notice Request arbitration, freezing the question until we send submitAnswerByArbitrator\n /// @dev The bounty can be paid only in part, in which case the last person to pay will be considered the payer\n /// Will trigger an error if the notification fails, eg because the question has already been finalized\n /// @param question_id The question in question\n /// @param max_previous If specified, reverts if a bond higher than this was submitted after you sent your transaction.\n function requestArbitration(bytes32 question_id, uint256 max_previous) \n external payable returns (bool) {\n\n uint256 arbitration_fee = getDisputeFee(question_id);\n require(arbitration_fee > 0, \"The arbitrator must have set a non-zero fee for the question\");\n\n arbitration_bounties[question_id] += msg.value;\n uint256 paid = arbitration_bounties[question_id];\n\n if (paid >= arbitration_fee) {\n realitio.notifyOfArbitrationRequest(question_id, msg.sender, max_previous);\n emit LogRequestArbitration(question_id, msg.value, msg.sender, 0);\n return true;\n } else {\n require(!realitio.isFinalized(question_id), \"The question must not have been finalized\");\n emit LogRequestArbitration(question_id, msg.value, msg.sender, arbitration_fee - paid);\n return false;\n }\n\n }\n\n /// @notice Withdraw any accumulated ETH fees to the specified address\n /// @param addr The address to which the balance should be sent\n function withdraw(address addr) \n onlyOwner \n public {\n addr.transfer(address(this).balance); \n }\n\n /// @notice Withdraw any accumulated token fees to the specified address\n /// @param addr The address to which the balance should be sent\n /// @dev Only needed if the Realitio contract used is using an ERC20 token\n /// @dev Also only normally useful if a per-question fee is set, otherwise we only have ETH.\n function withdrawERC20(IERC20 _token, address addr) \n onlyOwner \n public {\n uint256 bal = _token.balanceOf(address(this));\n IERC20(_token).transfer(addr, bal); \n }\n\n function() \n external payable {\n }\n\n /// @notice Withdraw any accumulated question fees from the specified address into this contract\n /// @dev Funds can then be liberated from this contract with our withdraw() function\n /// @dev This works in the same way whether the realitio contract is using ETH or an ERC20 token\n function callWithdraw() \n onlyOwner \n public {\n realitio.withdraw(); \n }\n\n /// @notice Set a metadata string, expected to be JSON, containing things like arbitrator TOS address\n function setMetaData(string _metadata) \n onlyOwner\n external {\n metadata = _metadata;\n }\n\n}\n", "sourcePath": "/home/ed/working/realitio-contracts/truffle/contracts/Arbitrator.sol", "ast": { "absolutePath": "/home/ed/working/realitio-contracts/truffle/contracts/Arbitrator.sol", "exportedSymbols": { "Arbitrator": [ 390 ] }, "id": 391, "nodeType": "SourceUnit", "nodes": [ { "id": 1, "literals": [ "solidity", "^", "0.4", ".25" ], "nodeType": "PragmaDirective", "src": "0:24:0" }, { "absolutePath": "/home/ed/working/realitio-contracts/truffle/contracts/Owned.sol", "file": "./Owned.sol", "id": 2, "nodeType": "ImportDirective", "scope": 391, "sourceUnit": 2749, "src": "26:21:0", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/home/ed/working/realitio-contracts/truffle/contracts/IArbitrator.sol", "file": "./IArbitrator.sol", "id": 3, "nodeType": "ImportDirective", "scope": 391, "sourceUnit": 1271, "src": "48:27:0", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/home/ed/working/realitio-contracts/truffle/contracts/IRealitio.sol", "file": "./IRealitio.sol", "id": 4, "nodeType": "ImportDirective", "scope": 391, "sourceUnit": 1711, "src": "76:25:0", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/home/ed/working/realitio-contracts/truffle/contracts/IERC20.sol", "file": "./IERC20.sol", "id": 5, "nodeType": "ImportDirective", "scope": 391, "sourceUnit": 1353, "src": "102:22:0", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 6, "name": "Owned", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 2748, "src": "149:5:0", "typeDescriptions": { "typeIdentifier": "t_contract$_Owned_$2748", "typeString": "contract Owned" } }, "id": 7, "nodeType": "InheritanceSpecifier", "src": "149:5:0" }, { "arguments": null, "baseName": { "contractScope": null, "id": 8, "name": "IArbitrator", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 1270, "src": "156:11:0", "typeDescriptions": { "typeIdentifier": "t_contract$_IArbitrator_$1270", "typeString": "contract IArbitrator" } }, "id": 9, "nodeType": "InheritanceSpecifier", "src": "156:11:0" } ], "contractDependencies": [ 1365, 1270, 2748 ], "contractKind": "contract", "documentation": null, "fullyImplemented": false, "id": 390, "linearizedBaseContracts": [ 390, 1270, 2748, 1365 ], "name": "Arbitrator", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "id": 11, "name": "realitio", "nodeType": "VariableDeclaration", "scope": 390, "src": "175:25:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_IRealitio_$1710", "typeString": "contract IRealitio" }, "typeName": { "contractScope": null, "id": 10, "name": "IRealitio", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 1710, "src": "175:9:0", "typeDescriptions": { "typeIdentifier": "t_contract$_IRealitio_$1710", "typeString": "contract IRealitio" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 15, "name": "arbitration_bounties", "nodeType": "VariableDeclaration", "scope": 390, "src": "207:55:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", "typeString": "mapping(bytes32 => uint256)" }, "typeName": { "id": 14, "keyType": { "id": 12, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "215:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "Mapping", "src": "207:27:0", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", "typeString": "mapping(bytes32 => uint256)" }, "valueType": { "id": 13, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "226:7:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } }, "value": null, "visibility": "public" }, { "constant": false, "id": 17, "name": "dispute_fee", "nodeType": "VariableDeclaration", "scope": 390, "src": "269:19:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 16, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "269:7:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 21, "name": "custom_dispute_fees", "nodeType": "VariableDeclaration", "scope": 390, "src": "294:47:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", "typeString": "mapping(bytes32 => uint256)" }, "typeName": { "id": 20, "keyType": { "id": 18, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "302:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "Mapping", "src": "294:27:0", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", "typeString": "mapping(bytes32 => uint256)" }, "valueType": { "id": 19, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "313:7:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 23, "name": "metadata", "nodeType": "VariableDeclaration", "scope": 390, "src": "348:22:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_storage", "typeString": "string" }, "typeName": { "id": 22, "name": "string", "nodeType": "ElementaryTypeName", "src": "348:6:0", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "public" }, { "anonymous": false, "documentation": null, "id": 33, "name": "LogRequestArbitration", "nodeType": "EventDefinition", "parameters": { "id": 32, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 25, "indexed": true, "name": "question_id", "nodeType": "VariableDeclaration", "scope": 33, "src": "414:27:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 24, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "414:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 27, "indexed": false, "name": "fee_paid", "nodeType": "VariableDeclaration", "scope": 33, "src": "451:16:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 26, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "451:7:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 29, "indexed": false, "name": "requester", "nodeType": "VariableDeclaration", "scope": 33, "src": "477:17:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 28, "name": "address", "nodeType": "ElementaryTypeName", "src": "477:7:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 31, "indexed": false, "name": "remaining", "nodeType": "VariableDeclaration", "scope": 33, "src": "504:17:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 30, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "504:7:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "404:123:0" }, "src": "377:151:0" }, { "anonymous": false, "documentation": null, "id": 37, "name": "LogSetRealitio", "nodeType": "EventDefinition", "parameters": { "id": 36, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 35, "indexed": false, "name": "realitio", "nodeType": "VariableDeclaration", "scope": 37, "src": "564:16:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 34, "name": "address", "nodeType": "ElementaryTypeName", "src": "564:7:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "554:32:0" }, "src": "534:53:0" }, { "anonymous": false, "documentation": null, "id": 41, "name": "LogSetQuestionFee", "nodeType": "EventDefinition", "parameters": { "id": 40, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 39, "indexed": false, "name": "fee", "nodeType": "VariableDeclaration", "scope": 41, "src": "626:11:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 38, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "626:7:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "616:27:0" }, "src": "593:51:0" }, { "anonymous": false, "documentation": null, "id": 45, "name": "LogSetDisputeFee", "nodeType": "EventDefinition", "parameters": { "id": 44, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 43, "indexed": false, "name": "fee", "nodeType": "VariableDeclaration", "scope": 45, "src": "683:11:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 42, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "683:7:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "673:27:0" }, "src": "651:50:0" }, { "anonymous": false, "documentation": null, "id": 51, "name": "LogSetCustomDisputeFee", "nodeType": "EventDefinition", "parameters": { "id": 50, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 47, "indexed": true, "name": "question_id", "nodeType": "VariableDeclaration", "scope": 51, "src": "745:27:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 46, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "745:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 49, "indexed": false, "name": "fee", "nodeType": "VariableDeclaration", "scope": 51, "src": "782:11:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 48, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "782:7:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "735:64:0" }, "src": "707:93:0" }, { "body": { "id": 59, "nodeType": "Block", "src": "898:35:0", "statements": [ { "expression": { "argumentTypes": null, "id": 57, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 54, "name": "owner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2715, "src": "908:5:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 55, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9703, "src": "916:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 56, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "916:10:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "908:18:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 58, "nodeType": "ExpressionStatement", "src": "908:18:0" } ] }, "documentation": "@notice Constructor. Sets the deploying address as owner.", "id": 60, "implemented": true, "isConstructor": true, "isDeclaredConst": false, "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 52, "nodeType": "ParameterList", "parameters": [], "src": "883:2:0" }, "payable": false, "returnParameters": { "id": 53, "nodeType": "ParameterList", "parameters": [], "src": "898:0:0" }, "scope": 390, "src": "872:61:0", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 67, "nodeType": "Block", "src": "1092:32:0", "statements": [ { "expression": { "argumentTypes": null, "id": 65, "name": "realitio", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11, "src": "1109:8:0", "typeDescriptions": { "typeIdentifier": "t_contract$_IRealitio_$1710", "typeString": "contract IRealitio" } }, "functionReturnParameters": 64, "id": 66, "nodeType": "Return", "src": "1102:15:0" } ] }, "documentation": "@notice Returns the Realitio contract address - deprecated in favour of realitio()", "id": 68, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "realitycheck", "nodeType": "FunctionDefinition", "parameters": { "id": 61, "nodeType": "ParameterList", "parameters": [], "src": "1051:2:0" }, "payable": false, "returnParameters": { "id": 64, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 63, "name": "", "nodeType": "VariableDeclaration", "scope": 68, "src": "1081:9:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_IRealitio_$1710", "typeString": "contract IRealitio" }, "typeName": { "contractScope": null, "id": 62, "name": "IRealitio", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 1710, "src": "1081:9:0", "typeDescriptions": { "typeIdentifier": "t_contract$_IRealitio_$1710", "typeString": "contract IRealitio" } }, "value": null, "visibility": "internal" } ], "src": "1080:11:0" }, "scope": 390, "src": "1030:94:0", "stateMutability": "view", "superFunction": 1192, "visibility": "external" }, { "body": { "id": 85, "nodeType": "Block", "src": "1313:78:0", "statements": [ { "expression": { "argumentTypes": null, "id": 79, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 75, "name": "realitio", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11, "src": "1323:8:0", "typeDescriptions": { "typeIdentifier": "t_contract$_IRealitio_$1710", "typeString": "contract IRealitio" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 77, "name": "addr", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 70, "src": "1344:4:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 76, "name": "IRealitio", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1710, "src": "1334:9:0", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_IRealitio_$1710_$", "typeString": "type(contract IRealitio)" } }, "id": 78, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1334:15:0", "typeDescriptions": { "typeIdentifier": "t_contract$_IRealitio_$1710", "typeString": "contract IRealitio" } }, "src": "1323:26:0", "typeDescriptions": { "typeIdentifier": "t_contract$_IRealitio_$1710", "typeString": "contract IRealitio" } }, "id": 80, "nodeType": "ExpressionStatement", "src": "1323:26:0" }, { "eventCall": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 82, "name": "addr", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 70, "src": "1379:4:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 81, "name": "LogSetRealitio", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 37, "src": "1364:14:0", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, "id": 83, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1364:20:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 84, "nodeType": "EmitStatement", "src": "1359:25:0" } ] }, "documentation": "@notice Set the Reality Check contract address\n @param addr The address of the Reality Check contract", "id": 86, "implemented": true, "isConstructor": false, "isDeclaredConst": false, "modifiers": [ { "arguments": null, "id": 73, "modifierName": { "argumentTypes": null, "id": 72, "name": "onlyOwner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2735, "src": "1291:9:0",