UNPKG

@aragon/apps-payroll

Version:

_**Code in Github:**_ [aragon-apps/apps/payroll](https://github.com/aragon/aragon-apps/tree/master/future-apps/payroll)

1,224 lines (1,223 loc) 149 kB
{ "contractName": "SafeMath64", "abi": [], "bytecode": "0x604c602c600b82828239805160001a60731460008114601c57601e565bfe5b5030600052607381538281f30073000000000000000000000000000000000000000030146080604052600080fd00a165627a7a7230582031719416f4f24d6b9468cd7d6506c103f353caf36ff95c9231aacfce8635c8e70029", "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fd00a165627a7a7230582031719416f4f24d6b9468cd7d6506c103f353caf36ff95c9231aacfce8635c8e70029", "sourceMap": "430:1849:60:-;;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": "430:1849:60:-;;;;;;;;", "source": "// See https://github.com/OpenZeppelin/openzeppelin-solidity/blob/d51e38758e1d985661534534d5c61e27bece5042/contracts/math/SafeMath.sol\n// Adapted for uint64, pragma ^0.4.24, and satisfying our linter rules\n// Also optimized the mul() implementation, see https://github.com/aragon/aragonOS/pull/417\n\npragma solidity ^0.4.24;\n\n\n/**\n * @title SafeMath64\n * @dev Math operations for uint64 with safety checks that revert on error\n */\nlibrary SafeMath64 {\n string private constant ERROR_ADD_OVERFLOW = \"MATH64_ADD_OVERFLOW\";\n string private constant ERROR_SUB_UNDERFLOW = \"MATH64_SUB_UNDERFLOW\";\n string private constant ERROR_MUL_OVERFLOW = \"MATH64_MUL_OVERFLOW\";\n string private constant ERROR_DIV_ZERO = \"MATH64_DIV_ZERO\";\n\n /**\n * @dev Multiplies two numbers, reverts on overflow.\n */\n function mul(uint64 _a, uint64 _b) internal pure returns (uint64) {\n uint256 c = uint256(_a) * uint256(_b);\n require(c < 0x010000000000000000, ERROR_MUL_OVERFLOW); // 2**64 (less gas this way)\n\n return uint64(c);\n }\n\n /**\n * @dev Integer division of two numbers truncating the quotient, reverts on division by zero.\n */\n function div(uint64 _a, uint64 _b) internal pure returns (uint64) {\n require(_b > 0, ERROR_DIV_ZERO); // Solidity only automatically asserts when dividing by 0\n uint64 c = _a / _b;\n // assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold\n\n return c;\n }\n\n /**\n * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).\n */\n function sub(uint64 _a, uint64 _b) internal pure returns (uint64) {\n require(_b <= _a, ERROR_SUB_UNDERFLOW);\n uint64 c = _a - _b;\n\n return c;\n }\n\n /**\n * @dev Adds two numbers, reverts on overflow.\n */\n function add(uint64 _a, uint64 _b) internal pure returns (uint64) {\n uint64 c = _a + _b;\n require(c >= _a, ERROR_ADD_OVERFLOW);\n\n return c;\n }\n\n /**\n * @dev Divides two numbers and returns the remainder (unsigned integer modulo),\n * reverts when dividing by zero.\n */\n function mod(uint64 a, uint64 b) internal pure returns (uint64) {\n require(b != 0, ERROR_DIV_ZERO);\n return a % b;\n }\n}\n", "sourcePath": "@aragon/os/contracts/lib/math/SafeMath64.sol", "ast": { "absolutePath": "@aragon/os/contracts/lib/math/SafeMath64.sol", "exportedSymbols": { "SafeMath64": [ 14206 ] }, "id": 14207, "nodeType": "SourceUnit", "nodes": [ { "id": 14066, "literals": [ "solidity", "^", "0.4", ".24" ], "nodeType": "PragmaDirective", "src": "299:24:60" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "library", "documentation": "@title SafeMath64\n@dev Math operations for uint64 with safety checks that revert on error", "fullyImplemented": true, "id": 14206, "linearizedBaseContracts": [ 14206 ], "name": "SafeMath64", "nodeType": "ContractDefinition", "nodes": [ { "constant": true, "id": 14069, "name": "ERROR_ADD_OVERFLOW", "nodeType": "VariableDeclaration", "scope": 14206, "src": "455:66:60", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_memory", "typeString": "string" }, "typeName": { "id": 14067, "name": "string", "nodeType": "ElementaryTypeName", "src": "455:6:60", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": { "argumentTypes": null, "hexValue": "4d41544836345f4144445f4f564552464c4f57", "id": 14068, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "500:21:60", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_d930cfdbbe365885d0379a109568efa7352987dfb09ced0a5e91c871216a2ab9", "typeString": "literal_string \"MATH64_ADD_OVERFLOW\"" }, "value": "MATH64_ADD_OVERFLOW" }, "visibility": "private" }, { "constant": true, "id": 14072, "name": "ERROR_SUB_UNDERFLOW", "nodeType": "VariableDeclaration", "scope": 14206, "src": "527:68:60", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_memory", "typeString": "string" }, "typeName": { "id": 14070, "name": "string", "nodeType": "ElementaryTypeName", "src": "527:6:60", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": { "argumentTypes": null, "hexValue": "4d41544836345f5355425f554e444552464c4f57", "id": 14071, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "573:22:60", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_e3c7a63bc0f460df2aa5a1d89d9ccbe66d1b190b0e46fa6f1b6ce8c041481796", "typeString": "literal_string \"MATH64_SUB_UNDERFLOW\"" }, "value": "MATH64_SUB_UNDERFLOW" }, "visibility": "private" }, { "constant": true, "id": 14075, "name": "ERROR_MUL_OVERFLOW", "nodeType": "VariableDeclaration", "scope": 14206, "src": "601:66:60", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_memory", "typeString": "string" }, "typeName": { "id": 14073, "name": "string", "nodeType": "ElementaryTypeName", "src": "601:6:60", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": { "argumentTypes": null, "hexValue": "4d41544836345f4d554c5f4f564552464c4f57", "id": 14074, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "646:21:60", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_d8a7e555c86dabeea432023ce73006834d0d5c9584d16630bfc60d18f9d73dd6", "typeString": "literal_string \"MATH64_MUL_OVERFLOW\"" }, "value": "MATH64_MUL_OVERFLOW" }, "visibility": "private" }, { "constant": true, "id": 14078, "name": "ERROR_DIV_ZERO", "nodeType": "VariableDeclaration", "scope": 14206, "src": "673:58:60", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_memory", "typeString": "string" }, "typeName": { "id": 14076, "name": "string", "nodeType": "ElementaryTypeName", "src": "673:6:60", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": { "argumentTypes": null, "hexValue": "4d41544836345f4449565f5a45524f", "id": 14077, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "714:17:60", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_55e2b641d5067ed3257cafb3b1580f71ccab8fad1ec101f06fc55f428a57c179", "typeString": "literal_string \"MATH64_DIV_ZERO\"" }, "value": "MATH64_DIV_ZERO" }, "visibility": "private" }, { "body": { "id": 14108, "nodeType": "Block", "src": "875:173:60", "statements": [ { "assignments": [ 14088 ], "declarations": [ { "constant": false, "id": 14088, "name": "c", "nodeType": "VariableDeclaration", "scope": 14109, "src": "885:9:60", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 14087, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "885:7:60", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 14096, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 14095, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 14090, "name": "_a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 14080, "src": "905:2:60", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint64", "typeString": "uint64" } ], "id": 14089, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "897:7:60", "typeDescriptions": { "typeIdentifier": "t_type$_t_uint256_$", "typeString": "type(uint256)" }, "typeName": "uint256" }, "id": 14091, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "897:11:60", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 14093, "name": "_b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 14082, "src": "919:2:60", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint64", "typeString": "uint64" } ], "id": 14092, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "911:7:60", "typeDescriptions": { "typeIdentifier": "t_type$_t_uint256_$", "typeString": "type(uint256)" }, "typeName": "uint256" }, "id": 14094, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "911:11:60", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "897:25:60", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "885:37:60" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 14100, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 14098, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 14088, "src": "940:1:60", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "<", "rightExpression": { "argumentTypes": null, "hexValue": "3078303130303030303030303030303030303030", "id": 14099, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "944:20:60", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_18446744073709551616_by_1", "typeString": "int_const 18446744073709551616" }, "value": "0x010000000000000000" }, "src": "940:24:60", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "id": 14101, "name": "ERROR_MUL_OVERFLOW", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 14075, "src": "966:18:60", "typeDescriptions": { "typeIdentifier": "t_string_memory", "typeString": "string memory" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_string_memory", "typeString": "string memory" } ], "id": 14097, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 15156, 15157 ], "referencedDeclaration": 15157, "src": "932:7:60", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 14102, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "932:53:60", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 14103, "nodeType": "ExpressionStatement", "src": "932:53:60" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 14105, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 14088, "src": "1039:1:60", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 14104, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "1032:6:60", "typeDescriptions": { "typeIdentifier": "t_type$_t_uint64_$", "typeString": "type(uint64)" }, "typeName": "uint64" }, "id": 14106, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1032:9:60", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" } }, "functionReturnParameters": 14086, "id": 14107, "nodeType": "Return", "src": "1025:16:60" } ] }, "documentation": "@dev Multiplies two numbers, reverts on overflow.", "id": 14109, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "mul", "nodeType": "FunctionDefinition", "parameters": { "id": 14083, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 14080, "name": "_a", "nodeType": "VariableDeclaration", "scope": 14109, "src": "822:9:60", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" }, "typeName": { "id": 14079, "name": "uint64", "nodeType": "ElementaryTypeName", "src": "822:6:60", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 14082, "name": "_b", "nodeType": "VariableDeclaration", "scope": 14109, "src": "833:9:60", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" }, "typeName": { "id": 14081, "name": "uint64", "nodeType": "ElementaryTypeName", "src": "833:6:60", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" } }, "value": null, "visibility": "internal" } ], "src": "821:22:60" }, "payable": false, "returnParameters": { "id": 14086, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 14085, "name": "", "nodeType": "VariableDeclaration", "scope": 14109, "src": "867:6:60", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" }, "typeName": { "id": 14084, "name": "uint64", "nodeType": "ElementaryTypeName", "src": "867:6:60", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" } }, "value": null, "visibility": "internal" } ], "src": "866:8:60" }, "scope": 14206, "src": "809:239:60", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 14133, "nodeType": "Block", "src": "1232:243:60", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint64", "typeString": "uint64" }, "id": 14121, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 14119, "name": "_b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 14113, "src": "1250:2:60", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 14120, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1255:1:60", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "1250:6:60", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "id": 14122, "name": "ERROR_DIV_ZERO", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 14078, "src": "1258:14:60", "typeDescriptions": { "typeIdentifier": "t_string_memory", "typeString": "string memory" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_string_memory", "typeString": "string memory" } ], "id": 14118, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 15156, 15157 ], "referencedDeclaration": 15157, "src": "1242:7:60", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 14123, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1242:31:60", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 14124, "nodeType": "ExpressionStatement", "src": "1242:31:60" }, { "assignments": [ 14126 ], "declarations": [ { "constant": false, "id": 14126, "name": "c", "nodeType": "VariableDeclaration", "scope": 14134, "src": "1341:8:60", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" }, "typeName": { "id": 14125, "name": "uint64", "nodeType": "ElementaryTypeName", "src": "1341:6:60", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" } }, "value": null, "visibility": "internal" } ], "id": 14130, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint64", "typeString": "uint64" }, "id": 14129, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 14127, "name": "_a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 14111, "src": "1352:2:60", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "argumentTypes": null, "id": 14128, "name": "_b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 14113, "src": "1357:2:60", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" } }, "src": "1352:7:60", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" } }, "nodeType": "VariableDeclarationStatement", "src": "1341:18:60" }, { "expression": { "argumentTypes": null, "id": 14131, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 14126, "src": "1467:1:60", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" } }, "functionReturnParameters": 14117, "id": 14132, "nodeType": "Return", "src": "1460:8:60" } ] }, "documentation": "@dev Integer division of two numbers truncating the quotient, reverts on division by zero.", "id": 14134, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "div", "nodeType": "FunctionDefinition", "parameters": { "id": 14114, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 14111, "name": "_a", "nodeType": "VariableDeclaration", "scope": 14134, "src": "1179:9:60", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" }, "typeName": { "id": 14110, "name": "uint64", "nodeType": "ElementaryTypeName", "src": "1179:6:60", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 14113, "name": "_b", "nodeType": "VariableDeclaration", "scope": 14134, "src": "1190:9:60", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" }, "typeName": { "id": 14112, "name": "uint64", "nodeType": "ElementaryTypeName", "src": "1190:6:60", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" } }, "value": null, "visibility": "internal" } ], "src": "1178:22:60" }, "payable": false, "returnParameters": { "id": 14117, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 14116, "name": "", "nodeType": "VariableDeclaration", "scope": 14134, "src": "1224:6:60", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" }, "typeName": { "id": 14115, "name": "uint64", "nodeType": "ElementaryTypeName", "src": "1224:6:60", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" } }, "value": null, "visibility": "internal" } ], "src": "1223:8:60" }, "scope": 14206, "src": "1166:309:60", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 14158, "nodeType": "Block", "src": "1662:102:60", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint64", "typeString": "uint64" }, "id": 14146, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 14144, "name": "_b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 14138, "src": "1680:2:60", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" } }, "nodeType": "BinaryOperation", "operator": "<=", "rightExpression": { "argumentTypes": null, "id": 14145, "name": "_a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 14136, "src": "1686:2:60", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" } }, "src": "1680:8:60", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "id": 14147, "name": "ERROR_SUB_UNDERFLOW", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 14072, "src": "1690:19:60", "typeDescriptions": { "typeIdentifier": "t_string_memory", "typeString": "string memory" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_string_memory", "typeString": "string memory" } ], "id": 14143, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 15156, 15157 ], "referencedDeclaration": 15157, "src": "1672:7:60", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 14148, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1672:38:60", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 14149, "nodeType": "ExpressionStatement", "src": "1672:38:60" }, { "assignments": [ 14151 ], "declarations": [ { "constant": false, "id": 14151, "name": "c", "nodeType": "VariableDeclaration", "scope": 14159, "src": "1720:8:60", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" }, "typeName": { "id": 14150, "name": "uint64", "nodeType": "ElementaryTypeName", "src": "1720:6:60", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" } }, "value": null, "visibility": "internal" } ], "id": 14155, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint64", "typeString": "uint64" }, "id": 14154, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 14152, "name": "_a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 14136, "src": "1731:2:60", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" } }, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": { "argumentTypes": null, "id": 14153, "name": "_b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 14138, "src": "1736:2:60", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" } }, "src": "1731:7:60", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" } }, "nodeType": "VariableDeclarationStatement", "src": "1720:18:60" }, { "expression": { "argumentTypes": null, "id": 14156, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 14151, "src": "1756:1:60", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" } }, "functionReturnParameters": 14142, "id": 14157, "nodeType": "Return", "src": "1749:8:60" } ] }, "documentation": "@dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).", "id": 14159, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "sub", "nodeType": "FunctionDefinition", "parameters": { "id": 14139, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 14136, "name": "_a", "nodeType": "VariableDeclaration", "scope": 14159, "src": "1609:9:60", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" }, "typeName": { "id": 14135, "name": "uint64",