@gnosis.pm/pm-contracts
Version:
Collection of smart contracts for the Gnosis prediction market platform
1,145 lines • 212 kB
JSON
{
"contractName": "SignedMessageOracleProxy",
"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"
},
{
"inputs": [
{
"name": "proxied",
"type": "address"
},
{
"name": "_descriptionHash",
"type": "bytes32"
},
{
"name": "v",
"type": "uint8"
},
{
"name": "r",
"type": "bytes32"
},
{
"name": "s",
"type": "bytes32"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"payable": true,
"stateMutability": "payable",
"type": "fallback"
},
{
"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"
}
],
"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\":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\"},{\"inputs\":[{\"name\":\"proxied\",\"type\":\"address\"},{\"name\":\"_descriptionHash\",\"type\":\"bytes32\"},{\"name\":\"v\",\"type\":\"uint8\"},{\"name\":\"r\",\"type\":\"bytes32\"},{\"name\":\"s\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"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\":{\"methods\":{\"constructor\":{\"details\":\"Constructor sets signer address based on signature\",\"params\":{\"_descriptionHash\":\"Hash identifying off chain event description\",\"r\":\"Signature parameter\",\"s\":\"Signature parameter\",\"v\":\"Signature parameter\"}}}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/home/alan/src/github.com/gnosis/pm-contracts/contracts/Oracles/SignedMessageOracle.sol\":\"SignedMessageOracleProxy\"},\"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": "0x608060405234801561001057600080fd5b5060405160a080610408833981018060405260a081101561003057600080fd5b81019080805190602001909291908051906020019092919080519060200190929190805190602001909291908051906020019092919050505084600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156100a457600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505060018484848460405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015610142573d6000803e3d6000fd5b50505060206040510351600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550836002819055505050505050610261806101a76000396000f3fe60806040526004361061004a5760003560e01c8063238ac9331461009857806327793f87146100ef57806385dcee931461011a578063a619486e14610145578063c65fb3801461019c575b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050366000803760008036600084600019f43d6000803e8060008114610093573d6000f35b3d6000fd5b3480156100a457600080fd5b506100ad6101cb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156100fb57600080fd5b506101046101f1565b6040518082815260200191505060405180910390f35b34801561012657600080fd5b5061012f6101f7565b6040518082815260200191505060405180910390f35b34801561015157600080fd5b5061015a6101fd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101a857600080fd5b506101b1610222565b604051808215151515815260200191505060405180910390f35b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b60025481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900460ff168156fea165627a7a723058208dd95513738f71dc20ab0d04fd182f45d40c5ba14d50156d9ba2cb878e91e5570029",
"deployedBytecode": "0x60806040526004361061004a5760003560e01c8063238ac9331461009857806327793f87146100ef57806385dcee931461011a578063a619486e14610145578063c65fb3801461019c575b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050366000803760008036600084600019f43d6000803e8060008114610093573d6000f35b3d6000fd5b3480156100a457600080fd5b506100ad6101cb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156100fb57600080fd5b506101046101f1565b6040518082815260200191505060405180910390f35b34801561012657600080fd5b5061012f6101f7565b6040518082815260200191505060405180910390f35b34801561015157600080fd5b5061015a6101fd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101a857600080fd5b506101b1610222565b604051808215151515815260200191505060405180910390f35b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b60025481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900460ff168156fea165627a7a723058208dd95513738f71dc20ab0d04fd182f45d40c5ba14d50156d9ba2cb878e91e5570029",
"sourceMap": "601:563:23:-;;;928:234;8:9:-1;5:2;;;30:1;27;20:12;5:2;928:234:23;;;;;;;;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;928:234:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1028:7;644:1:29;621:25;;:11;:25;;;;613:34;;;;;;670:11;657:10;;:24;;;;;;;;;;;;;;;;;;551:137;1075:36:23;1085:16;1103:1;1106;1109;1075:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1075:36:23;;;;;;;;1066:6;;:45;;;;;;;;;;;;;;;;;;1139:16;1121:15;:34;;;;928:234;;;;;601:563;;;;;;",
"deployedSourceMap": "601:563:23:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;848:19:29;870:10;;;;;;;;;;;848:32;;932:14;929:1;926;913:34;1031:1;1028;1012:14;1009:1;996:11;992:1;988:6;975:58;1067:16;1064:1;1061;1046:38;1104:7;1129:1;1124:38;;;;1195:16;1192:1;1185:27;1124:38;1143:16;1140:1;1133:27;314:21:23;;8:9:-1;5:2;;;30:1;27;20:12;5:2;314:21:23;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;416:18;;8:9:-1;5:2;;;30:1;27;20:12;5:2;416:18:23;;;:::i;:::-;;;;;;;;;;;;;;;;;;;341:30;;8:9:-1;5:2;;;30:1;27;20:12;5:2;341:30:23;;;:::i;:::-;;;;;;;;;;;;;;;;;;;205:25:29;;8:9:-1;5:2;;;30:1;27;20:12;5:2;205:25:29;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;393:17:23;;8:9:-1;5:2;;;30:1;27;20:12;5:2;393:17:23;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;314:21;;;;;;;;;;;;;:::o;416:18::-;;;;:::o;341:30::-;;;;:::o;205:25:29:-;;;;;;;;;;;;;:::o;393:17:23:-;;;;;;;;;;;;;:::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",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "939:74:23"
},
"returnParameters": {
"id": 4894,
"nodeType": "ParameterList",
"parameters": [],
"src": "1056:0:23"
},
"scope": 4910,
"src": "928:234:23",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
}
],
"scope": 5031,
"src": "601:563:23"
},
{
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 4911,
"name": "Proxied",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 6798,
"src": "1336:7:23",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Proxied_$6798",
"typeString": "contract Proxied"
}
},
"id": 4912,
"nodeType": "InheritanceSpecifier",
"src": "1336:7:23"
},
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 4913,
"name": "Oracle",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 4841,
"src": "1345:6:23",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Oracle_$4841",
"typeString": "contract Oracle"
}
},
"id": 4914,
"nodeType": "InheritanceSpecifier",
"src": "1345:6:23"
},
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 4915,
"name": "SignedMessageOracleData",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 4875,
"src": "1353:23:23",
"typeDescriptions": {
"typeIdentifier": "t_contract$_SignedMessageOracleData_$4875",
"typeString": "contract SignedMessageOracleData"
}
},
"id": 4916,
"nodeType": "InheritanceSpecifier",
"src": "1353:23:23"
}
],
"contractDependencies": [
4841,
4875,
6798
],
"contractKind": "contract",
"documentation": "@title Signed message oracle contract - Allows to set an outcome with a signed message\n @author Stefan George - <stefan@gnosis.pm>",
"fullyImplemented": true,
"id": 5030,
"linearizedBaseContracts": [
5030,
4875,
4841,
6798
],
"name": "SignedMessageOracle",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 4968,
"nodeType": "Block",
"src": "1783:341:23",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 4953,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 4937,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 4933,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "1868:6:23",
"subExpression": {
"argumentTypes": null,
"id": 4932,
"name": "isSet",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4861,
"src": "1869:5:23",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 4936,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 4934,
"name": "_nonce",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclarat