{ "contractName": "SignatureDecoder", "abi": [], "bytecode": "0x6080604052348015600f57600080fd5b50603580601d6000396000f3006080604052600080fd00a165627a7a72305820d9ee3caf094740365f7393d3f6ba692eb56aac36a91a228ffd64563a0a424d7e0029", "deployedBytecode": "0x6080604052600080fd00a165627a7a72305820d9ee3caf094740365f7393d3f6ba692eb56aac36a91a228ffd64563a0a424d7e0029", "sourceMap": "226:1692:12:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;226:1692:12;;;;;;;", "deployedSourceMap": "226:1692:12:-;;;;;", "source": "pragma solidity 0.4.24;\n\n\n/// @title SignatureDecoder - Decodes signatures that a encoded as bytes\n/// @author Ricardo Guilherme Schmidt (Status Research & Development GmbH) \n/// @author Richard Meissner - \ncontract SignatureDecoder {\n \n /// @dev Recovers address who signed the message \n /// @param messageHash operation ethereum signed message hash\n /// @param messageSignature message `txHash` signature\n /// @param pos which signature to read\n function recoverKey (\n bytes32 messageHash, \n bytes messageSignature,\n uint256 pos\n )\n internal\n pure\n returns (address) \n {\n uint8 v;\n bytes32 r;\n bytes32 s;\n (v, r, s) = signatureSplit(messageSignature, pos);\n return ecrecover(messageHash, v, r, s);\n }\n\n /// @dev divides bytes signature into `uint8 v, bytes32 r, bytes32 s`\n /// @param pos which signature to read\n /// @param signatures concatenated rsv signatures\n function signatureSplit(bytes signatures, uint256 pos)\n internal\n pure\n returns (uint8 v, bytes32 r, bytes32 s)\n {\n // The signature format is a compact form of:\n // {bytes32 r}{bytes32 s}{uint8 v}\n // Compact means, uint8 is not padded to 32 bytes.\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n let signaturePos := mul(0x41, pos)\n r := mload(add(signatures, add(signaturePos, 0x20)))\n s := mload(add(signatures, add(signaturePos, 0x40)))\n // Here we are loading the last 32 bytes, including 31 bytes\n // of 's'. There is no 'mload8' to do this.\n //\n // 'byte' is not working due to the Solidity parser, so lets\n // use the second best option, 'and'\n v := and(mload(add(signatures, add(signaturePos, 0x41))), 0xff)\n }\n }\n}\n", "sourcePath": "/Users/apanizo/git/gnosis/safe-contracts/contracts/common/SignatureDecoder.sol", "ast": { "absolutePath": "/Users/apanizo/git/gnosis/safe-contracts/contracts/common/SignatureDecoder.sol", "exportedSymbols": { "SignatureDecoder": [ 1791 ] }, "id": 1792, "nodeType": "SourceUnit", "nodes": [ { "id": 1737, "literals": [ "solidity", "0.4", ".24" ], "nodeType": "PragmaDirective", "src": "0:23:12" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": "@title SignatureDecoder - Decodes signatures that a encoded as bytes\n @author Ricardo Guilherme Schmidt (Status Research & Development GmbH) \n @author Richard Meissner - ", "fullyImplemented": true, "id": 1791, "linearizedBaseContracts": [ 1791 ], "name": "SignatureDecoder", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 1774, "nodeType": "Block", "src": "656:169:12", "statements": [ { "assignments": [], "declarations": [ { "constant": false, "id": 1749, "name": "v", "nodeType": "VariableDeclaration", "scope": 1775, "src": "666:7:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "typeName": { "id": 1748, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "666:5:12", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "value": null, "visibility": "internal" } ], "id": 1750, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "666:7:12" }, { "assignments": [], "declarations": [ { "constant": false, "id": 1752, "name": "r", "nodeType": "VariableDeclaration", "scope": 1775, "src": "683:9:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 1751, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "683:7:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "id": 1753, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "683:9:12" }, { "assignments": [], "declarations": [ { "constant": false, "id": 1755, "name": "s", "nodeType": "VariableDeclaration", "scope": 1775, "src": "702:9:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 1754, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "702:7:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "id": 1756, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "702:9:12" }, { "expression": { "argumentTypes": null, "id": 1765, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "components": [ { "argumentTypes": null, "id": 1757, "name": "v", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1749, "src": "722:1:12", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, { "argumentTypes": null, "id": 1758, "name": "r", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1752, "src": "725:1:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "id": 1759, "name": "s", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1755, "src": "728:1:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], "id": 1760, "isConstant": false, "isInlineArray": false, "isLValue": true, "isPure": false, "lValueRequested": true, "nodeType": "TupleExpression", "src": "721:9:12", "typeDescriptions": { "typeIdentifier": "t_tuple$_t_uint8_$_t_bytes32_$_t_bytes32_$", "typeString": "tuple(uint8,bytes32,bytes32)" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1762, "name": "messageSignature", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1741, "src": "748:16:12", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, { "argumentTypes": null, "id": 1763, "name": "pos", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1743, "src": "766:3:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 1761, "name": "signatureSplit", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1790, "src": "733:14:12", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$_t_uint256_$returns$_t_uint8_$_t_bytes32_$_t_bytes32_$", "typeString": "function (bytes memory,uint256) pure returns (uint8,bytes32,bytes32)" } }, "id": 1764, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "733:37:12", "typeDescriptions": { "typeIdentifier": "t_tuple$_t_uint8_$_t_bytes32_$_t_bytes32_$", "typeString": "tuple(uint8,bytes32,bytes32)" } }, "src": "721:49:12", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1766, "nodeType": "ExpressionStatement", "src": "721:49:12" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1768, "name": "messageHash", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1739, "src": "797:11:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "id": 1769, "name": "v", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1749, "src": "810:1:12", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, { "argumentTypes": null, "id": 1770, "name": "r", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1752, "src": "813:1:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "id": 1771, "name": "s", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1755, "src": "816:1:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, { "typeIdentifier": "t_uint8", "typeString": "uint8" }, { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } ], "id": 1767, "name": "ecrecover", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4007, "src": "787:9:12", "typeDescriptions": { "typeIdentifier": "t_function_ecrecover_pure$_t_bytes32_$_t_uint8_$_t_bytes32_$_t_bytes32_$returns$_t_address_$", "typeString": "function (bytes32,uint8,bytes32,bytes32) pure returns (address)" } }, "id": 1772, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "787:31:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "functionReturnParameters": 1747, "id": 1773, "nodeType": "Return", "src": "780:38:12" } ] }, "documentation": "@dev Recovers address who signed the message \n @param messageHash operation ethereum signed message hash\n @param messageSignature message `txHash` signature\n @param pos which signature to read", "id": 1775, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "recoverKey", "nodeType": "FunctionDefinition", "parameters": { "id": 1744, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1739, "name": "messageHash", "nodeType": "VariableDeclaration", "scope": 1775, "src": "515:19:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 1738, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "515:7:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1741, "name": "messageSignature", "nodeType": "VariableDeclaration", "scope": 1775, "src": "545:22:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 1740, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "545:5:12", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1743, "name": "pos", "nodeType": "VariableDeclaration", "scope": 1775, "src": "577:11:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1742, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "577:7:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "505:89:12" }, "payable": false, "returnParameters": { "id": 1747, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1746, "name": "", "nodeType": "VariableDeclaration", "scope": 1775, "src": "642:7:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1745, "name": "address", "nodeType": "ElementaryTypeName", "src": "642:7:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "641:9:12" }, "scope": 1791, "src": "485:340:12", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 1789, "nodeType": "Block", "src": "1139:777:12", "statements": [ { "externalReferences": [ { "r": { "declaration": 1784, "isOffset": false, "isSlot": false, "src": "1441:1:12", "valueSize": 1 } }, { "pos": { "declaration": 1779, "isOffset": false, "isSlot": false, "src": "1424:3:12", "valueSize": 1 } }, { "signatures": { "declaration": 1777, "isOffset": false, "isSlot": false, "src": "1456:10:12", "valueSize": 1 } }, { "s": { "declaration": 1786, "isOffset": false, "isSlot": false, "src": "1506:1:12", "valueSize": 1 } }, { "signatures": { "declaration": 1777, "isOffset": false, "isSlot": false, "src": "1521:10:12", "valueSize": 1 } }, { "v": { "declaration": 1782, "isOffset": false, "isSlot": false, "src": "1837:1:12", "valueSize": 1 } }, { "signatures": { "declaration": 1777, "isOffset": false, "isSlot": false, "src": "1856:10:12", "valueSize": 1 } } ], "id": 1788, "nodeType": "InlineAssembly", "operations": "{\n let signaturePos := mul(0x41, pos)\n r := mload(add(signatures, add(signaturePos, 0x20)))\n s := mload(add(signatures, add(signaturePos, 0x40)))\n v := and(mload(add(signatures, add(signaturePos, 0x41))), 0xff)\n}", "src": "1371:545:12" } ] }, "documentation": "@dev divides bytes signature into `uint8 v, bytes32 r, bytes32 s`\n @param pos which signature to read\n @param signatures concatenated rsv signatures", "id": 1790, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "signatureSplit", "nodeType": "FunctionDefinition", "parameters": { "id": 1780, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1777, "name": "signatures", "nodeType": "VariableDeclaration", "scope": 1790, "src": "1026:16:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 1776, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "1026:5:12", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1779, "name": "pos", "nodeType": "VariableDeclaration", "scope": 1790, "src": "1044:11:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1778, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1044:7:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1025:31:12" }, "payable": false, "returnParameters": { "id": 1787, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1782, "name": "v", "nodeType": "VariableDeclaration", "scope": 1790, "src": "1104:7:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "typeName": { "id": 1781, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "1104:5:12", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1784, "name": "r", "nodeType": "VariableDeclaration", "scope": 1790, "src": "1113:9:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 1783, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1113:7:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1786, "name": "s", "nodeType": "VariableDeclaration", "scope": 1790, "src": "1124:9:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 1785, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1124:7:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "src": "1103:31:12" }, "scope": 1791, "src": "1002:914:12", "stateMutability": "pure", "superFunction": null, "visibility": "internal" } ], "scope": 1792, "src": "226:1692:12" } ], "src": "0:1919:12" }, "legacyAST": { "absolutePath": "/Users/apanizo/git/gnosis/safe-contracts/contracts/common/SignatureDecoder.sol", "exportedSymbols": { "SignatureDecoder": [ 1791 ] }, "id": 1792, "nodeType": "SourceUnit", "nodes": [ { "id": 1737, "literals": [ "solidity", "0.4", ".24" ], "nodeType": "PragmaDirective", "src": "0:23:12" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": "@title SignatureDecoder - Decodes signatures that a encoded as bytes\n @author Ricardo Guilherme Schmidt (Status Research & Development GmbH) \n @author Richard Meissner - ", "fullyImplemented": true, "id": 1791, "linearizedBaseContracts": [ 1791 ], "name": "SignatureDecoder", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 1774, "nodeType": "Block", "src": "656:169:12", "statements": [ { "assignments": [], "declarations": [ { "constant": false, "id": 1749, "name": "v", "nodeType": "VariableDeclaration", "scope": 1775, "src": "666:7:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "typeName": { "id": 1748, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "666:5:12", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "value": null, "visibility": "internal" } ], "id": 1750, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "666:7:12" }, { "assignments": [], "declarations": [ { "constant": false, "id": 1752, "name": "r", "nodeType": "VariableDeclaration", "scope": 1775, "src": "683:9:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 1751, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "683:7:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "id": 1753, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "683:9:12" }, { "assignments": [], "declarations": [ { "constant": false, "id": 1755, "name": "s", "nodeType": "VariableDeclaration", "scope": 1775, "src": "702:9:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 1754, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "702:7:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "id": 1756, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "702:9:12" }, { "expression": { "argumentTypes": null, "id": 1765, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "components": [ { "argumentTypes": null, "id": 1757, "name": "v", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1749, "src": "722:1:12", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, { "argumentTypes": null, "id": 1758, "name": "r", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1752, "src": "725:1:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "id": 1759, "name": "s", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1755, "src": "728:1:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], "id": 1760, "isConstant": false, "isInlineArray": false, "isLValue": true, "isPure": false, "lValueRequested": true, "nodeType": "TupleExpression", "src": "721:9:12", "typeDescriptions": { "typeIdentifier": "t_tuple$_t_uint8_$_t_bytes32_$_t_bytes32_$", "typeString": "tuple(uint8,bytes32,bytes32)" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1762, "name": "messageSignature", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1741, "src": "748:16:12", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, { "argumentTypes": null, "id": 1763, "name": "pos", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1743, "src": "766:3:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 1761, "name": "signatureSplit", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1790, "src": "733:14:12", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$_t_uint256_$returns$_t_uint8_$_t_bytes32_$_t_bytes32_$", "typeString": "function (bytes memory,uint256) pure returns (uint8,bytes32,bytes32)" } }, "id": 1764, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "733:37:12", "typeDescriptions": { "typeIdentifier": "t_tuple$_t_uint8_$_t_bytes32_$_t_bytes32_$", "typeString": "tuple(uint8,bytes32,bytes32)" } }, "src": "721:49:12", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1766, "nodeType": "ExpressionStatement", "src": "721:49:12" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1768, "name": "messageHash", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1739, "src": "797:11:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "id": 1769, "name": "v", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1749, "src": "810:1:12", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, { "argumentTypes": null, "id": 1770, "name": "r", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1752, "src": "813:1:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "id": 1771, "name": "s", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1755, "src": "816:1:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, { "typeIdentifier": "t_uint8", "typeString": "uint8" }, { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } ], "id": 1767, "name": "ecrecover", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4007, "src": "787:9:12", "typeDescriptions": { "typeIdentifier": "t_function_ecrecover_pure$_t_bytes32_$_t_uint8_$_t_bytes32_$_t_bytes32_$returns$_t_address_$", "typeString": "function (bytes32,uint8,bytes32,bytes32) pure returns (address)" } }, "id": 1772, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "787:31:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "functionReturnParameters": 1747, "id": 1773, "nodeType": "Return", "src": "780:38:12" } ] }, "documentation": "@dev Recovers address who signed the message \n @param messageHash operation ethereum signed message hash\n @param messageSignature message `txHash` signature\n @param pos which signature to read", "id": 1775, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "recoverKey", "nodeType": "FunctionDefinition", "parameters": { "id": 1744, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1739, "name": "messageHash", "nodeType": "VariableDeclaration", "scope": 1775, "src": "515:19:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 1738, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "515:7:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1741, "name": "messageSignature", "nodeType": "VariableDeclaration", "scope": 1775, "src": "545:22:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 1740, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "545:5:12", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1743, "name": "pos", "nodeType": "VariableDeclaration", "scope": 1775, "src": "577:11:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1742, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "577:7:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "505:89:12" }, "payable": false, "returnParameters": { "id": 1747, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1746, "name": "", "nodeType": "VariableDeclaration", "scope": 1775, "src": "642:7:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1745, "name": "address", "nodeType": "ElementaryTypeName", "src": "642:7:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "641:9:12" }, "scope": 1791, "src": "485:340:12", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 1789, "nodeType": "Block", "src": "1139:777:12", "statements": [ { "externalReferences": [ { "r": { "declaration": 1784, "isOffset": false, "isSlot": false, "src": "1441:1:12", "valueSize": 1 } }, { "pos": { "declaration": 1779, "isOffset": false, "isSlot": false, "src": "1424:3:12", "valueSize": 1 } }, { "signatures": { "declaration": 1777, "isOffset": false, "isSlot": false, "src": "1456:10:12", "valueSize": 1 } }, { "s": { "declaration": 1786, "isOffset": false, "isSlot": false, "src": "1506:1:12", "valueSize": 1 } }, { "signatures": { "declaration": 1777, "isOffset": false, "isSlot": false, "src": "1521:10:12", "valueSize": 1 } }, { "v": { "declaration": 1782, "isOffset": false, "isSlot": false, "src": "1837:1:12", "valueSize": 1 } }, { "signatures": { "declaration": 1777, "isOffset": false, "isSlot": false, "src": "1856:10:12", "valueSize": 1 } } ], "id": 1788, "nodeType": "InlineAssembly", "operations": "{\n let signaturePos := mul(0x41, pos)\n r := mload(add(signatures, add(signaturePos, 0x20)))\n s := mload(add(signatures, add(signaturePos, 0x40)))\n v := and(mload(add(signatures, add(signaturePos, 0x41))), 0xff)\n}", "src": "1371:545:12" } ] }, "documentation": "@dev divides bytes signature into `uint8 v, bytes32 r, bytes32 s`\n @param pos which signature to read\n @param signatures concatenated rsv signatures", "id": 1790, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "signatureSplit", "nodeType": "FunctionDefinition", "parameters": { "id": 1780, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1777, "name": "signatures", "nodeType": "VariableDeclaration", "scope": 1790, "src": "1026:16:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 1776, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "1026:5:12", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1779, "name": "pos", "nodeType": "VariableDeclaration", "scope": 1790, "src": "1044:11:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1778, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1044:7:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1025:31:12" }, "payable": false, "returnParameters": { "id": 1787, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1782, "name": "v", "nodeType": "VariableDeclaration", "scope": 1790, "src": "1104:7:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "typeName": { "id": 1781, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "1104:5:12", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1784, "name": "r", "nodeType": "VariableDeclaration", "scope": 1790, "src": "1113:9:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 1783, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1113:7:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1786, "name": "s", "nodeType": "VariableDeclaration", "scope": 1790, "src": "1124:9:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 1785, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1124:7:12", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "src": "1103:31:12" }, "scope": 1791, "src": "1002:914:12", "stateMutability": "pure", "superFunction": null, "visibility": "internal" } ], "scope": 1792, "src": "226:1692:12" } ], "src": "0:1919:12" }, "compiler": { "name": "solc", "version": "0.4.24+commit.e67f0147.Emscripten.clang" }, "networks": {}, "schemaVersion": "2.0.0", "updatedAt": "2018-10-05T14:25:58.938Z" }