{ "contractName": "SignatureValidator", "abi": [], "bytecode": "0x6080604052348015600f57600080fd5b50603580601d6000396000f3006080604052600080fd00a165627a7a723058200cdb9454422435d516dbae78d0a22b0e1372e2fd7734828c7dc1343365c85cd50029", "deployedBytecode": "0x6080604052600080fd00a165627a7a723058200cdb9454422435d516dbae78d0a22b0e1372e2fd7734828c7dc1343365c85cd50029", "sourceMap": "221:1679:17:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;221:1679:17;;;;;;;", "deployedSourceMap": "221:1679:17:-;;;;;", "source": "pragma solidity 0.4.24;\n\n\n/// @title SignatureValidator - recovers a sender from a signature \n/// @author Ricardo Guilherme Schmidt (Status Research & Development GmbH) \n/// @author Richard Meissner - \ncontract SignatureValidator {\n \n /// @dev Recovers address who signed the message \n /// @param txHash operation ethereum signed message hash\n /// @param messageSignature message `txHash` signature\n /// @param pos which signature to read\n function recoverKey (\n bytes32 txHash, \n bytes messageSignature,\n uint256 pos\n )\n pure\n internal\n returns (address) \n {\n uint8 v;\n bytes32 r;\n bytes32 s;\n (v, r, s) = signatureSplit(messageSignature, pos);\n return ecrecover(txHash, 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 pure\n internal\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/SignatureValidator.sol", "ast": { "absolutePath": "/Users/apanizo/git/gnosis/safe-contracts/contracts/SignatureValidator.sol", "exportedSymbols": { "SignatureValidator": [ 1821 ] }, "id": 1822, "nodeType": "SourceUnit", "nodes": [ { "id": 1767, "literals": [ "solidity", "0.4", ".24" ], "nodeType": "PragmaDirective", "src": "0:23:17" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": "@title SignatureValidator - recovers a sender from a signature \n @author Ricardo Guilherme Schmidt (Status Research & Development GmbH) \n @author Richard Meissner - ", "fullyImplemented": true, "id": 1821, "linearizedBaseContracts": [ 1821 ], "name": "SignatureValidator", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 1804, "nodeType": "Block", "src": "643:164:17", "statements": [ { "assignments": [], "declarations": [ { "constant": false, "id": 1779, "name": "v", "nodeType": "VariableDeclaration", "scope": 1805, "src": "653:7:17", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "typeName": { "id": 1778, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "653:5:17", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "value": null, "visibility": "internal" } ], "id": 1780, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "653:7:17" }, { "assignments": [], "declarations": [ { "constant": false, "id": 1782, "name": "r", "nodeType": "VariableDeclaration", "scope": 1805, "src": "670:9:17", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 1781, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "670:7:17", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "id": 1783, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "670:9:17" }, { "assignments": [], "declarations": [ { "constant": false, "id": 1785, "name": "s", "nodeType": "VariableDeclaration", "scope": 1805, "src": "689:9:17", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 1784, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "689:7:17", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "id": 1786, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "689:9:17" }, { "expression": { "argumentTypes": null, "id": 1795, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "components": [ { "argumentTypes": null, "id": 1787, "name": "v", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1779, "src": "709:1:17", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, { "argumentTypes": null, "id": 1788, "name": "r", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1782, "src": "712:1:17", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "id": 1789, "name": "s", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1785, "src": "715:1:17", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], "id": 1790, "isConstant": false, "isInlineArray": false, "isLValue": true, "isPure": false, "lValueRequested": true, "nodeType": "TupleExpression", "src": "708:9:17", "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": 1792, "name": "messageSignature", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1771, "src": "735:16:17", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, { "argumentTypes": null, "id": 1793, "name": "pos", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1773, "src": "753:3:17", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 1791, "name": "signatureSplit", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1820, "src": "720:14:17", "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": 1794, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "720:37:17", "typeDescriptions": { "typeIdentifier": "t_tuple$_t_uint8_$_t_bytes32_$_t_bytes32_$", "typeString": "tuple(uint8,bytes32,bytes32)" } }, "src": "708:49:17", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1796, "nodeType": "ExpressionStatement", "src": "708:49:17" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1798, "name": "txHash", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1769, "src": "784:6:17", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "id": 1799, "name": "v", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1779, "src": "792:1:17", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, { "argumentTypes": null, "id": 1800, "name": "r", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1782, "src": "795:1:17", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "id": 1801, "name": "s", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1785, "src": "798:1:17", "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": 1797, "name": "ecrecover", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3820, "src": "774:9:17", "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": 1802, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "774:26:17", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "functionReturnParameters": 1777, "id": 1803, "nodeType": "Return", "src": "767:33:17" } ] }, "documentation": "@dev Recovers address who signed the message \n @param txHash operation ethereum signed message hash\n @param messageSignature message `txHash` signature\n @param pos which signature to read", "id": 1805, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "recoverKey", "nodeType": "FunctionDefinition", "parameters": { "id": 1774, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1769, "name": "txHash", "nodeType": "VariableDeclaration", "scope": 1805, "src": "507:14:17", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 1768, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "507:7:17", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1771, "name": "messageSignature", "nodeType": "VariableDeclaration", "scope": 1805, "src": "532:22:17", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 1770, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "532:5:17", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1773, "name": "pos", "nodeType": "VariableDeclaration", "scope": 1805, "src": "564:11:17", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1772, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "564:7:17", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "497:84:17" }, "payable": false, "returnParameters": { "id": 1777, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1776, "name": "", "nodeType": "VariableDeclaration", "scope": 1805, "src": "629:7:17", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1775, "name": "address", "nodeType": "ElementaryTypeName", "src": "629:7:17", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "628:9:17" }, "scope": 1821, "src": "477:330:17", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 1819, "nodeType": "Block", "src": "1121:777:17", "statements": [ { "externalReferences": [ { "r": { "declaration": 1814, "isOffset": false, "isSlot": false, "src": "1423:1:17", "valueSize": 1 } }, { "pos": { "declaration": 1809, "isOffset": false, "isSlot": false, "src": "1406:3:17", "valueSize": 1 } }, { "signatures": { "declaration": 1807, "isOffset": false, "isSlot": false, "src": "1438:10:17", "valueSize": 1 } }, { "s": { "declaration": 1816, "isOffset": false, "isSlot": false, "src": "1488:1:17", "valueSize": 1 } }, { "signatures": { "declaration": 1807, "isOffset": false, "isSlot": false, "src": "1503:10:17", "valueSize": 1 } }, { "v": { "declaration": 1812, "isOffset": false, "isSlot": false, "src": "1819:1:17", "valueSize": 1 } }, { "signatures": { "declaration": 1807, "isOffset": false, "isSlot": false, "src": "1838:10:17", "valueSize": 1 } } ], "id": 1818, "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": "1353:545:17" } ] }, "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": 1820, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "signatureSplit", "nodeType": "FunctionDefinition", "parameters": { "id": 1810, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1807, "name": "signatures", "nodeType": "VariableDeclaration", "scope": 1820, "src": "1008:16:17", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 1806, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "1008:5:17", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1809, "name": "pos", "nodeType": "VariableDeclaration", "scope": 1820, "src": "1026:11:17", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1808, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1026:7:17", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1007:31:17" }, "payable": false, "returnParameters": { "id": 1817, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1812, "name": "v", "nodeType": "VariableDeclaration", "scope": 1820, "src": "1086:7:17", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "typeName": { "id": 1811, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "1086:5:17", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1814, "name": "r", "nodeType": "VariableDeclaration", "scope": 1820, "src": "1095:9:17", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 1813, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1095:7:17", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1816, "name": "s", "nodeType": "VariableDeclaration", "scope": 1820, "src": "1106:9:17", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 1815, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1106:7:17", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "src": "1085:31:17" }, "scope": 1821, "src": "984:914:17", "stateMutability": "pure", "superFunction": null, "visibility": "internal" } ], "scope": 1822, "src": "221:1679:17" } ], "src": "0:1901:17" }, "legacyAST": { "absolutePath": "/Users/apanizo/git/gnosis/safe-contracts/contracts/SignatureValidator.sol", "exportedSymbols": { "SignatureValidator": [ 1821 ] }, "id": 1822, "nodeType": "SourceUnit", "nodes": [ { "id": 1767, "literals": [ "solidity", "0.4", ".24" ], "nodeType": "PragmaDirective", "src": "0:23:17" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": "@title SignatureValidator - recovers a sender from a signature \n @author Ricardo Guilherme Schmidt (Status Research & Development GmbH) \n @author Richard Meissner - ", "fullyImplemented": true, "id": 1821, "linearizedBaseContracts": [ 1821 ], "name": "SignatureValidator", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 1804, "nodeType": "Block", "src": "643:164:17", "statements": [ { "assignments": [], "declarations": [ { "constant": false, "id": 1779, "name": "v", "nodeType": "VariableDeclaration", "scope": 1805, "src": "653:7:17", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "typeName": { "id": 1778, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "653:5:17", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "value": null, "visibility": "internal" } ], "id": 1780, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "653:7:17" }, { "assignments": [], "declarations": [ { "constant": false, "id": 1782, "name": "r", "nodeType": "VariableDeclaration", "scope": 1805, "src": "670:9:17", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 1781, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "670:7:17", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "id": 1783, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "670:9:17" }, { "assignments": [], "declarations": [ { "constant": false, "id": 1785, "name": "s", "nodeType": "VariableDeclaration", "scope": 1805, "src": "689:9:17", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 1784, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "689:7:17", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "id": 1786, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "689:9:17" }, { "expression": { "argumentTypes": null, "id": 1795, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "components": [ { "argumentTypes": null, "id": 1787, "name": "v", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1779, "src": "709:1:17", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, { "argumentTypes": null, "id": 1788, "name": "r", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1782, "src": "712:1:17", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "id": 1789, "name": "s", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1785, "src": "715:1:17", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], "id": 1790, "isConstant": false, "isInlineArray": false, "isLValue": true, "isPure": false, "lValueRequested": true, "nodeType": "TupleExpression", "src": "708:9:17", "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": 1792, "name": "messageSignature", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1771, "src": "735:16:17", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, { "argumentTypes": null, "id": 1793, "name": "pos", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1773, "src": "753:3:17", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 1791, "name": "signatureSplit", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1820, "src": "720:14:17", "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": 1794, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "720:37:17", "typeDescriptions": { "typeIdentifier": "t_tuple$_t_uint8_$_t_bytes32_$_t_bytes32_$", "typeString": "tuple(uint8,bytes32,bytes32)" } }, "src": "708:49:17", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1796, "nodeType": "ExpressionStatement", "src": "708:49:17" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1798, "name": "txHash", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1769, "src": "784:6:17", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "id": 1799, "name": "v", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1779, "src": "792:1:17", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, { "argumentTypes": null, "id": 1800, "name": "r", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1782, "src": "795:1:17", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "id": 1801, "name": "s", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1785, "src": "798:1:17", "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": 1797, "name": "ecrecover", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3820, "src": "774:9:17", "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": 1802, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "774:26:17", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "functionReturnParameters": 1777, "id": 1803, "nodeType": "Return", "src": "767:33:17" } ] }, "documentation": "@dev Recovers address who signed the message \n @param txHash operation ethereum signed message hash\n @param messageSignature message `txHash` signature\n @param pos which signature to read", "id": 1805, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "recoverKey", "nodeType": "FunctionDefinition", "parameters": { "id": 1774, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1769, "name": "txHash", "nodeType": "VariableDeclaration", "scope": 1805, "src": "507:14:17", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 1768, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "507:7:17", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1771, "name": "messageSignature", "nodeType": "VariableDeclaration", "scope": 1805, "src": "532:22:17", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 1770, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "532:5:17", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1773, "name": "pos", "nodeType": "VariableDeclaration", "scope": 1805, "src": "564:11:17", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1772, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "564:7:17", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "497:84:17" }, "payable": false, "returnParameters": { "id": 1777, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1776, "name": "", "nodeType": "VariableDeclaration", "scope": 1805, "src": "629:7:17", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1775, "name": "address", "nodeType": "ElementaryTypeName", "src": "629:7:17", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "628:9:17" }, "scope": 1821, "src": "477:330:17", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 1819, "nodeType": "Block", "src": "1121:777:17", "statements": [ { "externalReferences": [ { "r": { "declaration": 1814, "isOffset": false, "isSlot": false, "src": "1423:1:17", "valueSize": 1 } }, { "pos": { "declaration": 1809, "isOffset": false, "isSlot": false, "src": "1406:3:17", "valueSize": 1 } }, { "signatures": { "declaration": 1807, "isOffset": false, "isSlot": false, "src": "1438:10:17", "valueSize": 1 } }, { "s": { "declaration": 1816, "isOffset": false, "isSlot": false, "src": "1488:1:17", "valueSize": 1 } }, { "signatures": { "declaration": 1807, "isOffset": false, "isSlot": false, "src": "1503:10:17", "valueSize": 1 } }, { "v": { "declaration": 1812, "isOffset": false, "isSlot": false, "src": "1819:1:17", "valueSize": 1 } }, { "signatures": { "declaration": 1807, "isOffset": false, "isSlot": false, "src": "1838:10:17", "valueSize": 1 } } ], "id": 1818, "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": "1353:545:17" } ] }, "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": 1820, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "signatureSplit", "nodeType": "FunctionDefinition", "parameters": { "id": 1810, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1807, "name": "signatures", "nodeType": "VariableDeclaration", "scope": 1820, "src": "1008:16:17", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 1806, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "1008:5:17", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1809, "name": "pos", "nodeType": "VariableDeclaration", "scope": 1820, "src": "1026:11:17", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1808, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1026:7:17", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1007:31:17" }, "payable": false, "returnParameters": { "id": 1817, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1812, "name": "v", "nodeType": "VariableDeclaration", "scope": 1820, "src": "1086:7:17", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "typeName": { "id": 1811, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "1086:5:17", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1814, "name": "r", "nodeType": "VariableDeclaration", "scope": 1820, "src": "1095:9:17", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 1813, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1095:7:17", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1816, "name": "s", "nodeType": "VariableDeclaration", "scope": 1820, "src": "1106:9:17", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 1815, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1106:7:17", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "src": "1085:31:17" }, "scope": 1821, "src": "984:914:17", "stateMutability": "pure", "superFunction": null, "visibility": "internal" } ], "scope": 1822, "src": "221:1679:17" } ], "src": "0:1901:17" }, "compiler": { "name": "solc", "version": "0.4.24+commit.e67f0147.Emscripten.clang" }, "networks": {}, "schemaVersion": "2.0.0", "updatedAt": "2018-08-20T07:44:41.093Z" }