{ "contractName": "ECDSA", "abi": [], "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"details\":\"Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * These functions can be used to verify that a message was signed by the holder of the private keys of a given address.\",\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"openzeppelin-solidity/contracts/cryptography/ECDSA.sol\":\"ECDSA\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"openzeppelin-solidity/contracts/cryptography/ECDSA.sol\":{\"keccak256\":\"0xc89ea7e48ba477b1781b24ae963442fff1bb2af33b6178dad679a3fa2f5ab2de\",\"urls\":[\"bzz-raw://b736ddad8143f8f1cd13c20809d4ebce5f5a8c7725081b0b703294078bd506d1\",\"dweb:/ipfs/QmdhTWCXFCuwG9JaPMjwnhkQoDj9su8R7KMPNvD5z9KeWD\"]}},\"version\":1}", "bytecode": "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a723158202a3a9c3d850c80432d204d797bec771816102c4192a062bc9149a0079e4b932c64736f6c63430005100032", "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a723158202a3a9c3d850c80432d204d797bec771816102c4192a062bc9149a0079e4b932c64736f6c63430005100032", "sourceMap": "231:3417:12:-;;132:2:-1;166:7;155:9;146:7;137:37;255:7;249:14;246:1;241:23;235:4;232:33;222:2;;269:9;222:2;293:9;290:1;283:20;323:4;314:7;306:22;347:7;338;331:24", "deployedSourceMap": "231:3417:12:-;;;;;;;;", "source": "pragma solidity ^0.5.0;\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSA {\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature`. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * NOTE: This call _does not revert_ if the signature is invalid, or\n * if the signer is otherwise unable to be retrieved. In those scenarios,\n * the zero address is returned.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n */\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n // Check the signature length\n if (signature.length != 65) {\n return (address(0));\n }\n\n // Divide the signature in r, s and v variables\n bytes32 r;\n bytes32 s;\n uint8 v;\n\n // ecrecover takes the signature parameters, and the only way to get them\n // currently is to use assembly.\n // solhint-disable-next-line no-inline-assembly\n assembly {\n r := mload(add(signature, 0x20))\n s := mload(add(signature, 0x40))\n v := byte(0, mload(add(signature, 0x60)))\n }\n\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (281): 0 < s < secp256k1n ÷ 2 + 1, and for v in (282): v ∈ {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n //\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n // these malleable signatures as well.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n return address(0);\n }\n\n if (v != 27 && v != 28) {\n return address(0);\n }\n\n // If the signature is valid (and not malleable), return the signer address\n return ecrecover(hash, v, r, s);\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\n * replicates the behavior of the\n * https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign[`eth_sign`]\n * JSON-RPC method.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\n // 32 is the length in bytes of hash,\n // enforced by the type signature above\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", hash));\n }\n}\n", "sourcePath": "openzeppelin-solidity/contracts/cryptography/ECDSA.sol", "ast": { "absolutePath": "openzeppelin-solidity/contracts/cryptography/ECDSA.sol", "exportedSymbols": { "ECDSA": [ 5614 ] }, "id": 5615, "nodeType": "SourceUnit", "nodes": [ { "id": 5535, "literals": [ "solidity", "^", "0.5", ".0" ], "nodeType": "PragmaDirective", "src": "0:23:12" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "library", "documentation": "@dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n * These functions can be used to verify that a message was signed by the holder\nof the private keys of a given address.", "fullyImplemented": true, "id": 5614, "linearizedBaseContracts": [ 5614 ], "name": "ECDSA", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 5596, "nodeType": "Block", "src": "1313:1804:12", "statements": [ { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5547, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 5544, "name": "signature", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5539, "src": "1365:9:12", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, "id": 5545, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "length", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "1365:16:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "hexValue": "3635", "id": 5546, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1385:2:12", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_65_by_1", "typeString": "int_const 65" }, "value": "65" }, "src": "1365:22:12", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 5554, "nodeType": "IfStatement", "src": "1361:72:12", "trueBody": { "id": 5553, "nodeType": "Block", "src": "1389:44:12", "statements": [ { "expression": { "argumentTypes": null, "components": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "30", "id": 5549, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1419:1:12", "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": 5548, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "1411:7:12", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 5550, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1411:10:12", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } } ], "id": 5551, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "TupleExpression", "src": "1410:12:12", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "functionReturnParameters": 5543, "id": 5552, "nodeType": "Return", "src": "1403:19:12" } ] } }, { "assignments": [ 5556 ], "declarations": [ { "constant": false, "id": 5556, "name": "r", "nodeType": "VariableDeclaration", "scope": 5596, "src": "1499:9:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 5555, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1499:7:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "id": 5557, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "1499:9:12" }, { "assignments": [ 5559 ], "declarations": [ { "constant": false, "id": 5559, "name": "s", "nodeType": "VariableDeclaration", "scope": 5596, "src": "1518:9:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 5558, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1518:7:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "id": 5560, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "1518:9:12" }, { "assignments": [ 5562 ], "declarations": [ { "constant": false, "id": 5562, "name": "v", "nodeType": "VariableDeclaration", "scope": 5596, "src": "1537:7:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "typeName": { "id": 5561, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "1537:5:12", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "value": null, "visibility": "internal" } ], "id": 5563, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "1537:7:12" }, { "externalReferences": [ { "r": { "declaration": 5556, "isOffset": false, "isSlot": false, "src": "1757:1:12", "valueSize": 1 } }, { "signature": { "declaration": 5539, "isOffset": false, "isSlot": false, "src": "1772:9:12", "valueSize": 1 } }, { "v": { "declaration": 5562, "isOffset": false, "isSlot": false, "src": "1847:1:12", "valueSize": 1 } }, { "s": { "declaration": 5559, "isOffset": false, "isSlot": false, "src": "1802:1:12", "valueSize": 1 } }, { "signature": { "declaration": 5539, "isOffset": false, "isSlot": false, "src": "1817:9:12", "valueSize": 1 } }, { "signature": { "declaration": 5539, "isOffset": false, "isSlot": false, "src": "1870:9:12", "valueSize": 1 } } ], "id": 5564, "nodeType": "InlineAssembly", "operations": "{\n r := mload(add(signature, 0x20))\n s := mload(add(signature, 0x40))\n v := byte(0, mload(add(signature, 0x60)))\n}", "src": "1734:164:12" }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5569, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 5566, "name": "s", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5559, "src": "2794:1:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } ], "id": 5565, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "2786:7:12", "typeDescriptions": { "typeIdentifier": "t_type$_t_uint256_$", "typeString": "type(uint256)" }, "typeName": "uint256" }, "id": 5567, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2786:10:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "argumentTypes": null, "hexValue": "307837464646464646464646464646464646464646464646464646464646464646463544353736453733353741343530314444464539324634363638314232304130", "id": 5568, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2799:66:12", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_57896044618658097711785492504343953926418782139537452191302581570759080747168_by_1", "typeString": "int_const 5789...(69 digits omitted)...7168" }, "value": "0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0" }, "src": "2786:79:12", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 5575, "nodeType": "IfStatement", "src": "2782:127:12", "trueBody": { "id": 5574, "nodeType": "Block", "src": "2867:42:12", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "30", "id": 5571, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2896:1:12", "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": 5570, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "2888:7:12", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 5572, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2888:10:12", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "functionReturnParameters": 5543, "id": 5573, "nodeType": "Return", "src": "2881:17:12" } ] } }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_bool", "typeString": "bool" }, "id": 5582, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "id": 5578, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5576, "name": "v", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5562, "src": "2923:1:12", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "hexValue": "3237", "id": 5577, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2928:2:12", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_27_by_1", "typeString": "int_const 27" }, "value": "27" }, "src": "2923:7:12", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "BinaryOperation", "operator": "&&", "rightExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "id": 5581, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5579, "name": "v", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5562, "src": "2934:1:12", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "hexValue": "3238", "id": 5580, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2939:2:12", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_28_by_1", "typeString": "int_const 28" }, "value": "28" }, "src": "2934:7:12", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "src": "2923:18:12", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 5588, "nodeType": "IfStatement", "src": "2919:66:12", "trueBody": { "id": 5587, "nodeType": "Block", "src": "2943:42:12", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "30", "id": 5584, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2972:1:12", "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": 5583, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "2964:7:12", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 5585, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2964:10:12", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "functionReturnParameters": 5543, "id": 5586, "nodeType": "Return", "src": "2957:17:12" } ] } }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 5590, "name": "hash", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5537, "src": "3096:4:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "id": 5591, "name": "v", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5562, "src": "3102:1:12", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, { "argumentTypes": null, "id": 5592, "name": "r", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5556, "src": "3105:1:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "id": 5593, "name": "s", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5559, "src": "3108:1:12", "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": 5589, "name": "ecrecover", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6340, "src": "3086:9:12", "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": 5594, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "3086:24:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "functionReturnParameters": 5543, "id": 5595, "nodeType": "Return", "src": "3079:31:12" } ] }, "documentation": "@dev Returns the address that signed a hashed message (`hash`) with\n`signature`. This address can then be used for verification purposes.\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\nthis function rejects them by requiring the `s` value to be in the lower\nhalf order, and the `v` value to be either 27 or 28.\n * NOTE: This call _does not revert_ if the signature is invalid, or\nif the signer is otherwise unable to be retrieved. In those scenarios,\nthe zero address is returned.\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\nverification to be secure: it is possible to craft signatures that\nrecover to arbitrary addresses for non-hashed data. A safe way to ensure\nthis is by receiving a hash of the original message (which may otherwise\nbe too long), and then calling {toEthSignedMessageHash} on it.", "id": 5597, "implemented": true, "kind": "function", "modifiers": [], "name": "recover", "nodeType": "FunctionDefinition", "parameters": { "id": 5540, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5537, "name": "hash", "nodeType": "VariableDeclaration", "scope": 5597, "src": "1243:12:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 5536, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1243:7:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5539, "name": "signature", "nodeType": "VariableDeclaration", "scope": 5597, "src": "1257:22:12", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 5538, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "1257:5:12", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": null, "visibility": "internal" } ], "src": "1242:38:12" }, "returnParameters": { "id": 5543, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5542, "name": "", "nodeType": "VariableDeclaration", "scope": 5597, "src": "1304:7:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 5541, "name": "address", "nodeType": "ElementaryTypeName", "src": "1304:7:12", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "1303:9:12" }, "scope": 5614, "src": "1226:1891:12", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 5612, "nodeType": "Block", "src": "3459:187:12", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "19457468657265756d205369676e6564204d6573736167653a0a3332", "id": 5607, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "3597:34:12", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_178a2411ab6fbc1ba11064408972259c558d0e82fd48b0aba3ad81d14f065e73", "typeString": "literal_string \"\u0019Ethereum Signed Message:\n32\"" }, "value": "\u0019Ethereum Signed Message:\n32" }, { "argumentTypes": null, "id": 5608, "name": "hash", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5599, "src": "3633:4:12", "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": 5605, "name": "abi", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6335, "src": "3580:3:12", "typeDescriptions": { "typeIdentifier": "t_magic_abi", "typeString": "abi" } }, "id": 5606, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "memberName": "encodePacked", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "3580:16:12", "typeDescriptions": { "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", "typeString": "function () pure returns (bytes memory)" } }, "id": 5609, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "3580:58:12", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } ], "id": 5604, "name": "keccak256", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6342, "src": "3570:9:12", "typeDescriptions": { "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", "typeString": "function (bytes memory) pure returns (bytes32)" } }, "id": 5610, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "3570:69:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "functionReturnParameters": 5603, "id": 5611, "nodeType": "Return", "src": "3563:76:12" } ] }, "documentation": "@dev Returns an Ethereum Signed Message, created from a `hash`. This\nreplicates the behavior of the\nhttps://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign[`eth_sign`]\nJSON-RPC method.\n * See {recover}.", "id": 5613, "implemented": true, "kind": "function", "modifiers": [], "name": "toEthSignedMessageHash", "nodeType": "FunctionDefinition", "parameters": { "id": 5600, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5599, "name": "hash", "nodeType": "VariableDeclaration", "scope": 5613, "src": "3413:12:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 5598, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "3413:7:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "src": "3412:14:12" }, "returnParameters": { "id": 5603, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5602, "name": "", "nodeType": "VariableDeclaration", "scope": 5613, "src": "3450:7:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 5601, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "3450:7:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "src": "3449:9:12" }, "scope": 5614, "src": "3381:265:12", "stateMutability": "pure", "superFunction": null, "visibility": "internal" } ], "scope": 5615, "src": "231:3417:12" } ], "src": "0:3649:12" }, "legacyAST": { "absolutePath": "openzeppelin-solidity/contracts/cryptography/ECDSA.sol", "exportedSymbols": { "ECDSA": [ 5614 ] }, "id": 5615, "nodeType": "SourceUnit", "nodes": [ { "id": 5535, "literals": [ "solidity", "^", "0.5", ".0" ], "nodeType": "PragmaDirective", "src": "0:23:12" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "library", "documentation": "@dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n * These functions can be used to verify that a message was signed by the holder\nof the private keys of a given address.", "fullyImplemented": true, "id": 5614, "linearizedBaseContracts": [ 5614 ], "name": "ECDSA", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 5596, "nodeType": "Block", "src": "1313:1804:12", "statements": [ { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5547, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 5544, "name": "signature", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5539, "src": "1365:9:12", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, "id": 5545, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "length", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "1365:16:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "hexValue": "3635", "id": 5546, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1385:2:12", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_65_by_1", "typeString": "int_const 65" }, "value": "65" }, "src": "1365:22:12", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 5554, "nodeType": "IfStatement", "src": "1361:72:12", "trueBody": { "id": 5553, "nodeType": "Block", "src": "1389:44:12", "statements": [ { "expression": { "argumentTypes": null, "components": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "30", "id": 5549, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1419:1:12", "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": 5548, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "1411:7:12", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 5550, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1411:10:12", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } } ], "id": 5551, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "TupleExpression", "src": "1410:12:12", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "functionReturnParameters": 5543, "id": 5552, "nodeType": "Return", "src": "1403:19:12" } ] } }, { "assignments": [ 5556 ], "declarations": [ { "constant": false, "id": 5556, "name": "r", "nodeType": "VariableDeclaration", "scope": 5596, "src": "1499:9:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 5555, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1499:7:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "id": 5557, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "1499:9:12" }, { "assignments": [ 5559 ], "declarations": [ { "constant": false, "id": 5559, "name": "s", "nodeType": "VariableDeclaration", "scope": 5596, "src": "1518:9:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 5558, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1518:7:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "id": 5560, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "1518:9:12" }, { "assignments": [ 5562 ], "declarations": [ { "constant": false, "id": 5562, "name": "v", "nodeType": "VariableDeclaration", "scope": 5596, "src": "1537:7:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "typeName": { "id": 5561, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "1537:5:12", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "value": null, "visibility": "internal" } ], "id": 5563, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "1537:7:12" }, { "externalReferences": [ { "r": { "declaration": 5556, "isOffset": false, "isSlot": false, "src": "1757:1:12", "valueSize": 1 } }, { "signature": { "declaration": 5539, "isOffset": false, "isSlot": false, "src": "1772:9:12", "valueSize": 1 } }, { "v": { "declaration": 5562, "isOffset": false, "isSlot": false, "src": "1847:1:12", "valueSize": 1 } }, { "s": { "declaration": 5559, "isOffset": false, "isSlot": false, "src": "1802:1:12", "valueSize": 1 } }, { "signature": { "declaration": 5539, "isOffset": false, "isSlot": false, "src": "1817:9:12", "valueSize": 1 } }, { "signature": { "declaration": 5539, "isOffset": false, "isSlot": false, "src": "1870:9:12", "valueSize": 1 } } ], "id": 5564, "nodeType": "InlineAssembly", "operations": "{\n r := mload(add(signature, 0x20))\n s := mload(add(signature, 0x40))\n v := byte(0, mload(add(signature, 0x60)))\n}", "src": "1734:164:12" }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5569, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 5566, "name": "s", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5559, "src": "2794:1:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } ], "id": 5565, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "2786:7:12", "typeDescriptions": { "typeIdentifier": "t_type$_t_uint256_$", "typeString": "type(uint256)" }, "typeName": "uint256" }, "id": 5567, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2786:10:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "argumentTypes": null, "hexValue": "307837464646464646464646464646464646464646464646464646464646464646463544353736453733353741343530314444464539324634363638314232304130", "id": 5568, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2799:66:12", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_57896044618658097711785492504343953926418782139537452191302581570759080747168_by_1", "typeString": "int_const 5789...(69 digits omitted)...7168" }, "value": "0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0" }, "src": "2786:79:12", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 5575, "nodeType": "IfStatement", "src": "2782:127:12", "trueBody": { "id": 5574, "nodeType": "Block", "src": "2867:42:12", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "30", "id": 5571, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2896:1:12", "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": 5570, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "2888:7:12", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 5572, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2888:10:12", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "functionReturnParameters": 5543, "id": 5573, "nodeType": "Return", "src": "2881:17:12" } ] } }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_bool", "typeString": "bool" }, "id": 5582, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "id": 5578, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5576, "name": "v", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5562, "src": "2923:1:12", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "hexValue": "3237", "id": 5577, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2928:2:12", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_27_by_1", "typeString": "int_const 27" }, "value": "27" }, "src": "2923:7:12", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "BinaryOperation", "operator": "&&", "rightExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "id": 5581, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5579, "name": "v", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5562, "src": "2934:1:12", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "hexValue": "3238", "id": 5580, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2939:2:12", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_28_by_1", "typeString": "int_const 28" }, "value": "28" }, "src": "2934:7:12", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "src": "2923:18:12", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 5588, "nodeType": "IfStatement", "src": "2919:66:12", "trueBody": { "id": 5587, "nodeType": "Block", "src": "2943:42:12", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "30", "id": 5584, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2972:1:12", "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": 5583, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "2964:7:12", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 5585, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2964:10:12", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "functionReturnParameters": 5543, "id": 5586, "nodeType": "Return", "src": "2957:17:12" } ] } }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 5590, "name": "hash", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5537, "src": "3096:4:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "id": 5591, "name": "v", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5562, "src": "3102:1:12", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, { "argumentTypes": null, "id": 5592, "name": "r", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5556, "src": "3105:1:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "id": 5593, "name": "s", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5559, "src": "3108:1:12", "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": 5589, "name": "ecrecover", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6340, "src": "3086:9:12", "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": 5594, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "3086:24:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "functionReturnParameters": 5543, "id": 5595, "nodeType": "Return", "src": "3079:31:12" } ] }, "documentation": "@dev Returns the address that signed a hashed message (`hash`) with\n`signature`. This address can then be used for verification purposes.\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\nthis function rejects them by requiring the `s` value to be in the lower\nhalf order, and the `v` value to be either 27 or 28.\n * NOTE: This call _does not revert_ if the signature is invalid, or\nif the signer is otherwise unable to be retrieved. In those scenarios,\nthe zero address is returned.\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\nverification to be secure: it is possible to craft signatures that\nrecover to arbitrary addresses for non-hashed data. A safe way to ensure\nthis is by receiving a hash of the original message (which may otherwise\nbe too long), and then calling {toEthSignedMessageHash} on it.", "id": 5597, "implemented": true, "kind": "function", "modifiers": [], "name": "recover", "nodeType": "FunctionDefinition", "parameters": { "id": 5540, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5537, "name": "hash", "nodeType": "VariableDeclaration", "scope": 5597, "src": "1243:12:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 5536, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1243:7:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5539, "name": "signature", "nodeType": "VariableDeclaration", "scope": 5597, "src": "1257:22:12", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 5538, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "1257:5:12", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": null, "visibility": "internal" } ], "src": "1242:38:12" }, "returnParameters": { "id": 5543, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5542, "name": "", "nodeType": "VariableDeclaration", "scope": 5597, "src": "1304:7:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 5541, "name": "address", "nodeType": "ElementaryTypeName", "src": "1304:7:12", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "1303:9:12" }, "scope": 5614, "src": "1226:1891:12", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 5612, "nodeType": "Block", "src": "3459:187:12", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "19457468657265756d205369676e6564204d6573736167653a0a3332", "id": 5607, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "3597:34:12", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_178a2411ab6fbc1ba11064408972259c558d0e82fd48b0aba3ad81d14f065e73", "typeString": "literal_string \"\u0019Ethereum Signed Message:\n32\"" }, "value": "\u0019Ethereum Signed Message:\n32" }, { "argumentTypes": null, "id": 5608, "name": "hash", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5599, "src": "3633:4:12", "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": 5605, "name": "abi", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6335, "src": "3580:3:12", "typeDescriptions": { "typeIdentifier": "t_magic_abi", "typeString": "abi" } }, "id": 5606, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "memberName": "encodePacked", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "3580:16:12", "typeDescriptions": { "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", "typeString": "function () pure returns (bytes memory)" } }, "id": 5609, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "3580:58:12", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } ], "id": 5604, "name": "keccak256", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6342, "src": "3570:9:12", "typeDescriptions": { "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", "typeString": "function (bytes memory) pure returns (bytes32)" } }, "id": 5610, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "3570:69:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "functionReturnParameters": 5603, "id": 5611, "nodeType": "Return", "src": "3563:76:12" } ] }, "documentation": "@dev Returns an Ethereum Signed Message, created from a `hash`. This\nreplicates the behavior of the\nhttps://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign[`eth_sign`]\nJSON-RPC method.\n * See {recover}.", "id": 5613, "implemented": true, "kind": "function", "modifiers": [], "name": "toEthSignedMessageHash", "nodeType": "FunctionDefinition", "parameters": { "id": 5600, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5599, "name": "hash", "nodeType": "VariableDeclaration", "scope": 5613, "src": "3413:12:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 5598, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "3413:7:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "src": "3412:14:12" }, "returnParameters": { "id": 5603, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5602, "name": "", "nodeType": "VariableDeclaration", "scope": 5613, "src": "3450:7:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 5601, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "3450:7:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "src": "3449:9:12" }, "scope": 5614, "src": "3381:265:12", "stateMutability": "pure", "superFunction": null, "visibility": "internal" } ], "scope": 5615, "src": "231:3417:12" } ], "src": "0:3649:12" }, "compiler": { "name": "solc", "version": "0.5.16+commit.9c3226ce.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.1.0", "updatedAt": "2020-04-13T15:29:57.226Z", "devdoc": { "details": "Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * These functions can be used to verify that a message was signed by the holder of the private keys of a given address.", "methods": {} }, "userdoc": { "methods": {} } }