UNPKG

@zjbtest/contracts

Version:
1,020 lines 305 kB
{ "contractName": "SafeMath", "abi": [], "metadata": "{\"compiler\":{\"version\":\"0.8.0+commit.c7dfd78e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"details\":\"Wrappers over Solidity's arithmetic operations. NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler now has built in overflow checking.\",\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/utils/math/SafeMath.sol\":\"SafeMath\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/math/SafeMath.sol\":{\"keccak256\":\"0x8666f020bd8fc9dc14f07e2ebc52b5f236ab4cdde7c77679b08cb2f94730043b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://163776cbf565c722232393aa2d62cbe8a2ffb5805986abf4906c00e1e07450a6\",\"dweb:/ipfs/QmPZoN9T3cb6o8bGhjBPZcz7im8T8DWhpr3tjLwhJJHx9N\"]}},\"version\":1}", "bytecode": "0x60566050600b82828239805160001a6073146043577f4e487b7100000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212202a65302a5d4f2bc5fb17c463a6de59b461d66f1d4923aed6f3c67f01504e769764736f6c63430008000033", "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212202a65302a5d4f2bc5fb17c463a6de59b461d66f1d4923aed6f3c67f01504e769764736f6c63430008000033", "immutableReferences": {}, "generatedSources": [], "deployedGeneratedSources": [], "sourceMap": "398:6301:19:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;", "deployedSourceMap": "398:6301:19:-:0;;;;;;;;", "source": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n// CAUTION\n// This version of SafeMath should only be used with Solidity 0.8 or later,\n// because it relies on the compiler's built in overflow checks.\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations.\n *\n * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler\n * now has built in overflow checking.\n */\nlibrary SafeMath {\n /**\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `+` operator.\n *\n * Requirements:\n *\n * - Addition cannot overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n return a + b;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n return a - b;\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `*` operator.\n *\n * Requirements:\n *\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n return a * b;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator.\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n return a % b;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n * overflow (when the result is negative).\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {trySub}.\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(\n uint256 a,\n uint256 b,\n string memory errorMessage\n ) internal pure returns (uint256) {\n unchecked {\n require(b <= a, errorMessage);\n return a - b;\n }\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(\n uint256 a,\n uint256 b,\n string memory errorMessage\n ) internal pure returns (uint256) {\n unchecked {\n require(b > 0, errorMessage);\n return a / b;\n }\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting with custom message when dividing by zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryMod}.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(\n uint256 a,\n uint256 b,\n string memory errorMessage\n ) internal pure returns (uint256) {\n unchecked {\n require(b > 0, errorMessage);\n return a % b;\n }\n }\n}\n", "sourcePath": "@openzeppelin/contracts/utils/math/SafeMath.sol", "ast": { "absolutePath": "@openzeppelin/contracts/utils/math/SafeMath.sol", "exportedSymbols": { "SafeMath": [ 3057 ] }, "id": 3058, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 2747, "literals": [ "solidity", "^", "0.8", ".0" ], "nodeType": "PragmaDirective", "src": "33:23:19" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "library", "documentation": { "id": 2748, "nodeType": "StructuredDocumentation", "src": "211:186:19", "text": " @dev Wrappers over Solidity's arithmetic operations.\n NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler\n now has built in overflow checking." }, "fullyImplemented": true, "id": 3057, "linearizedBaseContracts": [ 3057 ], "name": "SafeMath", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 2779, "nodeType": "Block", "src": "633:140:19", "statements": [ { "id": 2778, "nodeType": "UncheckedBlock", "src": "643:124:19", "statements": [ { "assignments": [ 2761 ], "declarations": [ { "constant": false, "id": 2761, "mutability": "mutable", "name": "c", "nodeType": "VariableDeclaration", "scope": 2778, "src": "667:9:19", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2760, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "667:7:19", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 2765, "initialValue": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2764, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2762, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2751, "src": "679:1:19", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "id": 2763, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2753, "src": "683:1:19", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "679:5:19", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "667:17:19" }, { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2768, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2766, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2761, "src": "702:1:19", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "<", "rightExpression": { "id": 2767, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2751, "src": "706:1:19", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "702:5:19", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 2773, "nodeType": "IfStatement", "src": "698:28:19", "trueBody": { "expression": { "components": [ { "hexValue": "66616c7365", "id": 2769, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "717:5:19", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "false" }, { "hexValue": "30", "id": 2770, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "724:1:19", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" } ], "id": 2771, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "TupleExpression", "src": "716:10:19", "typeDescriptions": { "typeIdentifier": "t_tuple$_t_bool_$_t_rational_0_by_1_$", "typeString": "tuple(bool,int_const 0)" } }, "functionReturnParameters": 2759, "id": 2772, "nodeType": "Return", "src": "709:17:19" } }, { "expression": { "components": [ { "hexValue": "74727565", "id": 2774, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "748:4:19", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "true" }, { "id": 2775, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2761, "src": "754:1:19", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "id": 2776, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "747:9:19", "typeDescriptions": { "typeIdentifier": "t_tuple$_t_bool_$_t_uint256_$", "typeString": "tuple(bool,uint256)" } }, "functionReturnParameters": 2759, "id": 2777, "nodeType": "Return", "src": "740:16:19" } ] } ] }, "documentation": { "id": 2749, "nodeType": "StructuredDocumentation", "src": "421:131:19", "text": " @dev Returns the addition of two unsigned integers, with an overflow flag.\n _Available since v3.4._" }, "id": 2780, "implemented": true, "kind": "function", "modifiers": [], "name": "tryAdd", "nodeType": "FunctionDefinition", "parameters": { "id": 2754, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2751, "mutability": "mutable", "name": "a", "nodeType": "VariableDeclaration", "scope": 2780, "src": "573:9:19", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2750, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "573:7:19", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" }, { "constant": false, "id": 2753, "mutability": "mutable", "name": "b", "nodeType": "VariableDeclaration", "scope": 2780, "src": "584:9:19", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2752, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "584:7:19", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "572:22:19" }, "returnParameters": { "id": 2759, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2756, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "scope": 2780, "src": "618:4:19", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 2755, "name": "bool", "nodeType": "ElementaryTypeName", "src": "618:4:19", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "visibility": "internal" }, { "constant": false, "id": 2758, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "scope": 2780, "src": "624:7:19", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2757, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "624:7:19", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "617:15:19" }, "scope": 3057, "src": "557:216:19", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 2807, "nodeType": "Block", "src": "995:113:19", "statements": [ { "id": 2806, "nodeType": "UncheckedBlock", "src": "1005:97:19", "statements": [ { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2794, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2792, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2785, "src": "1033:1:19", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "id": 2793, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2783, "src": "1037:1:19", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1033:5:19", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 2799, "nodeType": "IfStatement", "src": "1029:28:19", "trueBody": { "expression": { "components": [ { "hexValue": "66616c7365", "id": 2795, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "1048:5:19", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "false" }, { "hexValue": "30", "id": 2796, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1055:1:19", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" } ], "id": 2797, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "TupleExpression", "src": "1047:10:19", "typeDescriptions": { "typeIdentifier": "t_tuple$_t_bool_$_t_rational_0_by_1_$", "typeString": "tuple(bool,int_const 0)" } }, "functionReturnParameters": 2791, "id": 2798, "nodeType": "Return", "src": "1040:17:19" } }, { "expression": { "components": [ { "hexValue": "74727565", "id": 2800, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "1079:4:19", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "true" }, { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2803, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2801, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2783, "src": "1085:1:19", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": { "id": 2802, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2785, "src": "1089:1:19", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1085:5:19", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "id": 2804, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "1078:13:19", "typeDescriptions": { "typeIdentifier": "t_tuple$_t_bool_$_t_uint256_$", "typeString": "tuple(bool,uint256)" } }, "functionReturnParameters": 2791, "id": 2805, "nodeType": "Return", "src": "1071:20:19" } ] } ] }, "documentation": { "id": 2781, "nodeType": "StructuredDocumentation", "src": "779:135:19", "text": " @dev Returns the substraction of two unsigned integers, with an overflow flag.\n _Available since v3.4._" }, "id": 2808, "implemented": true, "kind": "function", "modifiers": [], "name": "trySub", "nodeType": "FunctionDefinition", "parameters": { "id": 2786, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2783, "mutability": "mutable", "name": "a", "nodeType": "VariableDeclaration", "scope": 2808, "src": "935:9:19", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2782, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "935:7:19", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" }, { "constant": false, "id": 2785, "mutability": "mutable", "name": "b", "nodeType": "VariableDeclaration", "scope": 2808, "src": "946:9:19", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2784, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "946:7:19", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "934:22:19" }, "returnParameters": { "id": 2791, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2788, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "scope": 2808, "src": "980:4:19", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 2787, "name": "bool", "nodeType": "ElementaryTypeName", "src": "980:4:19", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "visibility": "internal" }, { "constant": false, "id": 2790, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "scope": 2808, "src": "986:7:19", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2789, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "986:7:19", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "979:15:19" }, "scope": 3057, "src": "919:189:19", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 2849, "nodeType": "Block", "src": "1332:417:19", "statements": [ { "id": 2848, "nodeType": "UncheckedBlock", "src": "1342:401:19", "statements": [ { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2822, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2820, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2811, "src": "1600:1:19", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "hexValue": "30", "id": 2821, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1605:1:19", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "1600:6:19", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 2827, "nodeType": "IfStatement", "src": "1596:28:19", "trueBody": { "expression": { "components": [ { "hexValue": "74727565", "id": 2823, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "1616:4:19", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "true" }, { "hexValue": "30", "id": 2824, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1622:1:19", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" } ], "id": 2825, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "TupleExpression", "src": "1615:9:19", "typeDescriptions": { "typeIdentifier": "t_tuple$_t_bool_$_t_rational_0_by_1_$", "typeString": "tuple(bool,int_const 0)" } }, "functionReturnParameters": 2819, "id": 2826, "nodeType": "Return", "src": "1608:16:19" } }, { "assignments": [ 2829 ], "declarations": [ { "constant": false, "id": 2829, "mutability": "mutable", "name": "c", "nodeType": "VariableDeclaration", "scope": 2848, "src": "1638:9:19", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2828, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1638:7:19", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 2833, "initialValue": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2832, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2830, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2811, "src": "1650:1:19", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "id": 2831, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2813, "src": "1654:1:19", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1650:5:19", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "1638:17:19" }, { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2838, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2836, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2834, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2829, "src": "1673:1:19", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "id": 2835, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2811, "src": "1677:1:19", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1673:5:19", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "id": 2837, "name": "b", "nodeType": "Identifier", "overloadedDeclara