UNPKG

@dolomite-exchange/dolomite-margin

Version:

Ethereum Smart Contracts and TypeScript library used for the DolomiteMargin trading protocol

1,103 lines 161 kB
{ "contractName": "TypedSignature", "abi": [], "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"author\":\"dYdX * Library to unparse typed signatures\",\"methods\":{},\"title\":\"TypedSignature\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/home/cdc218/projects/dolomite-protocol-v2/contracts/external/lib/TypedSignature.sol\":\"TypedSignature\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"/home/cdc218/projects/dolomite-protocol-v2/contracts/external/lib/TypedSignature.sol\":{\"keccak256\":\"0x4b4eb5fd2869d6c410948f78163773442c11bc82e393307e41359bbdb21577bf\",\"urls\":[\"bzz-raw://9c9c3abae44173086bc08f5479fbc67151d5905f60e1032ec6f9e40f841f3365\",\"dweb:/ipfs/QmbsQRX3gmcpimjFEW5ULJVavHQtViyg7NSQ2Q8Qcu6F6V\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Require.sol\":{\"keccak256\":\"0x05a2a90b41b6a5f42f0a72da63d015fb0b406a9ba2172823352e522e8bf3a606\",\"urls\":[\"bzz-raw://19883f0c6d33266f756ec5c3d17539524aa24b993c46c33f8400801d09373a6c\",\"dweb:/ipfs/QmYX2fwK3vQQDSZLMrc5wMfeb8RWrcC9CGX8XECLty8QDk\"]}},\"version\":1}", "bytecode": "0x60636023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea365627a7a72315820b734150fed1c505b5452a65a5adf51e6fcbab939fd3a6be6543f9275101b9dde6c6578706572696d656e74616cf564736f6c63430005100040", "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea365627a7a72315820b734150fed1c505b5452a65a5adf51e6fcbab939fd3a6be6543f9275101b9dde6c6578706572696d656e74616cf564736f6c63430005100040", "sourceMap": "813:2931:39:-;;132:2:-1;166:7;155:9;146:7;137:37;255:7;249:14;246:1;241:23;235:4;232:33;222:2;;269:9;222:2;293:9;290:1;283:20;323:4;314:7;306:22;347:7;338;331:24", "deployedSourceMap": "813:2931:39:-;;;;;;;;", "source": "/*\n\n Copyright 2019 dYdX Trading Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.5.7;\npragma experimental ABIEncoderV2;\n\nimport { Require } from \"../../protocol/lib/Require.sol\";\n\n\n/**\n * @title TypedSignature\n * @author dYdX\n *\n * Library to unparse typed signatures\n */\nlibrary TypedSignature {\n\n // ============ Constants ============\n\n bytes32 constant private FILE = \"TypedSignature\";\n\n // prepended message with the length of the signed hash in decimal\n bytes constant private PREPEND_DEC = \"\\x19Ethereum Signed Message:\\n32\";\n\n // prepended message with the length of the signed hash in hexadecimal\n bytes constant private PREPEND_HEX = \"\\x19Ethereum Signed Message:\\n\\x20\";\n\n // Number of bytes in a typed signature\n uint256 constant private NUM_SIGNATURE_BYTES = 66;\n\n // ============ Enums ============\n\n // Different RPC providers may implement signing methods differently, so we allow different\n // signature types depending on the string prepended to a hash before it was signed.\n enum SignatureType {\n NoPrepend, // No string was prepended.\n Decimal, // PREPEND_DEC was prepended.\n Hexadecimal, // PREPEND_HEX was prepended.\n Invalid // Not a valid type. Used for bound-checking.\n }\n\n // ============ Functions ============\n\n /**\n * Gives the address of the signer of a hash. Also allows for the commonly prepended string of\n * '\\x19Ethereum Signed Message:\\n' + message.length\n *\n * @param hash Hash that was signed (does not include prepended message)\n * @param signatureWithType Type and ECDSA signature with structure: {32:r}{32:s}{1:v}{1:type}\n * @return address of the signer of the hash\n */\n function recover(\n bytes32 hash,\n bytes memory signatureWithType\n )\n internal\n pure\n returns (address)\n {\n Require.that(\n signatureWithType.length == NUM_SIGNATURE_BYTES,\n FILE,\n \"Invalid signature length\"\n );\n\n bytes32 r;\n bytes32 s;\n uint8 v;\n uint8 rawSigType;\n\n /* solium-disable-next-line security/no-inline-assembly */\n assembly {\n r := mload(add(signatureWithType, 0x20))\n s := mload(add(signatureWithType, 0x40))\n let lastSlot := mload(add(signatureWithType, 0x60))\n v := byte(0, lastSlot)\n rawSigType := byte(1, lastSlot)\n }\n\n Require.that(\n rawSigType < uint8(SignatureType.Invalid),\n FILE,\n \"Invalid signature type\"\n );\n\n SignatureType sigType = SignatureType(rawSigType);\n\n bytes32 signedHash;\n if (sigType == SignatureType.NoPrepend) {\n signedHash = hash;\n } else if (sigType == SignatureType.Decimal) {\n signedHash = keccak256(abi.encodePacked(PREPEND_DEC, hash));\n } else {\n assert(sigType == SignatureType.Hexadecimal);\n signedHash = keccak256(abi.encodePacked(PREPEND_HEX, hash));\n }\n\n return ecrecover(\n signedHash,\n v,\n r,\n s\n );\n }\n}\n", "sourcePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/external/lib/TypedSignature.sol", "ast": { "absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/external/lib/TypedSignature.sol", "exportedSymbols": { "TypedSignature": [ 6204 ] }, "id": 6205, "nodeType": "SourceUnit", "nodes": [ { "id": 6076, "literals": [ "solidity", "^", "0.5", ".7" ], "nodeType": "PragmaDirective", "src": "603:23:39" }, { "id": 6077, "literals": [ "experimental", "ABIEncoderV2" ], "nodeType": "PragmaDirective", "src": "627:33:39" }, { "absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Require.sol", "file": "../../protocol/lib/Require.sol", "id": 6079, "nodeType": "ImportDirective", "scope": 6205, "sourceUnit": 28453, "src": "662:57:39", "symbolAliases": [ { "foreign": 6078, "local": null } ], "unitAlias": "" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "library", "documentation": "@title TypedSignature\n@author dYdX\n * Library to unparse typed signatures", "fullyImplemented": true, "id": 6204, "linearizedBaseContracts": [ 6204 ], "name": "TypedSignature", "nodeType": "ContractDefinition", "nodes": [ { "constant": true, "id": 6082, "name": "FILE", "nodeType": "VariableDeclaration", "scope": 6204, "src": "887:48:39", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 6080, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "887:7:39", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": { "argumentTypes": null, "hexValue": "54797065645369676e6174757265", "id": 6081, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "919:16:39", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_32da92ebc86f808a5601596b8b0f1f799e40f65ecd790694e20fa629c06befde", "typeString": "literal_string \"TypedSignature\"" }, "value": "TypedSignature" }, "visibility": "private" }, { "constant": true, "id": 6085, "name": "PREPEND_DEC", "nodeType": "VariableDeclaration", "scope": 6204, "src": "1013:71:39", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes_memory", "typeString": "bytes" }, "typeName": { "id": 6083, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "1013:5:39", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": { "argumentTypes": null, "hexValue": "19457468657265756d205369676e6564204d6573736167653a0a3332", "id": 6084, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1050:34:39", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_178a2411ab6fbc1ba11064408972259c558d0e82fd48b0aba3ad81d14f065e73", "typeString": "literal_string \"\u0019Ethereum Signed Message:\n32\"" }, "value": "\u0019Ethereum Signed Message:\n32" }, "visibility": "private" }, { "constant": true, "id": 6088, "name": "PREPEND_HEX", "nodeType": "VariableDeclaration", "scope": 6204, "src": "1166:73:39", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes_memory", "typeString": "bytes" }, "typeName": { "id": 6086, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "1166:5:39", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": { "argumentTypes": null, "hexValue": "19457468657265756d205369676e6564204d6573736167653a0a20", "id": 6087, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1203:36:39", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_db0c25319566d7151361170a8ff7fb553c7c592a3dc686e05c1444deb22accdd", "typeString": "literal_string \"\u0019Ethereum Signed Message:\n \"" }, "value": "\u0019Ethereum Signed Message:\n " }, "visibility": "private" }, { "constant": true, "id": 6091, "name": "NUM_SIGNATURE_BYTES", "nodeType": "VariableDeclaration", "scope": 6204, "src": "1290:49:39", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 6089, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1290:7:39", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": { "argumentTypes": null, "hexValue": "3636", "id": 6090, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1337:2:39", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_66_by_1", "typeString": "int_const 66" }, "value": "66" }, "visibility": "private" }, { "canonicalName": "TypedSignature.SignatureType", "id": 6096, "members": [ { "id": 6092, "name": "NoPrepend", "nodeType": "EnumValue", "src": "1600:9:39" }, { "id": 6093, "name": "Decimal", "nodeType": "EnumValue", "src": "1649:7:39" }, { "id": 6094, "name": "Hexadecimal", "nodeType": "EnumValue", "src": "1700:11:39" }, { "id": 6095, "name": "Invalid", "nodeType": "EnumValue", "src": "1751:7:39" } ], "name": "SignatureType", "nodeType": "EnumDefinition", "src": "1571:244:39" }, { "body": { "id": 6202, "nodeType": "Block", "src": "2450:1292:39", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 6111, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 6108, "name": "signatureWithType", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6100, "src": "2486:17:39", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, "id": 6109, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "length", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "2486:24:39", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "id": 6110, "name": "NUM_SIGNATURE_BYTES", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6091, "src": "2514:19:39", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "2486:47:39", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "id": 6112, "name": "FILE", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6082, "src": "2547:4:39", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "hexValue": "496e76616c6964207369676e6174757265206c656e677468", "id": 6113, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "2565:26:39", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_d0e57016dfcfa997388e3f3d9ad75ea4d5a67a0f23b0489f2cdbaecf3ef0f78c", "typeString": "literal_string \"Invalid signature length\"" }, "value": "Invalid signature length" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, { "typeIdentifier": "t_stringliteral_d0e57016dfcfa997388e3f3d9ad75ea4d5a67a0f23b0489f2cdbaecf3ef0f78c", "typeString": "literal_string \"Invalid signature length\"" } ], "expression": { "argumentTypes": null, "id": 6105, "name": "Require", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 28452, "src": "2460:7:39", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_Require_$28452_$", "typeString": "type(library Require)" } }, "id": 6107, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "that", "nodeType": "MemberAccess", "referencedDeclaration": 27816, "src": "2460:12:39", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_bool_$_t_bytes32_$_t_bytes32_$returns$__$", "typeString": "function (bool,bytes32,bytes32) pure" } }, "id": 6114, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2460:141:39", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 6115, "nodeType": "ExpressionStatement", "src": "2460:141:39" }, { "assignments": [ 6117 ], "declarations": [ { "constant": false, "id": 6117, "name": "r", "nodeType": "VariableDeclaration", "scope": 6202, "src": "2612:9:39", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 6116, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "2612:7:39", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "id": 6118, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "2612:9:39" }, { "assignments": [ 6120 ], "declarations": [ { "constant": false, "id": 6120, "name": "s", "nodeType": "VariableDeclaration", "scope": 6202, "src": "2631:9:39", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 6119, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "2631:7:39", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "id": 6121, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "2631:9:39" }, { "assignments": [ 6123 ], "declarations": [ { "constant": false, "id": 6123, "name": "v", "nodeType": "VariableDeclaration", "scope": 6202, "src": "2650:7:39", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "typeName": { "id": 6122, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "2650:5:39", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "value": null, "visibility": "internal" } ], "id": 6124, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "2650:7:39" }, { "assignments": [ 6126 ], "declarations": [ { "constant": false, "id": 6126, "name": "rawSigType", "nodeType": "VariableDeclaration", "scope": 6202, "src": "2667:16:39", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "typeName": { "id": 6125, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "2667:5:39", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "value": null, "visibility": "internal" } ], "id": 6127, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "2667:16:39" }, { "externalReferences": [ { "r": { "declaration": 6117, "isOffset": false, "isSlot": false, "src": "2784:1:39", "valueSize": 1 } }, { "signatureWithType": { "declaration": 6100, "isOffset": false, "isSlot": false, "src": "2799:17:39", "valueSize": 1 } }, { "s": { "declaration": 6120, "isOffset": false, "isSlot": false, "src": "2837:1:39", "valueSize": 1 } }, { "signatureWithType": { "declaration": 6100, "isOffset": false, "isSlot": false, "src": "2852:17:39", "valueSize": 1 } }, { "signatureWithType": { "declaration": 6100, "isOffset": false, "isSlot": false, "src": "2916:17:39", "valueSize": 1 } }, { "v": { "declaration": 6123, "isOffset": false, "isSlot": false, "src": "2954:1:39", "valueSize": 1 } }, { "rawSigType": { "declaration": 6126, "isOffset": false, "isSlot": false, "src": "2989:10:39", "valueSize": 1 } } ], "id": 6128, "nodeType": "InlineAssembly", "operations": "{\n r := mload(add(signatureWithType, 0x20))\n s := mload(add(signatureWithType, 0x40))\n let lastSlot := mload(add(signatureWithType, 0x60))\n v := byte(0, lastSlot)\n rawSigType := byte(1, lastSlot)\n}", "src": "2761:269:39" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "id": 6137, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 6132, "name": "rawSigType", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6126, "src": "3066:10:39", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "nodeType": "BinaryOperation", "operator": "<", "rightExpression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 6134, "name": "SignatureType", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6096, "src": "3085:13:39", "typeDescriptions": { "typeIdentifier": "t_type$_t_enum$_SignatureType_$6096_$", "typeString": "type(enum TypedSignature.SignatureType)" } }, "id": 6135, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "memberName": "Invalid", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "3085:21:39", "typeDescriptions": { "typeIdentifier": "t_enum$_SignatureType_$6096", "typeString": "enum TypedSignature.SignatureType" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_enum$_SignatureType_$6096", "typeString": "enum TypedSignature.SignatureType" } ], "id": 6133, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "3079:5:39", "typeDescriptions": { "typeIdentifier": "t_type$_t_uint8_$", "typeString": "type(uint8)" }, "typeName": "uint8" }, "id": 6136, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "3079:28:39", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "src": "3066:41:39", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "id": 6138, "name": "FILE", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6082, "src": "3121:4:39", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "hexValue": "496e76616c6964207369676e61747572652074797065", "id": 6139, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "3139:24:39", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_28f12df7f381e785c864bf191dba12625917d5290b5425f4d7cf84a50611f726", "typeString": "literal_string \"Invalid signature type\"" }, "value": "Invalid signature type" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, { "typeIdentifier": "t_stringliteral_28f12df7f381e785c864bf191dba12625917d5290b5425f4d7cf84a50611f726", "typeString": "literal_string \"Invalid signature type\"" } ], "expression": { "argumentTypes": null, "id": 6129, "name": "Require", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 28452, "src": "3040:7:39", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_Require_$28452_$", "typeString": "type(library Require)" } }, "id": 6131, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "that", "nodeType": "MemberAccess", "referencedDeclaration": 27816, "src": "3040:12:39", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_bool_$_t_bytes32_$_t_bytes32_$returns$__$", "typeString": "function (bool,bytes32,bytes32) pure" } }, "id": 6140, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "3040:133:39", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 6141, "nodeType": "ExpressionStatement", "src": "3040:133:39" }, { "assignments": [ 6143 ], "declarations": [ { "constant": false, "id": 6143, "name": "sigType", "nodeType": "VariableDeclaration", "scope": 6202, "src": "3184:21:39", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_enum$_SignatureType_$6096", "typeString": "enum TypedSignature.SignatureType" }, "typeName": { "contractScope": null, "id": 6142, "name": "SignatureType", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 6096, "src": "3184:13:39", "typeDescriptions": { "typeIdentifier": "t_enum$_SignatureType_$6096", "typeString": "enum TypedSignature.SignatureType" } }, "value": null, "visibility": "internal" } ], "id": 6147, "initialValue": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 6145, "name": "rawSigType", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6126, "src": "3222:10:39", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint8", "typeString": "uint8" } ], "id": 6144, "name": "SignatureType", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6096, "src": "3208:13:39", "typeDescriptions": { "typeIdentifier": "t_type$_t_enum$_SignatureType_$6096_$", "typeString": "type(enum TypedSignature.SignatureType)" } }, "id": 6146, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "3208:25:39", "typeDescriptions": { "typeIdentifier": "t_enum$_SignatureType_$6096", "typeString": "enum TypedSignature.SignatureType" } }, "nodeType": "VariableDeclarationStatement", "src": "3184:49:39" }, { "assignments": [ 6149 ], "declarations": [ { "constant": false, "id": 6149, "name": "signedHash", "nodeType": "VariableDeclaration", "scope": 6202, "src": "3244:18:39", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 6148, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "3244:7:39", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "id": 6150, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "3244:18:39" }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_enum$_SignatureType_$6096", "typeString": "enum TypedSignature.SignatureType" }, "id": 6154, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 6151, "name": "sigType", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6143, "src": "3276:7:39", "typeDescriptions": { "typeIdentifier": "t_enum$_SignatureType_$6096", "typeString": "enum TypedSignature.SignatureType" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 6152, "name": "SignatureType", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6096, "src": "3287:13:39", "typeDescriptions": { "typeIdentifier": "t_type$_t_enum$_SignatureType_$6096_$", "typeString": "type(enum TypedSignature.SignatureType)" } }, "id": 6153, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "memberName": "NoPrepend", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "3287:23:39", "typeDescriptions": { "typeIdentifier": "t_enum$_SignatureType_$6096", "typeString": "enum TypedSignature.SignatureType" } }, "src": "3276:34:39", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_enum$_SignatureType_$6096", "typeString": "enum TypedSignature.SignatureType" }, "id": 6163, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 6160, "name": "sigType", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6143, "src": "3364:7:39", "typeDescriptions": { "typeIdentifier": "t_enum$_SignatureType_$6096", "typeString": "enum TypedSignature.SignatureType" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 6161, "name": "SignatureType", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6096, "src": "3375:13:39", "typeDescriptions": { "typeIdentifier": "t_type$_t_enum$_SignatureType_$6096_$", "typeString": "type(enum TypedSignature.SignatureType)" } }, "id": 6162, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "memberName": "Decimal", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "3375:21:39", "typeDescriptions": { "typeIdentifier": "t_enum$_SignatureType_$6096", "typeString": "enum TypedSignature.SignatureType" } }, "src": "3364:32:39", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": { "id": 6192, "nodeType": "Block", "src": "