UNPKG

arc_dx

Version:

A platform for building DAOs

1,148 lines (1,147 loc) 97.2 kB
{ "contractName": "ECRecovery", "abi": [], "bytecode": "0x604c602c600b82828239805160001a60731460008114601c57601e565bfe5b5030600052607381538281f30073000000000000000000000000000000000000000030146080604052600080fd00a165627a7a72305820130dbef05ee908120aa7ac0ccc4eba4e5d900d72dc6252c4eae0c6dfe32520a20029", "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fd00a165627a7a72305820130dbef05ee908120aa7ac0ccc4eba4e5d900d72dc6252c4eae0c6dfe32520a20029", "sourceMap": "301:1658:52:-;;132:2:-1;166:7;155:9;146:7;137:37;252:7;246:14;243:1;238:23;232:4;229:33;270:1;265:20;;;;222:63;;265:20;274:9;222:63;;298:9;295:1;288:20;328:4;319:7;311:22;352:7;343;336:24", "deployedSourceMap": "301:1658:52:-;;;;;;;;", "source": "pragma solidity ^0.4.24;\n\n\n/**\n * @title Elliptic curve signature operations\n * @dev Based on https://gist.github.com/axic/5b33912c6f61ae6fd96d6c4a47afde6d\n * TODO Remove this library once solidity supports passing a signature to ecrecover.\n * See https://github.com/ethereum/solidity/issues/864\n */\n\nlibrary ECRecovery {\n\n /**\n * @dev Recover signer address from a message by using their signature\n * @param _hash bytes32 message, the hash is the signed message. What is recovered is the signer address.\n * @param _sig bytes signature, the signature is generated using web3.eth.sign()\n */\n function recover(bytes32 _hash, bytes _sig)\n internal\n pure\n returns (address)\n {\n bytes32 r;\n bytes32 s;\n uint8 v;\n\n // Check the signature length\n if (_sig.length != 65) {\n return (address(0));\n }\n\n // Divide the signature in r, s and v variables\n // ecrecover takes the signature parameters, and the only way to get them\n // currently is to use assembly.\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n r := mload(add(_sig, 32))\n s := mload(add(_sig, 64))\n v := byte(0, mload(add(_sig, 96)))\n }\n\n // Version of signature should be 27 or 28, but 0 and 1 are also possible versions\n if (v < 27) {\n v += 27;\n }\n\n // If the version is correct return the signer address\n if (v != 27 && v != 28) {\n return (address(0));\n } else {\n // solium-disable-next-line arg-overflow\n return ecrecover(_hash, v, r, s);\n }\n }\n\n /**\n * toEthSignedMessageHash\n * @dev prefix a bytes32 value with \"\\x19Ethereum Signed Message:\"\n * and hash the result\n */\n function toEthSignedMessageHash(bytes32 _hash)\n internal\n pure\n returns (bytes32)\n {\n // 32 is the length in bytes of hash,\n // enforced by the type signature above\n return keccak256(\n abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", _hash)\n );\n }\n}\n", "sourcePath": "openzeppelin-solidity/contracts/ECRecovery.sol", "ast": { "absolutePath": "openzeppelin-solidity/contracts/ECRecovery.sol", "exportedSymbols": { "ECRecovery": [ 20669 ] }, "id": 20670, "nodeType": "SourceUnit", "nodes": [ { "id": 20590, "literals": [ "solidity", "^", "0.4", ".24" ], "nodeType": "PragmaDirective", "src": "0:24:52" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "library", "documentation": "@title Elliptic curve signature operations\n@dev Based on https://gist.github.com/axic/5b33912c6f61ae6fd96d6c4a47afde6d\nTODO Remove this library once solidity supports passing a signature to ecrecover.\nSee https://github.com/ethereum/solidity/issues/864", "fullyImplemented": true, "id": 20669, "linearizedBaseContracts": [ 20669 ], "name": "ECRecovery", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 20651, "nodeType": "Block", "src": "691:849:52", "statements": [ { "assignments": [], "declarations": [ { "constant": false, "id": 20600, "name": "r", "nodeType": "VariableDeclaration", "scope": 20652, "src": "697:9:52", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 20599, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "697:7:52", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "id": 20601, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "697:9:52" }, { "assignments": [], "declarations": [ { "constant": false, "id": 20603, "name": "s", "nodeType": "VariableDeclaration", "scope": 20652, "src": "712:9:52", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 20602, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "712:7:52", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "id": 20604, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "712:9:52" }, { "assignments": [], "declarations": [ { "constant": false, "id": 20606, "name": "v", "nodeType": "VariableDeclaration", "scope": 20652, "src": "727:7:52", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "typeName": { "id": 20605, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "727:5:52", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "value": null, "visibility": "internal" } ], "id": 20607, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "727:7:52" }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 20611, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 20608, "name": "_sig", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 20594, "src": "779:4:52", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, "id": 20609, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "length", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "779:11:52", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "hexValue": "3635", "id": 20610, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "794:2:52", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_65_by_1", "typeString": "int_const 65" }, "value": "65" }, "src": "779:17:52", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 20618, "nodeType": "IfStatement", "src": "775:57:52", "trueBody": { "id": 20617, "nodeType": "Block", "src": "798:34:52", "statements": [ { "expression": { "argumentTypes": null, "components": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "30", "id": 20613, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "822:1:52", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" } ], "id": 20612, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "814:7:52", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 20614, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "814:10:52", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "id": 20615, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "TupleExpression", "src": "813:12:52", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "functionReturnParameters": 20598, "id": 20616, "nodeType": "Return", "src": "806:19:52" } ] } }, { "externalReferences": [ { "r": { "declaration": 20600, "isOffset": false, "isSlot": false, "src": "1082:1:52", "valueSize": 1 } }, { "v": { "declaration": 20606, "isOffset": false, "isSlot": false, "src": "1146:1:52", "valueSize": 1 } }, { "_sig": { "declaration": 20594, "isOffset": false, "isSlot": false, "src": "1097:4:52", "valueSize": 1 } }, { "s": { "declaration": 20603, "isOffset": false, "isSlot": false, "src": "1114:1:52", "valueSize": 1 } }, { "_sig": { "declaration": 20594, "isOffset": false, "isSlot": false, "src": "1129:4:52", "valueSize": 1 } }, { "_sig": { "declaration": 20594, "isOffset": false, "isSlot": false, "src": "1169:4:52", "valueSize": 1 } } ], "id": 20619, "nodeType": "InlineAssembly", "operations": "{\n r := mload(add(_sig, 32))\n s := mload(add(_sig, 64))\n v := byte(0, mload(add(_sig, 96)))\n}", "src": "1065:216:52" }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "id": 20622, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 20620, "name": "v", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 20606, "src": "1283:1:52", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "nodeType": "BinaryOperation", "operator": "<", "rightExpression": { "argumentTypes": null, "hexValue": "3237", "id": 20621, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1287:2:52", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_27_by_1", "typeString": "int_const 27" }, "value": "27" }, "src": "1283:6:52", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 20628, "nodeType": "IfStatement", "src": "1279:34:52", "trueBody": { "id": 20627, "nodeType": "Block", "src": "1291:22:52", "statements": [ { "expression": { "argumentTypes": null, "id": 20625, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 20623, "name": "v", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 20606, "src": "1299:1:52", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "nodeType": "Assignment", "operator": "+=", "rightHandSide": { "argumentTypes": null, "hexValue": "3237", "id": 20624, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1304:2:52", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_27_by_1", "typeString": "int_const 27" }, "value": "27" }, "src": "1299:7:52", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "id": 20626, "nodeType": "ExpressionStatement", "src": "1299:7:52" } ] } }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_bool", "typeString": "bool" }, "id": 20635, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "id": 20631, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 20629, "name": "v", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 20606, "src": "1382:1:52", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "hexValue": "3237", "id": 20630, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1387:2:52", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_27_by_1", "typeString": "int_const 27" }, "value": "27" }, "src": "1382:7:52", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "BinaryOperation", "operator": "&&", "rightExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "id": 20634, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 20632, "name": "v", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 20606, "src": "1393:1:52", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "hexValue": "3238", "id": 20633, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1398:2:52", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_28_by_1", "typeString": "int_const 28" }, "value": "28" }, "src": "1393:7:52", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "src": "1382:18:52", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": { "id": 20649, "nodeType": "Block", "src": "1442:94:52", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 20643, "name": "_hash", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 20592, "src": "1514:5:52", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "id": 20644, "name": "v", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 20606, "src": "1521:1:52", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, { "argumentTypes": null, "id": 20645, "name": "r", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 20600, "src": "1524:1:52", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "id": 20646, "name": "s", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 20603, "src": "1527:1:52", "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": 20642, "name": "ecrecover", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 21541, "src": "1504:9:52", "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": 20647, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1504:25:52", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "functionReturnParameters": 20598, "id": 20648, "nodeType": "Return", "src": "1497:32:52" } ] }, "id": 20650, "nodeType": "IfStatement", "src": "1378:158:52", "trueBody": { "id": 20641, "nodeType": "Block", "src": "1402:34:52", "statements": [ { "expression": { "argumentTypes": null, "components": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "30", "id": 20637, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1426:1:52", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" } ], "id": 20636, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "1418:7:52", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 20638, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1418:10:52", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "id": 20639, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "TupleExpression", "src": "1417:12:52", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "functionReturnParameters": 20598, "id": 20640, "nodeType": "Return", "src": "1410:19:52" } ] } } ] }, "documentation": "@dev Recover signer address from a message by using their signature\n@param _hash bytes32 message, the hash is the signed message. What is recovered is the signer address.\n@param _sig bytes signature, the signature is generated using web3.eth.sign()", "id": 20652, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "recover", "nodeType": "FunctionDefinition", "parameters": { "id": 20595, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 20592, "name": "_hash", "nodeType": "VariableDeclaration", "scope": 20652, "src": "618:13:52", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 20591, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "618:7:52", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 20594, "name": "_sig", "nodeType": "VariableDeclaration", "scope": 20652, "src": "633:10:52", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 20593, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "633:5:52", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": null, "visibility": "internal" } ], "src": "617:27:52" }, "payable": false, "returnParameters": { "id": 20598, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 20597, "name": "", "nodeType": "VariableDeclaration", "scope": 20652, "src": "680:7:52", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 20596, "name": "address", "nodeType": "ElementaryTypeName", "src": "680:7:52", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "679:9:52" }, "scope": 20669, "src": "601:939:52", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 20667, "nodeType": "Block", "src": "1771:186:52", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "19457468657265756d205369676e6564204d6573736167653a0a3332", "id": 20662, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1904:34:52", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_178a2411ab6fbc1ba11064408972259c558d0e82fd48b0aba3ad81d14f065e73", "typeString": "literal_string \"\u0019Ethereum Signed Message:\n32\"" }, "value": "\u0019Ethereum Signed Message:\n32" }, { "argumentTypes": null, "id": 20663, "name": "_hash", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 20654, "src": "1940:5:52", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_stringliteral_178a2411ab6fbc1ba11064408972259c558d0e82fd48b0aba3ad81d14f065e73", "typeString": "literal_string \"\u0019Ethereum Signed Message:\n32\"" }, { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } ], "expression": { "argumentTypes": null, "id": 20660, "name": "abi", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 21536, "src": "1887:3:52", "typeDescriptions": { "typeIdentifier": "t_magic_abi", "typeString": "abi" } }, "id": 20661, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "memberName": "encodePacked", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "1887:16:52", "typeDescriptions": { "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", "typeString": "function () pure returns (bytes memory)" } }, "id": 20664, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1887:59:52", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } ], "id": 20659, "name": "keccak256", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 21543, "src": "1870:9:52", "typeDescriptions": { "typeIdentifier": "t_function_sha3_pure$__$returns$_t_bytes32_$", "typeString": "function () pure returns (bytes32)" } }, "id": 20665, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1870:82:52", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "functionReturnParameters": 20658, "id": 20666, "nodeType": "Return", "src": "1863:89:52" } ] }, "documentation": "toEthSignedMessageHash\n@dev prefix a bytes32 value with \"\\x19Ethereum Signed Message:\"\nand hash the result", "id": 20668, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "toEthSignedMessageHash", "nodeType": "FunctionDefinition", "parameters": { "id": 20655, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 20654, "name": "_hash", "nodeType": "VariableDeclaration", "scope": 20668, "src": "1710:13:52", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 20653, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1710:7:52", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "src": "1709:15:52" }, "payable": false, "returnParameters": { "id": 20658, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 20657, "name": "", "nodeType": "VariableDeclaration", "scope": 20668, "src": "1760:7:52", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 20656, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1760:7:52", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "src": "1759:9:52" }, "scope": 20669, "src": "1678:279:52", "stateMutability": "pure", "superFunction": null, "visibility": "internal" } ], "scope": 20670, "src": "301:1658:52" } ], "src": "0:1960:52" }, "legacyAST": { "absolutePath": "openzeppelin-solidity/contracts/ECRecovery.sol",