@gnosis.pm/pm-contracts
Version:
Collection of smart contracts for the Gnosis prediction market platform
1,017 lines (1,016 loc) • 220 kB
JSON
{
"contractName": "SignedMessageOracle",
"abi": [
{
"constant": true,
"inputs": [],
"name": "signer",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "outcome",
"outputs": [
{
"name": "",
"type": "int256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "descriptionHash",
"outputs": [
{
"name": "",
"type": "bytes32"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "masterCopy",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "isSet",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "newSigner",
"type": "address"
}
],
"name": "SignerReplacement",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "outcome",
"type": "int256"
}
],
"name": "OutcomeAssignment",
"type": "event"
},
{
"constant": false,
"inputs": [
{
"name": "newSigner",
"type": "address"
},
{
"name": "_nonce",
"type": "uint256"
},
{
"name": "v",
"type": "uint8"
},
{
"name": "r",
"type": "bytes32"
},
{
"name": "s",
"type": "bytes32"
}
],
"name": "replaceSigner",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_outcome",
"type": "int256"
},
{
"name": "v",
"type": "uint8"
},
{
"name": "r",
"type": "bytes32"
},
{
"name": "s",
"type": "bytes32"
}
],
"name": "setOutcome",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "isOutcomeSet",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getOutcome",
"outputs": [
{
"name": "",
"type": "int256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.5.6+commit.b259423e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[],\"name\":\"signer\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"outcome\",\"outputs\":[{\"name\":\"\",\"type\":\"int256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"newSigner\",\"type\":\"address\"},{\"name\":\"_nonce\",\"type\":\"uint256\"},{\"name\":\"v\",\"type\":\"uint8\"},{\"name\":\"r\",\"type\":\"bytes32\"},{\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"replaceSigner\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getOutcome\",\"outputs\":[{\"name\":\"\",\"type\":\"int256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"descriptionHash\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"masterCopy\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"isSet\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"isOutcomeSet\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_outcome\",\"type\":\"int256\"},{\"name\":\"v\",\"type\":\"uint8\"},{\"name\":\"r\",\"type\":\"bytes32\"},{\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"setOutcome\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"newSigner\",\"type\":\"address\"}],\"name\":\"SignerReplacement\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"outcome\",\"type\":\"int256\"}],\"name\":\"OutcomeAssignment\",\"type\":\"event\"}],\"devdoc\":{\"author\":\"Stefan George - <stefan@gnosis.pm>\",\"methods\":{\"getOutcome()\":{\"details\":\"Returns winning outcome\",\"return\":\"Outcome\"},\"isOutcomeSet()\":{\"details\":\"Returns if winning outcome\",\"return\":\"Is outcome set?\"},\"replaceSigner(address,uint256,uint8,bytes32,bytes32)\":{\"details\":\"Replaces signer\",\"params\":{\"_nonce\":\"Unique nonce to prevent replay attacks\",\"newSigner\":\"New signer\",\"r\":\"Signature parameter\",\"s\":\"Signature parameter\",\"v\":\"Signature parameter\"}},\"setOutcome(int256,uint8,bytes32,bytes32)\":{\"details\":\"Sets outcome based on signed message\",\"params\":{\"_outcome\":\"Signed event outcome\",\"r\":\"Signature parameter\",\"s\":\"Signature parameter\",\"v\":\"Signature parameter\"}}},\"title\":\"Signed message oracle contract - Allows to set an outcome with a signed message\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/home/alan/src/github.com/gnosis/pm-contracts/contracts/Oracles/SignedMessageOracle.sol\":\"SignedMessageOracle\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/home/alan/src/github.com/gnosis/pm-contracts/contracts/Oracles/Oracle.sol\":{\"keccak256\":\"0xf4d12f4a59c17e66dfa6791188f621a8914e2038a4e3f72d6fc9fb903ca8e18e\",\"urls\":[\"bzzr://a477ccd203e677cc904b1a4f8fcc85251c5b5e09c5c10eed27e01318584b16d1\"]},\"/home/alan/src/github.com/gnosis/pm-contracts/contracts/Oracles/SignedMessageOracle.sol\":{\"keccak256\":\"0x0707787e68ac6a5efa4f74cbaee26a233d300803283fb61b699121fd8714367a\",\"urls\":[\"bzzr://e30da975b38e3a97a15b3a5354721a381fb5c2544154a00bee84620e834d55b5\"]},\"@gnosis.pm/util-contracts/contracts/Proxy.sol\":{\"keccak256\":\"0xeab0e83a9ec9e7f052c0455a11577061ec6d1994db08dae429abd6faaabf6555\",\"urls\":[\"bzzr://b2c1273d4ec30e2f9e768eea8c510f8493a7359b03e01923d93eea86b57ec145\"]}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b506106e0806100206000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c806385dcee931161006657806385dcee931461018d578063a619486e146101ab578063c65fb380146101f5578063ccdf68f314610217578063d9bf31871461023957610093565b8063238ac9331461009857806327793f87146100e25780635011e399146101005780637e7e4b471461016f575b600080fd5b6100a0610288565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100ea6102ae565b6040518082815260200191505060405180910390f35b61016d600480360360a081101561011657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803560ff16906020019092919080359060200190929190803590602001909291905050506102b4565b005b6101776104ed565b6040518082815260200191505060405180910390f35b6101956104f7565b6040518082815260200191505060405180910390f35b6101b36104fd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101fd610522565b604051808215151515815260200191505060405180910390f35b61021f610535565b604051808215151515815260200191505060405180910390f35b6102866004803603608081101561024f57600080fd5b8101908080359060200190929190803560ff169060200190929190803590602001909291908035906020019092919050505061054c565b005b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461030e57600080fd5b600460009054906101000a900460ff1615801561032c575060035484115b8015610452575060016002548686604051602001808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012084848460405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa1580156103f7573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b61045b57600080fd5b8360038190555084600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508473ffffffffffffffffffffffffffffffffffffffff167fdb3046afd053bee6427d6355ee95671fceb37ee6b944866f9ea86eaa213dac6860405160405180910390a25050505050565b6000600554905090565b60025481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900460ff1681565b6000600460009054906101000a900460ff16905090565b600460009054906101000a900460ff1615801561064c575060016002548560405160200180838152602001828152602001925050506040516020818303038152906040528051906020012084848460405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa1580156105f1573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b61065557600080fd5b6001600460006101000a81548160ff021916908315150217905550836005819055507fb1aaa9f4484acc283375c8e495a44766e4026170797dc9280b4ae2ab5632fb71846040518082815260200191505060405180910390a15050505056fea165627a7a72305820d9607b01c8626383a81cabb355191ef8664c50884cc8a8e3c8cb2066acd2a6bd0029",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100935760003560e01c806385dcee931161006657806385dcee931461018d578063a619486e146101ab578063c65fb380146101f5578063ccdf68f314610217578063d9bf31871461023957610093565b8063238ac9331461009857806327793f87146100e25780635011e399146101005780637e7e4b471461016f575b600080fd5b6100a0610288565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100ea6102ae565b6040518082815260200191505060405180910390f35b61016d600480360360a081101561011657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803560ff16906020019092919080359060200190929190803590602001909291905050506102b4565b005b6101776104ed565b6040518082815260200191505060405180910390f35b6101956104f7565b6040518082815260200191505060405180910390f35b6101b36104fd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101fd610522565b604051808215151515815260200191505060405180910390f35b61021f610535565b604051808215151515815260200191505060405180910390f35b6102866004803603608081101561024f57600080fd5b8101908080359060200190929190803560ff169060200190929190803590602001909291908035906020019092919050505061054c565b005b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461030e57600080fd5b600460009054906101000a900460ff1615801561032c575060035484115b8015610452575060016002548686604051602001808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012084848460405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa1580156103f7573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b61045b57600080fd5b8360038190555084600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508473ffffffffffffffffffffffffffffffffffffffff167fdb3046afd053bee6427d6355ee95671fceb37ee6b944866f9ea86eaa213dac6860405160405180910390a25050505050565b6000600554905090565b60025481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900460ff1681565b6000600460009054906101000a900460ff16905090565b600460009054906101000a900460ff1615801561064c575060016002548560405160200180838152602001828152602001925050506040516020818303038152906040528051906020012084848460405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa1580156105f1573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b61065557600080fd5b6001600460006101000a81548160ff021916908315150217905550836005819055507fb1aaa9f4484acc283375c8e495a44766e4026170797dc9280b4ae2ab5632fb71846040518082815260200191505060405180910390a15050505056fea165627a7a72305820d9607b01c8626383a81cabb355191ef8664c50884cc8a8e3c8cb2066acd2a6bd0029",
"sourceMap": "1304:1762:23:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1304:1762:23;;;;;;;",
"deployedSourceMap": "1304:1762:23:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1304:1762:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;314:21;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;416:18;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1661:463;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;1661:463:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;2957:107;;;:::i;:::-;;;;;;;;;;;;;;;;;;;341:30;;;:::i;:::-;;;;;;;;;;;;;;;;;;;205:25:29;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;393:17:23;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;2782:108;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;2336:368;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;2336:368:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;314:21;;;;;;;;;;;;;:::o;416:18::-;;;;:::o;1661:463::-;572:6;;;;;;;;;;;558:20;;:10;:20;;;550:29;;;;;;1869:5;;;;;;;;;;;1868:6;:40;;;;;1903:5;;1894:6;:14;1868:40;:153;;;;;1938:83;1975:15;;1992:9;2003:6;1958:52;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;1958:52:23;;;1948:63;;;;;;2013:1;2016;2019;1938:83;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1938:83:23;;;;;;;;1928:93;;:6;;;;;;;;;;;:93;;;1868:153;1857:165;;;;;;2040:6;2032:5;:14;;;;2065:9;2056:6;;:18;;;;;;;;;;;;;;;;;;2107:9;2089:28;;;;;;;;;;;;1661:463;;;;;:::o;2957:107::-;3024:3;3050:7;;3043:14;;2957:107;:::o;341:30::-;;;;:::o;205:25:29:-;;;;;;;;;;;;;:::o;393:17:23:-;;;;;;;;;;;;;:::o;2782:108::-;2851:4;2878:5;;;;;;;;;;;2871:12;;2782:108;:::o;2336:368::-;2495:5;;;;;;;;;;;2494:6;:110;;;;;2530:74;2567:15;;2584:8;2550:43;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;2550:43:23;;;2540:54;;;;;;2596:1;2599;2602;2530:74;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2530:74:23;;;;;;;;2520:84;;:6;;;;;;;;;;;:84;;;2494:110;2483:122;;;;;;2623:4;2615:5;;:12;;;;;;;;;;;;;;;;;;2647:8;2637:7;:18;;;;2670:27;2688:8;2670:27;;;;;;;;;;;;;;;;;;2336:368;;;;:::o",
"source": "pragma solidity ^0.5.0;\nimport \"../Oracles/Oracle.sol\";\nimport \"@gnosis.pm/util-contracts/contracts/Proxy.sol\";\n\n\ncontract SignedMessageOracleData {\n\n /*\n * Events\n */\n event SignerReplacement(address indexed newSigner);\n event OutcomeAssignment(int outcome);\n\n /*\n * Storage\n */\n address public signer;\n bytes32 public descriptionHash;\n uint nonce;\n bool public isSet;\n int public outcome;\n\n /*\n * Modifiers\n */\n modifier isSigner () {\n // Only signer is allowed to proceed\n require(msg.sender == signer);\n _;\n }\n}\n\ncontract SignedMessageOracleProxy is Proxy, SignedMessageOracleData {\n\n /// @dev Constructor sets signer address based on signature\n /// @param _descriptionHash Hash identifying off chain event description\n /// @param v Signature parameter\n /// @param r Signature parameter\n /// @param s Signature parameter\n constructor(address proxied, bytes32 _descriptionHash, uint8 v, bytes32 r, bytes32 s)\n Proxy(proxied)\n public\n {\n signer = ecrecover(_descriptionHash, v, r, s);\n descriptionHash = _descriptionHash;\n }\n}\n\n/// @title Signed message oracle contract - Allows to set an outcome with a signed message\n/// @author Stefan George - <stefan@gnosis.pm>\ncontract SignedMessageOracle is Proxied, Oracle, SignedMessageOracleData {\n\n /*\n * Public functions\n */\n /// @dev Replaces signer\n /// @param newSigner New signer\n /// @param _nonce Unique nonce to prevent replay attacks\n /// @param v Signature parameter\n /// @param r Signature parameter\n /// @param s Signature parameter\n function replaceSigner(address newSigner, uint _nonce, uint8 v, bytes32 r, bytes32 s)\n public\n isSigner\n {\n // Result is not set yet and nonce and signer are valid\n require( !isSet\n && _nonce > nonce\n && signer == ecrecover(keccak256(abi.encodePacked(descriptionHash, newSigner, _nonce)), v, r, s));\n nonce = _nonce;\n signer = newSigner;\n emit SignerReplacement(newSigner);\n }\n\n /// @dev Sets outcome based on signed message\n /// @param _outcome Signed event outcome\n /// @param v Signature parameter\n /// @param r Signature parameter\n /// @param s Signature parameter\n function setOutcome(int _outcome, uint8 v, bytes32 r, bytes32 s)\n public\n {\n // Result is not set yet and signer is valid\n require( !isSet\n && signer == ecrecover(keccak256(abi.encodePacked(descriptionHash, _outcome)), v, r, s));\n isSet = true;\n outcome = _outcome;\n emit OutcomeAssignment(_outcome);\n }\n\n /// @dev Returns if winning outcome\n /// @return Is outcome set?\n function isOutcomeSet()\n public\n view\n returns (bool)\n {\n return isSet;\n }\n\n /// @dev Returns winning outcome\n /// @return Outcome\n function getOutcome()\n public\n view\n returns (int)\n {\n return outcome;\n }\n}\n",
"sourcePath": "/home/alan/src/github.com/gnosis/pm-contracts/contracts/Oracles/SignedMessageOracle.sol",
"ast": {
"absolutePath": "/home/alan/src/github.com/gnosis/pm-contracts/contracts/Oracles/SignedMessageOracle.sol",
"exportedSymbols": {
"SignedMessageOracle": [
5030
],
"SignedMessageOracleData": [
4875
],
"SignedMessageOracleProxy": [
4910
]
},
"id": 5031,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 4843,
"literals": [
"solidity",
"^",
"0.5",
".0"
],
"nodeType": "PragmaDirective",
"src": "0:23:23"
},
{
"absolutePath": "/home/alan/src/github.com/gnosis/pm-contracts/contracts/Oracles/Oracle.sol",
"file": "../Oracles/Oracle.sol",
"id": 4844,
"nodeType": "ImportDirective",
"scope": 5031,
"sourceUnit": 4842,
"src": "24:31:23",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "@gnosis.pm/util-contracts/contracts/Proxy.sol",
"file": "@gnosis.pm/util-contracts/contracts/Proxy.sol",
"id": 4845,
"nodeType": "ImportDirective",
"scope": 5031,
"sourceUnit": 6829,
"src": "56:55:23",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 4875,
"linearizedBaseContracts": [
4875
],
"name": "SignedMessageOracleData",
"nodeType": "ContractDefinition",
"nodes": [
{
"anonymous": false,
"documentation": null,
"id": 4849,
"name": "SignerReplacement",
"nodeType": "EventDefinition",
"parameters": {
"id": 4848,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 4847,
"indexed": true,
"name": "newSigner",
"nodeType": "VariableDeclaration",
"scope": 4849,
"src": "208:25:23",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 4846,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "208:7:23",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "207:27:23"
},
"src": "184:51:23"
},
{
"anonymous": false,
"documentation": null,
"id": 4853,
"name": "OutcomeAssignment",
"nodeType": "EventDefinition",
"parameters": {
"id": 4852,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 4851,
"indexed": false,
"name": "outcome",
"nodeType": "VariableDeclaration",
"scope": 4853,
"src": "264:11:23",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"typeName": {
"id": 4850,
"name": "int",
"nodeType": "ElementaryTypeName",
"src": "264:3:23",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "263:13:23"
},
"src": "240:37:23"
},
{
"constant": false,
"id": 4855,
"name": "signer",
"nodeType": "VariableDeclaration",
"scope": 4875,
"src": "314:21:23",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 4854,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "314:7:23",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 4857,
"name": "descriptionHash",
"nodeType": "VariableDeclaration",
"scope": 4875,
"src": "341:30:23",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 4856,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "341:7:23",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 4859,
"name": "nonce",
"nodeType": "VariableDeclaration",
"scope": 4875,
"src": "377:10:23",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 4858,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "377:4:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 4861,
"name": "isSet",
"nodeType": "VariableDeclaration",
"scope": 4875,
"src": "393:17:23",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 4860,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "393:4:23",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 4863,
"name": "outcome",
"nodeType": "VariableDeclaration",
"scope": 4875,
"src": "416:18:23",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"typeName": {
"id": 4862,
"name": "int",
"nodeType": "ElementaryTypeName",
"src": "416:3:23",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"value": null,
"visibility": "public"
},
{
"body": {
"id": 4873,
"nodeType": "Block",
"src": "495:102:23",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 4869,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 4866,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7920,
"src": "558:3:23",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 4867,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "558:10:23",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 4868,
"name": "signer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4855,
"src": "572:6:23",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "558:20:23",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 4865,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
7923,
7924
],
"referencedDeclaration": 7923,
"src": "550:7:23",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 4870,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "550:29:23",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 4871,
"nodeType": "ExpressionStatement",
"src": "550:29:23"
},
{
"id": 4872,
"nodeType": "PlaceholderStatement",
"src": "589:1:23"
}
]
},
"documentation": null,
"id": 4874,
"name": "isSigner",
"nodeType": "ModifierDefinition",
"parameters": {
"id": 4864,
"nodeType": "ParameterList",
"parameters": [],
"src": "492:2:23"
},
"src": "474:123:23",
"visibility": "internal"
}
],
"scope": 5031,
"src": "114:485:23"
},
{
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 4876,
"name": "Proxy",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 6828,
"src": "638:5:23",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Proxy_$6828",
"typeString": "contract Proxy"
}
},
"id": 4877,
"nodeType": "InheritanceSpecifier",
"src": "638:5:23"
},
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 4878,
"name": "SignedMessageOracleData",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 4875,
"src": "645:23:23",
"typeDescriptions": {
"typeIdentifier": "t_contract$_SignedMessageOracleData_$4875",
"typeString": "contract SignedMessageOracleData"
}
},
"id": 4879,
"nodeType": "InheritanceSpecifier",
"src": "645:23:23"
}
],
"contractDependencies": [
4875,
6798,
6828
],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 4910,
"linearizedBaseContracts": [
4910,
4875,
6828,
6798
],
"name": "SignedMessageOracleProxy",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 4908,
"nodeType": "Block",
"src": "1056:106:23",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 4902,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 4895,
"name": "signer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4855,
"src": "1066:6:23",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 4897,
"name": "_descriptionHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4883,
"src": "1085:16:23",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
{
"argumentTypes": null,
"id": 4898,
"name": "v",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4885,
"src": "1103:1:23",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
{
"argumentTypes": null,
"id": 4899,
"name": "r",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4887,
"src": "1106:1:23",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
{
"argumentTypes": null,
"id": 4900,
"name": "s",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4889,
"src": "1109:1:23",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
{
"typeIdentifier": "t_uint8",
"typeString": "uint8"
},
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 4896,
"name": "ecrecover",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7912,
"src": "1075:9:23",
"typeDescriptions": {
"typeIdentifier": "t_function_ecrecover_pure$_t_bytes32_$_t_uint8_$_t_bytes32_$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32,uint8,bytes32,bytes32) pure returns (address)"
}
},
"id": 4901,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1075:36:23",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1066:45:23",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 4903,
"nodeType": "ExpressionStatement",
"src": "1066:45:23"
},
{
"expression": {
"argumentTypes": null,
"id": 4906,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 4904,
"name": "descriptionHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4857,
"src": "1121:15:23",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 4905,
"name": "_descriptionHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4883,
"src": "1139:16:23",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"src": "1121:34:23",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"id": 4907,
"nodeType": "ExpressionStatement",
"src": "1121:34:23"
}
]
},
"documentation": "@dev Constructor sets signer address based on signature\n @param _descriptionHash Hash identifying off chain event description\n @param v Signature parameter\n @param r Signature parameter\n @param s Signature parameter",
"id": 4909,
"implemented": true,
"kind": "constructor",
"modifiers": [
{
"arguments": [
{
"argumentTypes": null,
"id": 4892,
"name": "proxied",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4881,
"src": "1028:7:23",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 4893,
"modifierName": {
"argumentTypes": null,
"id": 4891,
"name": "Proxy",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6828,
"src": "1022:5:23",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_Proxy_$6828_$",
"typeString": "type(contract Proxy)"
}
},
"nodeType": "ModifierInvocation",
"src": "1022:14:23"
}
],
"name": "",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 4890,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 4881,
"name": "proxied",
"nodeType": "VariableDeclaration",
"scope": 4909,
"src": "940:15:23",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 4880,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "940:7:23",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 4883,
"name": "_descriptionHash",
"nodeType": "VariableDeclaration",
"scope": 4909,
"src": "957:24:23",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 4882,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "957:7:23",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 4885,
"name": "v",
"nodeType": "VariableDeclaration",
"scope": 4909,
"src": "983:7:23",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
},
"typeName": {
"id": 4884,
"name": "uint8",
"nodeType": "ElementaryTypeName",
"src": "983:5:23",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 4887,
"name": "r",
"nodeType": "VariableDeclaration",
"scope": 4909,
"src": "992:9:23",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 4886,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "992:7:23",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 4889,
"name": "s",
"nodeType": "VariableDeclaration",
"scope": 4909,
"src": "1003:9:23",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 4888,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "1003:7:23",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",