@aragon/apps-payroll
Version:
_**Code in Github:**_ [aragon-apps/apps/payroll](https://github.com/aragon/aragon-apps/tree/master/future-apps/payroll)
1,157 lines (1,156 loc) • 115 kB
JSON
{
"contractName": "ECRecovery",
"abi": [],
"bytecode": "0x604c602c600b82828239805160001a60731460008114601c57601e565bfe5b5030600052607381538281f30073000000000000000000000000000000000000000030146080604052600080fd00a165627a7a723058209ec450206e877ff0553a50291ad69176fbccf0e1c44a3bca4dfd10b78f38dfee0029",
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fd00a165627a7a723058209ec450206e877ff0553a50291ad69176fbccf0e1c44a3bca4dfd10b78f38dfee0029",
"sourceMap": "272:1857:65:-;;132:2:-1;166:7;155:9;146:7;137:37;252:7;246:14;243:1;238:23;232:4;229:33;270:1;265:20;;;;222:63;;265:20;274:9;222:63;;298:9;295:1;288:20;328:4;319:7;311:22;352:7;343;336:24",
"deployedSourceMap": "272:1857:65:-;;;;;;;;",
"source": "pragma solidity 0.4.24;\n\n// Using ECRecovery from open-zeppelin@ad12381549c4c0711c2f3310e9fb1f65d51c299c + added personalRecover function\n// See https://github.com/OpenZeppelin/openzeppelin-solidity/blob/ad12381549c4c0711c2f3310e9fb1f65d51c299c/contracts/ECRecovery.sol\n\n\nlibrary ECRecovery {\n /**\n * @dev Recover signer address from a personal signed message by using his signature\n * @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address.\n * @param sig bytes signature, the signature is generated using web3.personal.sign()\n */\n function personalRecover(bytes32 hash, bytes sig) internal pure returns (address) {\n return recover(toEthSignedMessageHash(hash), sig);\n }\n\n /**\n * @dev Recover signer address from a message by using his signature\n * @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address.\n * @param sig bytes signature, the signature is generated using web3.eth.sign()\n */\n function recover(bytes32 hash, bytes sig) internal pure returns (address) {\n bytes32 r;\n bytes32 s;\n uint8 v;\n\n //Check the signature length\n if (sig.length != 65) {\n return (address(0));\n }\n\n // Divide the signature in r, s and v variables\n assembly {\n r := mload(add(sig, 32))\n s := mload(add(sig, 64))\n v := byte(0, mload(add(sig, 96)))\n }\n\n // Version of signature should be 27 or 28, but 0 and 1 are also possible versions\n if (v < 27) {\n v += 27;\n }\n\n // If the version is correct return the signer address\n if (v != 27 && v != 28) {\n return (address(0));\n } else {\n return ecrecover(hash, v, r, s);\n }\n }\n\n /**\n * toEthSignedMessageHash\n * @dev prefix a bytes32 value with \"\\x19Ethereum Signed Message:\"\n * @dev and hash the result\n */\n function toEthSignedMessageHash(bytes32 hash)\n internal\n pure\n returns (bytes32)\n {\n // 32 is the length in bytes of hash,\n // enforced by the type signature above\n return keccak256(abi.encodePacked(\n \"\\x19Ethereum Signed Message:\\n32\",\n hash\n ));\n }\n}\n",
"sourcePath": "@aragon/ppf-contracts/contracts/open-zeppelin/ECRecovery.sol",
"ast": {
"absolutePath": "@aragon/ppf-contracts/contracts/open-zeppelin/ECRecovery.sol",
"exportedSymbols": {
"ECRecovery": [
14985
]
},
"id": 14986,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 14889,
"literals": [
"solidity",
"0.4",
".24"
],
"nodeType": "PragmaDirective",
"src": "0:23:65"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": null,
"fullyImplemented": true,
"id": 14985,
"linearizedBaseContracts": [
14985
],
"name": "ECRecovery",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 14905,
"nodeType": "Block",
"src": "670:60:65",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14900,
"name": "hash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14891,
"src": "714:4:65",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 14899,
"name": "toEthSignedMessageHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14984,
"src": "691:22:65",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_bytes32_$returns$_t_bytes32_$",
"typeString": "function (bytes32) pure returns (bytes32)"
}
},
"id": 14901,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "691:28:65",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
{
"argumentTypes": null,
"id": 14902,
"name": "sig",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14893,
"src": "721:3:65",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
],
"id": 14898,
"name": "recover",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14968,
"src": "683:7:65",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_bytes32_$_t_bytes_memory_ptr_$returns$_t_address_$",
"typeString": "function (bytes32,bytes memory) pure returns (address)"
}
},
"id": 14903,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "683:42:65",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"functionReturnParameters": 14897,
"id": 14904,
"nodeType": "Return",
"src": "676:49:65"
}
]
},
"documentation": "@dev Recover signer address from a personal signed message by using his signature\n@param hash bytes32 message, the hash is the signed message. What is recovered is the signer address.\n@param sig bytes signature, the signature is generated using web3.personal.sign()",
"id": 14906,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "personalRecover",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 14894,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14891,
"name": "hash",
"nodeType": "VariableDeclaration",
"scope": 14906,
"src": "613:12:65",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 14890,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "613:7:65",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14893,
"name": "sig",
"nodeType": "VariableDeclaration",
"scope": 14906,
"src": "627:9:65",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 14892,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "627:5:65",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "612:25:65"
},
"payable": false,
"returnParameters": {
"id": 14897,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14896,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 14906,
"src": "661:7:65",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 14895,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "661:7:65",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "660:9:65"
},
"scope": 14985,
"src": "588:142:65",
"stateMutability": "pure",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 14967,
"nodeType": "Block",
"src": "1080:621:65",
"statements": [
{
"assignments": [],
"declarations": [
{
"constant": false,
"id": 14916,
"name": "r",
"nodeType": "VariableDeclaration",
"scope": 14968,
"src": "1086:9:65",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 14915,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "1086:7:65",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14917,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "1086:9:65"
},
{
"assignments": [],
"declarations": [
{
"constant": false,
"id": 14919,
"name": "s",
"nodeType": "VariableDeclaration",
"scope": 14968,
"src": "1101:9:65",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 14918,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "1101:7:65",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14920,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "1101:9:65"
},
{
"assignments": [],
"declarations": [
{
"constant": false,
"id": 14922,
"name": "v",
"nodeType": "VariableDeclaration",
"scope": 14968,
"src": "1116:7:65",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
},
"typeName": {
"id": 14921,
"name": "uint8",
"nodeType": "ElementaryTypeName",
"src": "1116:5:65",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14923,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "1116:7:65"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14927,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 14924,
"name": "sig",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14910,
"src": "1167:3:65",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
"id": 14925,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1167:10:65",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"hexValue": "3635",
"id": 14926,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1181:2:65",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_65_by_1",
"typeString": "int_const 65"
},
"value": "65"
},
"src": "1167:16:65",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 14934,
"nodeType": "IfStatement",
"src": "1163:56:65",
"trueBody": {
"id": 14933,
"nodeType": "Block",
"src": "1185:34:65",
"statements": [
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 14929,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1209:1:65",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 14928,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1201:7:65",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": "address"
},
"id": 14930,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1201:10:65",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 14931,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "1200:12:65",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"functionReturnParameters": 14914,
"id": 14932,
"nodeType": "Return",
"src": "1193:19:65"
}
]
}
},
{
"externalReferences": [
{
"r": {
"declaration": 14916,
"isOffset": false,
"isSlot": false,
"src": "1294:1:65",
"valueSize": 1
}
},
{
"v": {
"declaration": 14922,
"isOffset": false,
"isSlot": false,
"src": "1356:1:65",
"valueSize": 1
}
},
{
"sig": {
"declaration": 14910,
"isOffset": false,
"isSlot": false,
"src": "1309:3:65",
"valueSize": 1
}
},
{
"s": {
"declaration": 14919,
"isOffset": false,
"isSlot": false,
"src": "1325:1:65",
"valueSize": 1
}
},
{
"sig": {
"declaration": 14910,
"isOffset": false,
"isSlot": false,
"src": "1340:3:65",
"valueSize": 1
}
},
{
"sig": {
"declaration": 14910,
"isOffset": false,
"isSlot": false,
"src": "1379:3:65",
"valueSize": 1
}
}
],
"id": 14935,
"nodeType": "InlineAssembly",
"operations": "{\n r := mload(add(sig, 32))\n s := mload(add(sig, 64))\n v := byte(0, mload(add(sig, 96)))\n}",
"src": "1277:213:65"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
},
"id": 14938,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14936,
"name": "v",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14922,
"src": "1492:1:65",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"hexValue": "3237",
"id": 14937,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1496:2:65",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_27_by_1",
"typeString": "int_const 27"
},
"value": "27"
},
"src": "1492:6:65",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 14944,
"nodeType": "IfStatement",
"src": "1488:34:65",
"trueBody": {
"id": 14943,
"nodeType": "Block",
"src": "1500:22:65",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 14941,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 14939,
"name": "v",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14922,
"src": "1508:1:65",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"nodeType": "Assignment",
"operator": "+=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "3237",
"id": 14940,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1513:2:65",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_27_by_1",
"typeString": "int_const 27"
},
"value": "27"
},
"src": "1508:7:65",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"id": 14942,
"nodeType": "ExpressionStatement",
"src": "1508:7:65"
}
]
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 14951,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
},
"id": 14947,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14945,
"name": "v",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14922,
"src": "1591:1:65",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"hexValue": "3237",
"id": 14946,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1596:2:65",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_27_by_1",
"typeString": "int_const 27"
},
"value": "27"
},
"src": "1591:7:65",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
},
"id": 14950,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14948,
"name": "v",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14922,
"src": "1602:1:65",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"hexValue": "3238",
"id": 14949,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1607:2:65",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_28_by_1",
"typeString": "int_const 28"
},
"value": "28"
},
"src": "1602:7:65",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "1591:18:65",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 14965,
"nodeType": "Block",
"src": "1651:46:65",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14959,
"name": "hash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14908,
"src": "1676:4:65",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
{
"argumentTypes": null,
"id": 14960,
"name": "v",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14922,
"src": "1682:1:65",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
{
"argumentTypes": null,
"id": 14961,
"name": "r",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14916,
"src": "1685:1:65",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
{
"argumentTypes": null,
"id": 14962,
"name": "s",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14919,
"src": "1688:1:65",
"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": 14958,
"name": "ecrecover",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15145,
"src": "1666:9:65",
"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": 14963,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1666:24:65",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"functionReturnParameters": 14914,
"id": 14964,
"nodeType": "Return",
"src": "1659:31:65"
}
]
},
"id": 14966,
"nodeType": "IfStatement",
"src": "1587:110:65",
"trueBody": {
"id": 14957,
"nodeType": "Block",
"src": "1611:34:65",
"statements": [
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 14953,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1635:1:65",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 14952,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1627:7:65",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": "address"
},
"id": 14954,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1627:10:65",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 14955,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "1626:12:65",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"functionReturnParameters": 14914,
"id": 14956,
"nodeType": "Return",
"src": "1619:19:65"
}
]
}
}
]
},
"documentation": "@dev Recover signer address from a message by using his signature\n@param hash bytes32 message, the hash is the signed message. What is recovered is the signer address.\n@param sig bytes signature, the signature is generated using web3.eth.sign()",
"id": 14968,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "recover",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 14911,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14908,
"name": "hash",
"nodeType": "VariableDeclaration",
"scope": 14968,
"src": "1023:12:65",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 14907,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "1023:7:65",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14910,
"name": "sig",
"nodeType": "VariableDeclaration",
"scope": 14968,
"src": "1037:9:65",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 14909,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "1037:5:65",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1022:25:65"
},
"payable": false,
"returnParameters": {
"id": 14914,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14913,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 14968,
"src": "1071:7:65",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 14912,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1071:7:65",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1070:9:65"
},
"scope": 14985,
"src": "1006:695:65",
"stateMutability": "pure",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 14983,
"nodeType": "Block",
"src": "1936:191:65",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{