UNPKG

test-contracts-sovryn

Version:

Smart contracts for the Sovryn protocol and external integrations.

983 lines 61.8 kB
{ "id": "0eab36d08bbae6910f3dba245c9a25ff", "_format": "hh-sol-build-info-1", "solcVersion": "0.5.17", "solcLongVersion": "0.5.17+commit.d19bba13", "input": { "language": "Solidity", "sources": { "contracts/openzeppelin/ECDSA.sol": { "content": "pragma solidity >=0.5.0 <0.6.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\t/**\n\t * @dev Returns the address that signed a hashed message (`hash`) with\n\t * `signature`. This address can then be used for verification purposes.\n\t *\n\t * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n\t * this function rejects them by requiring the `s` value to be in the lower\n\t * half order, and the `v` value to be either 27 or 28.\n\t *\n\t * NOTE: This call _does not revert_ if the signature is invalid, or\n\t * if the signer is otherwise unable to be retrieved. In those scenarios,\n\t * the zero address is returned.\n\t *\n\t * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n\t * verification to be secure: it is possible to craft signatures that\n\t * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n\t * this is by receiving a hash of the original message (which may otherwise\n\t * be too long), and then calling {toEthSignedMessageHash} on it.\n\t */\n\tfunction recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n\t\t// Check the signature length\n\t\tif (signature.length != 65) {\n\t\t\treturn (address(0));\n\t\t}\n\n\t\t// Divide the signature in r, s and v variables\n\t\tbytes32 r;\n\t\tbytes32 s;\n\t\tuint8 v;\n\n\t\t// ecrecover takes the signature parameters, and the only way to get them\n\t\t// currently is to use assembly.\n\t\t// solhint-disable-next-line no-inline-assembly\n\t\tassembly {\n\t\t\tr := mload(add(signature, 0x20))\n\t\t\ts := mload(add(signature, 0x40))\n\t\t\tv := byte(0, mload(add(signature, 0x60)))\n\t\t}\n\n\t\t// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n\t\t// unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n\t\t// the valid range for s in (281): 0 < s < secp256k1n ÷ 2 + 1, and for v in (282): v ∈ {27, 28}. Most\n\t\t// signatures from current libraries generate a unique signature with an s-value in the lower half order.\n\t\t//\n\t\t// If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n\t\t// with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n\t\t// vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n\t\t// these malleable signatures as well.\n\t\tif (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n\t\t\treturn address(0);\n\t\t}\n\n\t\tif (v != 27 && v != 28) {\n\t\t\treturn address(0);\n\t\t}\n\n\t\t// If the signature is valid (and not malleable), return the signer address\n\t\treturn ecrecover(hash, v, r, s);\n\t}\n\n\t/**\n\t * @dev Returns an Ethereum Signed Message, created from a `hash`. This\n\t * replicates the behavior of the\n\t * https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign[`eth_sign`]\n\t * JSON-RPC method.\n\t *\n\t * See {recover}.\n\t */\n\tfunction toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\n\t\t// 32 is the length in bytes of hash,\n\t\t// enforced by the type signature above\n\t\treturn keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", hash));\n\t}\n}\n" } }, "settings": { "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "abi", "evm.bytecode", "evm.deployedBytecode", "evm.methodIdentifiers", "devdoc", "userdoc" ], "": [ "ast" ] } } } }, "output": { "contracts": { "contracts/openzeppelin/ECDSA.sol": { "ECDSA": { "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": {} }, "evm": { "bytecode": { "linkReferences": {}, "object": "60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820314ec4fa6c50821ac0ea821733b0d83729dc88a5d513d100cccfd987da0938c164736f6c63430005110032", "opcodes": "PUSH1 0x55 PUSH1 0x23 PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH1 0x0 BYTE PUSH1 0x73 EQ PUSH1 0x16 JUMPI INVALID JUMPDEST ADDRESS PUSH1 0x0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH6 0x627A7A723158 KECCAK256 BALANCE 0x4E 0xC4 STATICCALL PUSH13 0x50821AC0EA821733B0D83729DC DUP9 0xA5 0xD5 SGT 0xD1 STOP 0xCC 0xCF 0xD9 DUP8 0xDA MULMOD CODESIZE 0xC1 PUSH5 0x736F6C6343 STOP SDIV GT STOP ORIGIN ", "sourceMap": "239:3093:0:-;;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" }, "deployedBytecode": { "linkReferences": {}, "object": "73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820314ec4fa6c50821ac0ea821733b0d83729dc88a5d513d100cccfd987da0938c164736f6c63430005110032", "opcodes": "PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH6 0x627A7A723158 KECCAK256 BALANCE 0x4E 0xC4 STATICCALL PUSH13 0x50821AC0EA821733B0D83729DC DUP9 0xA5 0xD5 SGT 0xD1 STOP 0xCC 0xCF 0xD9 DUP8 0xDA MULMOD CODESIZE 0xC1 PUSH5 0x736F6C6343 STOP SDIV GT STOP ORIGIN ", "sourceMap": "239:3093:0:-;;;;;;;;" }, "methodIdentifiers": {} }, "userdoc": { "methods": {} } } } }, "sources": { "contracts/openzeppelin/ECDSA.sol": { "ast": { "absolutePath": "contracts/openzeppelin/ECDSA.sol", "exportedSymbols": { "ECDSA": [ 80 ] }, "id": 81, "nodeType": "SourceUnit", "nodes": [ { "id": 1, "literals": [ "solidity", ">=", "0.5", ".0", "<", "0.6", ".0" ], "nodeType": "PragmaDirective", "src": "0:31:0" }, { "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": 80, "linearizedBaseContracts": [ 80 ], "name": "ECDSA", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 62, "nodeType": "Block", "src": "1264:1585:0", "statements": [ { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 13, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 10, "name": "signature", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5, "src": "1304:9:0", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, "id": 11, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "length", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "1304:16:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "hexValue": "3635", "id": 12, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1324:2:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_65_by_1", "typeString": "int_const 65" }, "value": "65" }, "src": "1304:22:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 20, "nodeType": "IfStatement", "src": "1300:57:0", "trueBody": { "id": 19, "nodeType": "Block", "src": "1328:29:0", "statements": [ { "expression": { "argumentTypes": null, "components": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "30", "id": 15, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1349:1:0", "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": 14, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "1341:7:0", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 16, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1341:10:0", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } } ], "id": 17, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "TupleExpression", "src": "1340:12:0", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "functionReturnParameters": 9, "id": 18, "nodeType": "Return", "src": "1333:19:0" } ] } }, { "assignments": [ 22 ], "declarations": [ { "constant": false, "id": 22, "name": "r", "nodeType": "VariableDeclaration", "scope": 62, "src": "1411:9:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 21, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1411:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "id": 23, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "1411:9:0" }, { "assignments": [ 25 ], "declarations": [ { "constant": false, "id": 25, "name": "s", "nodeType": "VariableDeclaration", "scope": 62, "src": "1424:9:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 24, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1424:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "id": 26, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "1424:9:0" }, { "assignments": [ 28 ], "declarations": [ { "constant": false, "id": 28, "name": "v", "nodeType": "VariableDeclaration", "scope": 62, "src": "1437:7:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "typeName": { "id": 27, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "1437:5:0", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "value": null, "visibility": "internal" } ], "id": 29, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "1437:7:0" }, { "externalReferences": [ { "r": { "declaration": 22, "isOffset": false, "isSlot": false, "src": "1624:1:0", "valueSize": 1 } }, { "signature": { "declaration": 5, "isOffset": false, "isSlot": false, "src": "1639:9:0", "valueSize": 1 } }, { "v": { "declaration": 28, "isOffset": false, "isSlot": false, "src": "1696:1:0", "valueSize": 1 } }, { "s": { "declaration": 25, "isOffset": false, "isSlot": false, "src": "1660:1:0", "valueSize": 1 } }, { "signature": { "declaration": 5, "isOffset": false, "isSlot": false, "src": "1675:9:0", "valueSize": 1 } }, { "signature": { "declaration": 5, "isOffset": false, "isSlot": false, "src": "1719:9:0", "valueSize": 1 } } ], "id": 30, "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": "1610:131:0" }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 35, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 32, "name": "s", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 25, "src": "2577:1:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } ], "id": 31, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "2569:7:0", "typeDescriptions": { "typeIdentifier": "t_type$_t_uint256_$", "typeString": "type(uint256)" }, "typeName": "uint256" }, "id": 33, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2569:10:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "argumentTypes": null, "hexValue": "307837464646464646464646464646464646464646464646464646464646464646463544353736453733353741343530314444464539324634363638314232304130", "id": 34, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2582:66:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_57896044618658097711785492504343953926418782139537452191302581570759080747168_by_1", "typeString": "int_const 5789...(69 digits omitted)...7168" }, "value": "0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0" }, "src": "2569:79:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 41, "nodeType": "IfStatement", "src": "2565:112:0", "trueBody": { "id": 40, "nodeType": "Block", "src": "2650:27:0", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "30", "id": 37, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2670:1:0", "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": 36, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "2662:7:0", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 38, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2662:10:0", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "functionReturnParameters": 9, "id": 39, "nodeType": "Return", "src": "2655:17:0" } ] } }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_bool", "typeString": "bool" }, "id": 48, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "id": 44, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 42, "name": "v", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 28, "src": "2685:1:0", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "hexValue": "3237", "id": 43, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2690:2:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_27_by_1", "typeString": "int_const 27" }, "value": "27" }, "src": "2685:7:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "BinaryOperation", "operator": "&&", "rightExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "id": 47, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 45, "name": "v", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 28, "src": "2696:1:0", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "hexValue": "3238", "id": 46, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2701:2:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_28_by_1", "typeString": "int_const 28" }, "value": "28" }, "src": "2696:7:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "src": "2685:18:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 54, "nodeType": "IfStatement", "src": "2681:51:0", "trueBody": { "id": 53, "nodeType": "Block", "src": "2705:27:0", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "30", "id": 50, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2725:1:0", "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": 49, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "2717:7:0", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 51, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2717:10:0", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "functionReturnParameters": 9, "id": 52, "nodeType": "Return", "src": "2710:17:0" } ] } }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 56, "name": "hash", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3, "src": "2831:4:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "id": 57, "name": "v", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 28, "src": "2837:1:0", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, { "argumentTypes": null, "id": 58, "name": "r", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 22, "src": "2840:1:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "id": 59, "name": "s", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 25, "src": "2843:1:0", "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": 55, "name": "ecrecover", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 87, "src": "2821:9:0", "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": 60, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2821:24:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "functionReturnParameters": 9, "id": 61, "nodeType": "Return", "src": "2814:31:0" } ] }, "documentation": "@dev Returns the address that signed a hashed message (`hash`) with\n`signature`. This address can then be used for verification purposes.\n\t * 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\t * 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\t * 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": 63, "implemented": true, "kind": "function", "modifiers": [], "name": "recover", "nodeType": "FunctionDefinition", "parameters": { "id": 6, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 3, "name": "hash", "nodeType": "VariableDeclaration", "scope": 63, "src": "1194:12:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 2, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1194:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5, "name": "signature", "nodeType": "VariableDeclaration", "scope": 63, "src": "1208:22:0", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 4, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "1208:5:0", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": null, "visibility": "internal" } ], "src": "1193:38:0" }, "returnParameters": { "id": 9, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 8, "name": "", "nodeType": "VariableDeclaration", "scope": 63, "src": "1255:7:0", "st