{ "contractName": "ECDSA", "abi": [], "bytecode": "0x604c602c600b82828239805160001a60731460008114601c57601e565bfe5b5030600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea165627a7a72305820a4cf906d6ea9aa93ea1b7759bf4590611eeeb8558563028254b1eb4653a78a400029", "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea165627a7a72305820a4cf906d6ea9aa93ea1b7759bf4590611eeeb8558563028254b1eb4653a78a400029", "sourceMap": "299:2618:7:-;;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": "299:2618:7:-;;;;;;;;", "source": "pragma solidity ^0.5.2;\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 ECDSA {\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 signature bytes signature, the signature is generated using web3.eth.sign()\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 * toEthSignedMessageHash\n * @dev prefix a bytes32 value with \"\\x19Ethereum Signed Message:\"\n * and hash the result\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": [ 2636 ] }, "id": 2637, "nodeType": "SourceUnit", "nodes": [ { "id": 2557, "literals": [ "solidity", "^", "0.5", ".2" ], "nodeType": "PragmaDirective", "src": "0:23:7" }, { "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": 2636, "linearizedBaseContracts": [ 2636 ], "name": "ECDSA", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 2618, "nodeType": "Block", "src": "696:1804:7", "statements": [ { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2569, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 2566, "name": "signature", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2561, "src": "748:9:7", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, "id": 2567, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "length", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "748:16:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "hexValue": "3635", "id": 2568, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "768:2:7", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_65_by_1", "typeString": "int_const 65" }, "value": "65" }, "src": "748:22:7", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 2576, "nodeType": "IfStatement", "src": "744:72:7", "trueBody": { "id": 2575, "nodeType": "Block", "src": "772:44:7", "statements": [ { "expression": { "argumentTypes": null, "components": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "30", "id": 2571, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "802:1:7", "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": 2570, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "794:7:7", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 2572, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "794:10:7", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } } ], "id": 2573, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "TupleExpression", "src": "793:12:7", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "functionReturnParameters": 2565, "id": 2574, "nodeType": "Return", "src": "786:19:7" } ] } }, { "assignments": [ 2578 ], "declarations": [ { "constant": false, "id": 2578, "name": "r", "nodeType": "VariableDeclaration", "scope": 2618, "src": "882:9:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 2577, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "882:7:7", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "id": 2579, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "882:9:7" }, { "assignments": [ 2581 ], "declarations": [ { "constant": false, "id": 2581, "name": "s", "nodeType": "VariableDeclaration", "scope": 2618, "src": "901:9:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 2580, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "901:7:7", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "id": 2582, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "901:9:7" }, { "assignments": [ 2584 ], "declarations": [ { "constant": false, "id": 2584, "name": "v", "nodeType": "VariableDeclaration", "scope": 2618, "src": "920:7:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "typeName": { "id": 2583, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "920:5:7", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "value": null, "visibility": "internal" } ], "id": 2585, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "920:7:7" }, { "externalReferences": [ { "r": { "declaration": 2578, "isOffset": false, "isSlot": false, "src": "1140:1:7", "valueSize": 1 } }, { "signature": { "declaration": 2561, "isOffset": false, "isSlot": false, "src": "1155:9:7", "valueSize": 1 } }, { "v": { "declaration": 2584, "isOffset": false, "isSlot": false, "src": "1230:1:7", "valueSize": 1 } }, { "s": { "declaration": 2581, "isOffset": false, "isSlot": false, "src": "1185:1:7", "valueSize": 1 } }, { "signature": { "declaration": 2561, "isOffset": false, "isSlot": false, "src": "1200:9:7", "valueSize": 1 } }, { "signature": { "declaration": 2561, "isOffset": false, "isSlot": false, "src": "1253:9:7", "valueSize": 1 } } ], "id": 2586, "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": "1117:1050:7" }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2591, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 2588, "name": "s", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2581, "src": "2177:1:7", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } ], "id": 2587, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "2169:7:7", "typeDescriptions": { "typeIdentifier": "t_type$_t_uint256_$", "typeString": "type(uint256)" }, "typeName": "uint256" }, "id": 2589, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2169:10:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "argumentTypes": null, "hexValue": "307837464646464646464646464646464646464646464646464646464646464646463544353736453733353741343530314444464539324634363638314232304130", "id": 2590, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2182:66:7", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_57896044618658097711785492504343953926418782139537452191302581570759080747168_by_1", "typeString": "int_const 5789...(69 digits omitted)...7168" }, "value": "0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0" }, "src": "2169:79:7", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 2597, "nodeType": "IfStatement", "src": "2165:127:7", "trueBody": { "id": 2596, "nodeType": "Block", "src": "2250:42:7", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "30", "id": 2593, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2279:1:7", "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": 2592, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "2271:7:7", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 2594, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2271:10:7", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "functionReturnParameters": 2565, "id": 2595, "nodeType": "Return", "src": "2264:17:7" } ] } }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_bool", "typeString": "bool" }, "id": 2604, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "id": 2600, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2598, "name": "v", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2584, "src": "2306:1:7", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "hexValue": "3237", "id": 2599, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2311:2:7", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_27_by_1", "typeString": "int_const 27" }, "value": "27" }, "src": "2306:7:7", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "BinaryOperation", "operator": "&&", "rightExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "id": 2603, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2601, "name": "v", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2584, "src": "2317:1:7", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "hexValue": "3238", "id": 2602, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2322:2:7", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_28_by_1", "typeString": "int_const 28" }, "value": "28" }, "src": "2317:7:7", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "src": "2306:18:7", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 2610, "nodeType": "IfStatement", "src": "2302:66:7", "trueBody": { "id": 2609, "nodeType": "Block", "src": "2326:42:7", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "30", "id": 2606, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2355:1:7", "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": 2605, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "2347:7:7", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 2607, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2347:10:7", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "functionReturnParameters": 2565, "id": 2608, "nodeType": "Return", "src": "2340:17:7" } ] } }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 2612, "name": "hash", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2559, "src": "2479:4:7", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "id": 2613, "name": "v", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2584, "src": "2485:1:7", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, { "argumentTypes": null, "id": 2614, "name": "r", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2578, "src": "2488:1:7", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "id": 2615, "name": "s", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2581, "src": "2491:1:7", "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": 2611, "name": "ecrecover", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3281, "src": "2469:9:7", "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": 2616, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2469:24:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "functionReturnParameters": 2565, "id": 2617, "nodeType": "Return", "src": "2462:31:7" } ] }, "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 signature bytes signature, the signature is generated using web3.eth.sign()", "id": 2619, "implemented": true, "kind": "function", "modifiers": [], "name": "recover", "nodeType": "FunctionDefinition", "parameters": { "id": 2562, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2559, "name": "hash", "nodeType": "VariableDeclaration", "scope": 2619, "src": "626:12:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 2558, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "626:7:7", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2561, "name": "signature", "nodeType": "VariableDeclaration", "scope": 2619, "src": "640:22:7", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 2560, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "640:5:7", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": null, "visibility": "internal" } ], "src": "625:38:7" }, "returnParameters": { "id": 2565, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2564, "name": "", "nodeType": "VariableDeclaration", "scope": 2619, "src": "687:7:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2563, "name": "address", "nodeType": "ElementaryTypeName", "src": "687:7:7", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "686:9:7" }, "scope": 2636, "src": "609:1891:7", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 2634, "nodeType": "Block", "src": "2728:187:7", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "19457468657265756d205369676e6564204d6573736167653a0a3332", "id": 2629, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "2866:34:7", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_178a2411ab6fbc1ba11064408972259c558d0e82fd48b0aba3ad81d14f065e73", "typeString": "literal_string \"\u0019Ethereum Signed Message:\n32\"" }, "value": "\u0019Ethereum Signed Message:\n32" }, { "argumentTypes": null, "id": 2630, "name": "hash", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2621, "src": "2902:4:7", "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": 2627, "name": "abi", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3276, "src": "2849:3:7", "typeDescriptions": { "typeIdentifier": "t_magic_abi", "typeString": "abi" } }, "id": 2628, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "memberName": "encodePacked", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "2849:16:7", "typeDescriptions": { "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", "typeString": "function () pure returns (bytes memory)" } }, "id": 2631, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2849:58:7", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } ], "id": 2626, "name": "keccak256", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3283, "src": "2839:9:7", "typeDescriptions": { "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", "typeString": "function (bytes memory) pure returns (bytes32)" } }, "id": 2632, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2839:69:7", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "functionReturnParameters": 2625, "id": 2633, "nodeType": "Return", "src": "2832:76:7" } ] }, "documentation": "toEthSignedMessageHash\n@dev prefix a bytes32 value with \"\\x19Ethereum Signed Message:\"\nand hash the result", "id": 2635, "implemented": true, "kind": "function", "modifiers": [], "name": "toEthSignedMessageHash", "nodeType": "FunctionDefinition", "parameters": { "id": 2622, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2621, "name": "hash", "nodeType": "VariableDeclaration", "scope": 2635, "src": "2682:12:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 2620, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "2682:7:7", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "src": "2681:14:7" }, "returnParameters": { "id": 2625, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2624, "name": "", "nodeType": "VariableDeclaration", "scope": 2635, "src": "2719:7:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 2623, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "2719:7:7", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "src": "2718:9:7" }, "scope": 2636, "src": "2650:265:7", "stateMutability": "pure", "superFunction": null, "visibility": "internal" } ], "scope": 2637, "src": "299:2618:7" } ], "src": "0:2918:7" }, "legacyAST": { "absolutePath": "openzeppelin-solidity/contracts/cryptography/ECDSA.sol", "exportedSymbols": { "ECDSA": [ 2636 ] }, "id": 2637, "nodeType": "SourceUnit", "nodes": [ { "id": 2557, "literals": [ "solidity", "^", "0.5", ".2" ], "nodeType": "PragmaDirective", "src": "0:23:7" }, { "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": 2636, "linearizedBaseContracts": [ 2636 ], "name": "ECDSA", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 2618, "nodeType": "Block", "src": "696:1804:7", "statements": [ { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2569, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 2566, "name": "signature", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2561, "src": "748:9:7", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, "id": 2567, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "length", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "748:16:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "hexValue": "3635", "id": 2568, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "768:2:7", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_65_by_1", "typeString": "int_const 65" }, "value": "65" }, "src": "748:22:7", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 2576, "nodeType": "IfStatement", "src": "744:72:7", "trueBody": { "id": 2575, "nodeType": "Block", "src": "772:44:7", "statements": [ { "expression": { "argumentTypes": null, "components": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "30", "id": 2571, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "802:1:7", "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": 2570, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "794:7:7", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 2572, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "794:10:7", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } } ], "id": 2573, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "TupleExpression", "src": "793:12:7", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "functionReturnParameters": 2565, "id": 2574, "nodeType": "Return", "src": "786:19:7" } ] } }, { "assignments": [ 2578 ], "declarations": [ { "constant": false, "id": 2578, "name": "r", "nodeType": "VariableDeclaration", "scope": 2618, "src": "882:9:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 2577, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "882:7:7", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "id": 2579, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "882:9:7" }, { "assignments": [ 2581 ], "declarations": [ { "constant": false, "id": 2581, "name": "s", "nodeType": "VariableDeclaration", "scope": 2618, "src": "901:9:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 2580, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "901:7:7", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "id": 2582, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "901:9:7" }, { "assignments": [ 2584 ], "declarations": [ { "constant": false, "id": 2584, "name": "v", "nodeType": "VariableDeclaration", "scope": 2618, "src": "920:7:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "typeName": { "id": 2583, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "920:5:7", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "value": null, "visibility": "internal" } ], "id": 2585, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "920:7:7" }, { "externalReferences": [ { "r": { "declaration": 2578, "isOffset": false, "isSlot": false, "src": "1140:1:7", "valueSize": 1 } }, { "signature": { "declaration": 2561, "isOffset": false, "isSlot": false, "src": "1155:9:7", "valueSize": 1 } }, { "v": { "declaration": 2584, "isOffset": false, "isSlot": false, "src": "1230:1:7", "valueSize": 1 } }, { "s": { "declaration": 2581, "isOffset": false, "isSlot": false, "src": "1185:1:7", "valueSize": 1 } }, { "signature": { "declaration": 2561, "isOffset": false, "isSlot": false, "src": "1200:9:7", "valueSize": 1 } }, { "signature": { "declaration": 2561, "isOffset": false, "isSlot": false, "src": "1253:9:7", "valueSize": 1 } } ], "id": 2586, "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": "1117:1050:7" }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2591, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 2588, "name": "s", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2581, "src": "2177:1:7", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } ], "id": 2587, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "2169:7:7", "typeDescriptions": { "typeIdentifier": "t_type$_t_uint256_$", "typeString": "type(uint256)" }, "typeName": "uint256" }, "id": 2589, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2169:10:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "argumentTypes": null, "hexValue": "307837464646464646464646464646464646464646464646464646464646464646463544353736453733353741343530314444464539324634363638314232304130", "id": 2590, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2182:66:7", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_57896044618658097711785492504343953926418782139537452191302581570759080747168_by_1", "typeString": "int_const 5789...(69 digits omitted)...7168" }, "value": "0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0" }, "src": "2169:79:7", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 2597, "nodeType": "IfStatement", "src": "2165:127:7", "trueBody": { "id": 2596, "nodeType": "Block", "src": "2250:42:7", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "30", "id": 2593, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2279:1:7", "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": 2592, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "2271:7:7", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 2594, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2271:10:7", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "functionReturnParameters": 2565, "id": 2595, "nodeType": "Return", "src": "2264:17:7" } ] } }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_bool", "typeString": "bool" }, "id": 2604, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "id": 2600, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2598, "name": "v", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2584, "src": "2306:1:7", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "hexValue": "3237", "id": 2599, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2311:2:7", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_27_by_1", "typeString": "int_const 27" }, "value": "27" }, "src": "2306:7:7", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "BinaryOperation", "operator": "&&", "rightExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "id": 2603, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2601, "name": "v", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2584, "src": "2317:1:7", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "hexValue": "3238", "id": 2602, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2322:2:7", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_28_by_1", "typeString": "int_const 28" }, "value": "28" }, "src": "2317:7:7", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "src": "2306:18:7", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 2610, "nodeType": "IfStatement", "src": "2302:66:7", "trueBody": { "id": 2609, "nodeType": "Block", "src": "2326:42:7", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "30", "id": 2606, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2355:1:7", "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": 2605, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "2347:7:7", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 2607, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2347:10:7", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "functionReturnParameters": 2565, "id": 2608, "nodeType": "Return", "src": "2340:17:7" } ] } }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 2612, "name": "hash", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2559, "src": "2479:4:7", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "id": 2613, "name": "v", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2584, "src": "2485:1:7", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, { "argumentTypes": null, "id": 2614, "name": "r", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2578, "src": "2488:1:7", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "id": 2615, "name": "s", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2581, "src": "2491:1:7", "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": 2611, "name": "ecrecover", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3281, "src": "2469:9:7", "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": 2616, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2469:24:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "functionReturnParameters": 2565, "id": 2617, "nodeType": "Return", "src": "2462:31:7" } ] }, "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 signature bytes signature, the signature is generated using web3.eth.sign()", "id": 2619, "implemented": true, "kind": "function", "modifiers": [], "name": "recover", "nodeType": "FunctionDefinition", "parameters": { "id": 2562, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2559, "name": "hash", "nodeType": "VariableDeclaration", "scope": 2619, "src": "626:12:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 2558, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "626:7:7", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2561, "name": "signature", "nodeType": "VariableDeclaration", "scope": 2619, "src": "640:22:7", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 2560, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "640:5:7", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": null, "visibility": "internal" } ], "src": "625:38:7" }, "returnParameters": { "id": 2565, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2564, "name": "", "nodeType": "VariableDeclaration", "scope": 2619, "src": "687:7:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2563, "name": "address", "nodeType": "ElementaryTypeName", "src": "687:7:7", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "686:9:7" }, "scope": 2636, "src": "609:1891:7", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 2634, "nodeType": "Block", "src": "2728:187:7", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "19457468657265756d205369676e6564204d6573736167653a0a3332", "id": 2629, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "2866:34:7", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_178a2411ab6fbc1ba11064408972259c558d0e82fd48b0aba3ad81d14f065e73", "typeString": "literal_string \"\u0019Ethereum Signed Message:\n32\"" }, "value": "\u0019Ethereum Signed Message:\n32" }, { "argumentTypes": null, "id": 2630, "name": "hash", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2621, "src": "2902:4:7", "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": 2627, "name": "abi", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3276, "src": "2849:3:7", "typeDescriptions": { "typeIdentifier": "t_magic_abi", "typeString": "abi" } }, "id": 2628, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "memberName": "encodePacked", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "2849:16:7", "typeDescriptions": { "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", "typeString": "function () pure returns (bytes memory)" } }, "id": 2631, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2849:58:7", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } ], "id": 2626, "name": "keccak256", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3283, "src": "2839:9:7", "typeDescriptions": { "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", "typeString": "function (bytes memory) pure returns (bytes32)" } }, "id": 2632, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2839:69:7", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "functionReturnParameters": 2625, "id": 2633, "nodeType": "Return", "src": "2832:76:7" } ] }, "documentation": "toEthSignedMessageHash\n@dev prefix a bytes32 value with \"\\x19Ethereum Signed Message:\"\nand hash the result", "id": 2635, "implemented": true, "kind": "function", "modifiers": [], "name": "toEthSignedMessageHash", "nodeType": "FunctionDefinition", "parameters": { "id": 2622, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2621, "name": "hash", "nodeType": "VariableDeclaration", "scope": 2635, "src": "2682:12:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 2620, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "2682:7:7", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "src": "2681:14:7" }, "returnParameters": { "id": 2625, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2624, "name": "", "nodeType": "VariableDeclaration", "scope": 2635, "src": "2719:7:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 2623, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "2719:7:7", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "src": "2718:9:7" }, "scope": 2636, "src": "2650:265:7", "stateMutability": "pure", "superFunction": null, "visibility": "internal" } ], "scope": 2637, "src": "299:2618:7" } ], "src": "0:2918:7" }, "compiler": { "name": "solc", "version": "0.5.2+commit.1df8f40c.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.0.5", "updatedAt": "2019-06-04T10:01:11.423Z", "devdoc": { "details": "Based on https://gist.github.com/axic/5b33912c6f61ae6fd96d6c4a47afde6d TODO Remove this library once solidity supports passing a signature to ecrecover. See https://github.com/ethereum/solidity/issues/864", "methods": {}, "title": "Elliptic curve signature operations" }, "userdoc": { "methods": {} } }