UNPKG

@alpsfinance/core

Version:

This is the official Alps Finance smart contract repository.

860 lines (859 loc) 492 kB
{ "contractName": "ECDSA", "abi": [], "metadata": "{\"compiler\":{\"version\":\"0.8.11+commit.d7f03943\"},\"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.\",\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\":\"ECDSA\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/Strings.sol\":{\"keccak256\":\"0x32c202bd28995dd20c4347b7c6467a6d3241c74c8ad3edcbb610cd9205916c45\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8179c356adb19e70d6b31a1eedc8c5c7f0c00e669e2540f4099e3844c6074d30\",\"dweb:/ipfs/QmWFbivarEobbqhS1go64ootVuHfVohBseerYy9FTEd1W2\"]},\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\":{\"keccak256\":\"0x3c07f43e60e099b3b157243b3152722e73b80eeb7985c2cd73712828d7f7da29\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://466ffb5a6e3bd65fffd996f9287ffd240ea21588a338c6efe143d94eaed014a7\",\"dweb:/ipfs/Qmans3vvPJZcvxe9KLAPc9Xwe4TFVTJdzaQGpi62Vrhoe2\"]}},\"version\":1}", "bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220de70ab4c4492107b4d16ccde527bdb1e63e4e7224c279b46954e4a5c9886059c64736f6c634300080b0033", "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220de70ab4c4492107b4d16ccde527bdb1e63e4e7224c279b46954e4a5c9886059c64736f6c634300080b0033", "immutableReferences": {}, "generatedSources": [], "deployedGeneratedSources": [], "sourceMap": "369:8924:30:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;369:8924:30;;;;;;;;;;;;;;;;;", "deployedSourceMap": "369:8924:30:-:0;;;;;;;;", "source": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Strings.sol\";\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 enum RecoverError {\n NoError,\n InvalidSignature,\n InvalidSignatureLength,\n InvalidSignatureS,\n InvalidSignatureV\n }\n\n function _throwError(RecoverError error) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert(\"ECDSA: invalid signature\");\n } else if (error == RecoverError.InvalidSignatureLength) {\n revert(\"ECDSA: invalid signature length\");\n } else if (error == RecoverError.InvalidSignatureS) {\n revert(\"ECDSA: invalid signature 's' value\");\n } else if (error == RecoverError.InvalidSignatureV) {\n revert(\"ECDSA: invalid signature 'v' value\");\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature` or error string. 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 * 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 * Documentation for signature generation:\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n *\n * _Available since v4.3._\n */\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\n // Check the signature length\n // - case 65: r,s,v signature (standard)\n // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._\n if (signature.length == 65) {\n bytes32 r;\n bytes32 s;\n uint8 v;\n // ecrecover takes the signature parameters, and the only way to get them\n // currently is to use 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 return tryRecover(hash, v, r, s);\n } else if (signature.length == 64) {\n bytes32 r;\n bytes32 vs;\n // ecrecover takes the signature parameters, and the only way to get them\n // currently is to use assembly.\n assembly {\n r := mload(add(signature, 0x20))\n vs := mload(add(signature, 0x40))\n }\n return tryRecover(hash, r, vs);\n } else {\n return (address(0), RecoverError.InvalidSignatureLength);\n }\n }\n\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 * 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 (address recovered, RecoverError error) = tryRecover(hash, signature);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n *\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\n *\n * _Available since v4.3._\n */\n function tryRecover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address, RecoverError) {\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n uint8 v = uint8((uint256(vs) >> 255) + 27);\n return tryRecover(hash, v, r, s);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n *\n * _Available since v4.2._\n */\n function recover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n * `r` and `s` signature fields separately.\n *\n * _Available since v4.3._\n */\n function tryRecover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address, RecoverError) {\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 (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): 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), RecoverError.InvalidSignatureS);\n }\n if (v != 27 && v != 28) {\n return (address(0), RecoverError.InvalidSignatureV);\n }\n\n // If the signature is valid (and not malleable), return the signer address\n address signer = ecrecover(hash, v, r, s);\n if (signer == address(0)) {\n return (address(0), RecoverError.InvalidSignature);\n }\n\n return (signer, RecoverError.NoError);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `v`,\n * `r` and `s` signature fields separately.\n */\n function recover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\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 /**\n * @dev Returns an Ethereum Signed Message, created from `s`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n\", Strings.toString(s.length), s));\n }\n\n /**\n * @dev Returns an Ethereum Signed Typed Data, created from a\n * `domainSeparator` and a `structHash`. This produces hash corresponding\n * to the one signed with the\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\n * JSON-RPC method as part of EIP-712.\n *\n * See {recover}.\n */\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19\\x01\", domainSeparator, structHash));\n }\n}\n", "sourcePath": "@openzeppelin/contracts/utils/cryptography/ECDSA.sol", "ast": { "absolutePath": "@openzeppelin/contracts/utils/cryptography/ECDSA.sol", "exportedSymbols": { "ECDSA": [ 5981 ], "Strings": [ 5574 ] }, "id": 5982, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 5576, "literals": [ "solidity", "^", "0.8", ".0" ], "nodeType": "PragmaDirective", "src": "112:23:30" }, { "absolutePath": "@openzeppelin/contracts/utils/Strings.sol", "file": "../Strings.sol", "id": 5577, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 5982, "sourceUnit": 5575, "src": "137:24:30", "symbolAliases": [], "unitAlias": "" }, { "abstract": false, "baseContracts": [], "canonicalName": "ECDSA", "contractDependencies": [], "contractKind": "library", "documentation": { "id": 5578, "nodeType": "StructuredDocumentation", "src": "163:205:30", "text": " @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\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." }, "fullyImplemented": true, "id": 5981, "linearizedBaseContracts": [ 5981 ], "name": "ECDSA", "nameLocation": "377:5:30", "nodeType": "ContractDefinition", "nodes": [ { "canonicalName": "ECDSA.RecoverError", "id": 5584, "members": [ { "id": 5579, "name": "NoError", "nameLocation": "417:7:30", "nodeType": "EnumValue", "src": "417:7:30" }, { "id": 5580, "name": "InvalidSignature", "nameLocation": "434:16:30", "nodeType": "EnumValue", "src": "434:16:30" }, { "id": 5581, "name": "InvalidSignatureLength", "nameLocation": "460:22:30", "nodeType": "EnumValue", "src": "460:22:30" }, { "id": 5582, "name": "InvalidSignatureS", "nameLocation": "492:17:30", "nodeType": "EnumValue", "src": "492:17:30" }, { "id": 5583, "name": "InvalidSignatureV", "nameLocation": "519:17:30", "nodeType": "EnumValue", "src": "519:17:30" } ], "name": "RecoverError", "nameLocation": "394:12:30", "nodeType": "EnumDefinition", "src": "389:153:30" }, { "body": { "id": 5637, "nodeType": "Block", "src": "602:577:30", "statements": [ { "condition": { "commonType": { "typeIdentifier": "t_enum$_RecoverError_$5584", "typeString": "enum ECDSA.RecoverError" }, "id": 5593, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 5590, "name": "error", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5587, "src": "616:5:30", "typeDescriptions": { "typeIdentifier": "t_enum$_RecoverError_$5584", "typeString": "enum ECDSA.RecoverError" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "expression": { "id": 5591, "name": "RecoverError", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5584, "src": "625:12:30", "typeDescriptions": { "typeIdentifier": "t_type$_t_enum$_RecoverError_$5584_$", "typeString": "type(enum ECDSA.RecoverError)" } }, "id": 5592, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "memberName": "NoError", "nodeType": "MemberAccess", "referencedDeclaration": 5579, "src": "625:20:30", "typeDescriptions": { "typeIdentifier": "t_enum$_RecoverError_$5584", "typeString": "enum ECDSA.RecoverError" } }, "src": "616:29:30", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": { "condition": { "commonType": { "typeIdentifier": "t_enum$_RecoverError_$5584", "typeString": "enum ECDSA.RecoverError" }, "id": 5599, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 5596, "name": "error", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5587, "src": "712:5:30", "typeDescriptions": { "typeIdentifier": "t_enum$_RecoverError_$5584", "typeString": "enum ECDSA.RecoverError" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "expression": { "id": 5597, "name": "RecoverError", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5584, "src": "721:12:30", "typeDescriptions": { "typeIdentifier": "t_type$_t_enum$_RecoverError_$5584_$", "typeString": "type(enum ECDSA.RecoverError)" } }, "id": 5598, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "memberName": "InvalidSignature", "nodeType": "MemberAccess", "referencedDeclaration": 5580, "src": "721:29:30", "typeDescriptions": { "typeIdentifier": "t_enum$_RecoverError_$5584", "typeString": "enum ECDSA.RecoverError" } }, "src": "712:38:30", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": { "condition": { "commonType": { "typeIdentifier": "t_enum$_RecoverError_$5584", "typeString": "enum ECDSA.RecoverError" }, "id": 5608, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 5605, "name": "error", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5587, "src": "821:5:30", "typeDescriptions": { "typeIdentifier": "t_enum$_RecoverError_$5584", "typeString": "enum ECDSA.RecoverError" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "expression": { "id": 5606, "name": "RecoverError", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5584, "src": "830:12:30", "typeDescriptions": { "typeIdentifier": "t_type$_t_enum$_RecoverError_$5584_$", "typeString": "type(enum ECDSA.RecoverError)" } }, "id": 5607, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "memberName": "InvalidSignatureLength", "nodeType": "MemberAccess", "referencedDeclaration": 5581, "src": "830:35:30", "typeDescriptions": { "typeIdentifier": "t_enum$_RecoverError_$5584", "typeString": "enum ECDSA.RecoverError" } }, "src": "821:44:30", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": { "condition": { "commonType": { "typeIdentifier": "t_enum$_RecoverError_$5584", "typeString": "enum ECDSA.RecoverError" }, "id": 5617, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 5614, "name": "error", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5587, "src": "943:5:30", "typeDescriptions": { "typeIdentifier": "t_enum$_RecoverError_$5584", "typeString": "enum ECDSA.RecoverError" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "expression": { "id": 5615, "name": "RecoverError", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5584, "src": "952:12:30", "typeDescriptions": { "typeIdentifier": "t_type$_t_enum$_RecoverError_$5584_$", "typeString": "type(enum ECDSA.RecoverError)" } }, "id": 5616, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "memberName": "InvalidSignatureS", "nodeType": "MemberAccess", "referencedDeclaration": 5582, "src": "952:30:30", "typeDescriptions": { "typeIdentifier": "t_enum$_RecoverError_$5584", "typeString": "enum ECDSA.RecoverError" } }, "src": "943:39:30", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": { "condition": { "commonType": { "typeIdentifier": "t_enum$_RecoverError_$5584", "typeString": "enum ECDSA.RecoverError" }, "id": 5626, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 5623, "name": "error", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5587, "src": "1063:5:30", "typeDescriptions": { "typeIdentifier": "t_enum$_RecoverError_$5584", "typeString": "enum ECDSA.RecoverError" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "expression": { "id": 5624, "name": "RecoverError", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5584, "src": "1072:12:30", "typeDescriptions": { "typeIdentifier": "t_type$_t_enum$_RecoverError_$5584_$", "typeString": "type(enum ECDSA.RecoverError)" } }, "id": 5625, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "memberName": "InvalidSignatureV", "nodeType": "MemberAccess", "referencedDeclaration": 5583, "src": "1072:30:30", "typeDescriptions": { "typeIdentifier": "t_enum$_RecoverError_$5584", "typeString": "enum ECDSA.RecoverError" } }, "src": "1063:39:30", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 5632, "nodeType": "IfStatement", "src": "1059:114:30", "trueBody": { "id": 5631, "nodeType": "Block", "src": "1104:69:30", "statements": [ { "expression": { "arguments": [ { "hexValue": "45434453413a20696e76616c6964207369676e6174757265202776272076616c7565", "id": 5628, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1125:36:30", "typeDescriptions": { "typeIdentifier": "t_stringliteral_8522ee1b53216f595394db8e80a64d9e7d9bd512c0811c18debe9f40858597e4", "typeString": "literal_string \"ECDSA: invalid signature 'v' value\"" }, "value": "ECDSA: invalid signature 'v' value" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_stringliteral_8522ee1b53216f595394db8e80a64d9e7d9bd512c0811c18debe9f40858597e4", "typeString": "literal_string \"ECDSA: invalid signature 'v' value\"" } ], "id": 5627, "name": "revert", "nodeType": "Identifier", "overloadedDeclarations": [ 4294967277, 4294967277 ], "referencedDeclaration": 4294967277, "src": "1118:6:30", "typeDescriptions": { "typeIdentifier": "t_function_revert_pure$_t_string_memory_ptr_$returns$__$", "typeString": "function (string memory) pure" } }, "id": 5629, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1118:44:30", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 5630, "nodeType": "ExpressionStatement", "src": "1118:44:30" } ] } }, "id": 5633, "nodeType": "IfStatement", "src": "939:234:30", "trueBody": { "id": 5622, "nodeType": "Block", "src": "984:69:30", "statements": [ { "expression": { "arguments": [ { "hexValue": "45434453413a20696e76616c6964207369676e6174757265202773272076616c7565", "id": 5619, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1005:36:30", "typeDescriptions": { "typeIdentifier": "t_stringliteral_520d1f787dbcafbbfc007fd2c4ecf3d2711ec587f3ee9a1215c0b646c3e530bd", "typeString": "literal_string \"ECDSA: invalid signature 's' value\"" }, "value": "ECDSA: invalid signature 's' value" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_stringliteral_520d1f787dbcafbbfc007fd2c4ecf3d2711ec587f3ee9a1215c0b646c3e530bd", "typeString": "literal_string \"ECDSA: invalid signature 's' value\"" } ], "id": 5618, "name": "revert", "nodeType": "Identifier", "overloadedDeclarations": [ 4294967277, 4294967277 ], "referencedDeclaration": 4294967277, "src": "998:6:30", "typeDescriptions": { "typeIdentifier": "t_function_revert_pure$_t_string_memory_ptr_$returns$__$", "typeString": "function (string memory) pure" } }, "id": 5620, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "998:44:30", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 5621, "nodeType": "ExpressionStatement", "src": "998:44:30" } ] } }, "id": 5634, "nodeType": "IfStatement", "src": "817:356:30", "trueBody": { "id": 5613, "nodeType": "Block", "src": "867:66:30", "statements": [ { "expression": { "arguments": [ { "hexValue": "45434453413a20696e76616c6964207369676e6174757265206c656e677468", "id": 5610, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "888:33:30", "typeDescriptions": { "typeIdentifier": "t_stringliteral_1669ff3ba3cdf64474e1193492d05b8434e29b0b495e60095eb5f5c8ec14ce77", "typeString": "literal_string \"ECDSA: invalid signature length\"" }, "value": "ECDSA: invalid signature length" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_stringliteral_1669ff3ba3cdf64474e1193492d05b8434e29b0b495e60095eb5f5c8ec14ce77", "typeString": "literal_string \"ECDSA: invalid signature length\"" } ], "id": 5609, "name": "revert", "nodeType": "Identifier", "overloadedDeclarations": [ 4294967277, 4294967277 ], "referencedDeclaration": 4294967277, "src": "881:6:30", "typeDescriptions": { "typeIdentifier": "t_function_revert_pure$_t_string_memory_ptr_$returns$__$", "typeString": "function (string memory) pure" } }, "id": 5611, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "881:41:30", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 5612, "nodeType": "ExpressionStatement", "src": "881:41:30" } ] } }, "id": 5635, "nodeType": "IfStatement", "src": "708:465:30", "trueBody": { "id": 5604, "nodeType": "Block", "src": "752:59:30", "statements": [ { "expression": { "arguments": [ { "hexValue": "45434453413a20696e76616c6964207369676e6174757265", "id": 5601, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "773:26:30", "typeDescriptions": { "typeIdentifier": "t_stringliteral_00043f6bf76368aa97c21698e9b9d4779e31902453daccf3525ddfb36e53e2be", "typeString": "literal_string \"ECDSA: invalid signature\"" }, "value": "ECDSA: invalid signature" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_stringliteral_00043f6bf76368aa97c21698e9b9d4779e31902453daccf3525ddfb36e53e2be", "typeString": "literal_string \"ECDSA: invalid signature\"" } ], "id": 5600, "name": "revert", "nodeType": "Identifier", "overloadedDeclarations": [ 4294967277, 4294967277 ], "referencedDeclaration": 4294967277, "src": "766:6:30", "typeDescriptions": { "typeIdentifier": "t_function_revert_pure$_t_string_memory_ptr_$returns$__$", "typeString": "function (string memory) pure" } }, "id": 5602, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "766:34:30", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 5603, "nodeType": "ExpressionStatement", "src": "766:34:30" } ] } }, "id": 5636, "nodeType": "IfStatement", "src": "612:561:30", "trueBody": { "id": 5595, "nodeType": "Block", "src": "647:55:30", "statements": [ { "functionReturnParameters": 5589, "id": 5594, "nodeType": "Return", "src": "661:7:30" } ] } } ] }, "id": 5638, "implemented": true, "kind": "function", "modifiers": [], "name": "_throwError", "nameLocation": "557:11:30", "nodeType": "FunctionDefinition", "parameters": { "id": 5588, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5587, "mutability": "mutable", "name": "error", "nameLocation": "582:5:30", "nodeType": "VariableDeclaration", "scope": 5638, "src": "569:18:30", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_enum$_RecoverError_$5584", "typeString": "enum ECDSA.RecoverError" }, "typeName": { "id": 5586, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 5585, "name": "RecoverError", "nodeType": "IdentifierPath", "referencedDeclaration": 5584, "src": "569:12:30" }, "referencedDeclaration": 5584, "src": "569:12:30", "typeDescriptions": { "typeIdentifier": "t_enum$_RecoverError_$5584", "typeString": "enum ECDSA.RecoverError" } }, "visibility": "internal" } ], "src": "568:20:30" }, "returnParameters": { "id": 5589, "nodeType": "ParameterList", "parameters": [], "src": "602:0:30" }, "scope": 5981, "src": "548:631:30", "stateMutability": "pure", "virtual": false, "visibility": "private" }, { "body": { "id": 5702, "nodeType": "Block", "src": "2347:1175:30", "statements": [ { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5654, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "expression": { "id": 5651, "name": "signature", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5643, "src": "2554:9:30", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, "id": 5652, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "length", "nodeType": "MemberAccess", "src": "2554:16:30", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "hexValue": "3635", "id": 5653, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2574:2:30", "typeDescriptions": { "typeIdentifier": "t_rational_65_by_1", "typeString": "int_const 65" }, "value": "65" }, "src": "2554:22:30", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5676, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "expression": { "id": 5673, "name": "signature", "nodeType": "Identifier", "overloadedDeclarations": [],