@gnosis.pm/pm-contracts
Version:
Collection of smart contracts for the Gnosis prediction market platform
1,188 lines (1,187 loc) • 207 kB
JSON
{
"contractName": "SignedMessageOracleData",
"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": "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"
}
],
"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\":\"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\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/home/alan/src/github.com/gnosis/pm-contracts/contracts/Oracles/SignedMessageOracle.sol\":\"SignedMessageOracleData\"},\"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": "0x608060405234801561001057600080fd5b50610169806100206000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c8063238ac9331461005157806327793f871461009b57806385dcee93146100b9578063c65fb380146100d7575b600080fd5b6100596100f9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100a361011e565b6040518082815260200191505060405180910390f35b6100c1610124565b6040518082815260200191505060405180910390f35b6100df61012a565b604051808215151515815260200191505060405180910390f35b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60045481565b60015481565b600360009054906101000a900460ff168156fea165627a7a723058201de3522be3c67be64fa9049ad7b8960d5ceead043df895435d7307685ed3e75e0029",
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c8063238ac9331461005157806327793f871461009b57806385dcee93146100b9578063c65fb380146100d7575b600080fd5b6100596100f9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100a361011e565b6040518082815260200191505060405180910390f35b6100c1610124565b6040518082815260200191505060405180910390f35b6100df61012a565b604051808215151515815260200191505060405180910390f35b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60045481565b60015481565b600360009054906101000a900460ff168156fea165627a7a723058201de3522be3c67be64fa9049ad7b8960d5ceead043df895435d7307685ed3e75e0029",
"sourceMap": "114:485:23:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;114:485:23;;;;;;;",
"deployedSourceMap": "114:485:23:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;114:485:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;314:21;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;416:18;;;:::i;:::-;;;;;;;;;;;;;;;;;;;341:30;;;:::i;:::-;;;;;;;;;;;;;;;;;;;393:17;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;314:21;;;;;;;;;;;;;:::o;416:18::-;;;;:::o;341:30::-;;;;:::o;393:17::-;;;;;;;;;;;;;:::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": [],
"referencedDeclaration": 4920,
"src": "1894:6:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"id": 4935,
"name": "nonce",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4859,
"src": "1903:5:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1894:14:23",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "1868:40:23",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 4952,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 4938,
"name": "signer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4855,
"src": "1928:6:23",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 4943,
"name": "descriptionHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4857,
"src": "1975:15:23",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
{
"argumentTypes": null,
"id": 4944,
"name": "newSigner",
"nodeType": "Identifier",