UNPKG

@alpsfinance/core

Version:

This is the official Alps Finance smart contract repository.

1,018 lines 311 kB
{ "contractName": "SafeMath", "abi": [], "metadata": "{\"compiler\":{\"version\":\"0.8.11+commit.d7f03943\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"details\":\"Wrappers over Solidity's arithmetic operations. NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since 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\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/math/SafeMath.sol\":{\"keccak256\":\"0xa2f576be637946f767aa56601c26d717f48a0aff44f82e46f13807eea1009a21\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://973868f808e88e21a1a0a01d4839314515ee337ad096286c88e41b74dcc11fc2\",\"dweb:/ipfs/QmfYuZxRfx2J2xdk4EXN7jKg4bUYEMTaYk9BAw9Bqn4o2Y\"]}},\"version\":1}", "bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220fd04830778f7e44e9648e7a1e743f996041ee587daa54484479e0358db132f7064736f6c634300080b0033", "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220fd04830778f7e44e9648e7a1e743f996041ee587daa54484479e0358db132f7064736f6c634300080b0033", "immutableReferences": {}, "generatedSources": [], "deployedGeneratedSources": [], "sourceMap": "467:6301:37:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;467:6301:37;;;;;;;;;;;;;;;;;", "deployedSourceMap": "467:6301:37:-:0;;;;;;;;", "source": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)\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 generally not needed starting with Solidity 0.8, since 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": [ 7057 ] }, "id": 7058, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 6747, "literals": [ "solidity", "^", "0.8", ".0" ], "nodeType": "PragmaDirective", "src": "92:23:37" }, { "abstract": false, "baseContracts": [], "canonicalName": "SafeMath", "contractDependencies": [], "contractKind": "library", "documentation": { "id": 6748, "nodeType": "StructuredDocumentation", "src": "270:196:37", "text": " @dev Wrappers over Solidity's arithmetic operations.\n NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler\n now has built in overflow checking." }, "fullyImplemented": true, "id": 7057, "linearizedBaseContracts": [ 7057 ], "name": "SafeMath", "nameLocation": "475:8:37", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 6779, "nodeType": "Block", "src": "702:140:37", "statements": [ { "id": 6778, "nodeType": "UncheckedBlock", "src": "712:124:37", "statements": [ { "assignments": [ 6761 ], "declarations": [ { "constant": false, "id": 6761, "mutability": "mutable", "name": "c", "nameLocation": "744:1:37", "nodeType": "VariableDeclaration", "scope": 6778, "src": "736:9:37", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 6760, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "736:7:37", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 6765, "initialValue": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 6764, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 6762, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6751, "src": "748:1:37", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "id": 6763, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6753, "src": "752:1:37", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "748:5:37", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "736:17:37" }, { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 6768, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 6766, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6761, "src": "771:1:37", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "<", "rightExpression": { "id": 6767, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6751, "src": "775:1:37", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "771:5:37", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 6773, "nodeType": "IfStatement", "src": "767:28:37", "trueBody": { "expression": { "components": [ { "hexValue": "66616c7365", "id": 6769, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "786:5:37", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "false" }, { "hexValue": "30", "id": 6770, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "793:1:37", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" } ], "id": 6771, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "TupleExpression", "src": "785:10:37", "typeDescriptions": { "typeIdentifier": "t_tuple$_t_bool_$_t_rational_0_by_1_$", "typeString": "tuple(bool,int_const 0)" } }, "functionReturnParameters": 6759, "id": 6772, "nodeType": "Return", "src": "778:17:37" } }, { "expression": { "components": [ { "hexValue": "74727565", "id": 6774, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "817:4:37", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "true" }, { "id": 6775, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6761, "src": "823:1:37", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "id": 6776, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "816:9:37", "typeDescriptions": { "typeIdentifier": "t_tuple$_t_bool_$_t_uint256_$", "typeString": "tuple(bool,uint256)" } }, "functionReturnParameters": 6759, "id": 6777, "nodeType": "Return", "src": "809:16:37" } ] } ] }, "documentation": { "id": 6749, "nodeType": "StructuredDocumentation", "src": "490:131:37", "text": " @dev Returns the addition of two unsigned integers, with an overflow flag.\n _Available since v3.4._" }, "id": 6780, "implemented": true, "kind": "function", "modifiers": [], "name": "tryAdd", "nameLocation": "635:6:37", "nodeType": "FunctionDefinition", "parameters": { "id": 6754, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 6751, "mutability": "mutable", "name": "a", "nameLocation": "650:1:37", "nodeType": "VariableDeclaration", "scope": 6780, "src": "642:9:37", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 6750, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "642:7:37", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" }, { "constant": false, "id": 6753, "mutability": "mutable", "name": "b", "nameLocation": "661:1:37", "nodeType": "VariableDeclaration", "scope": 6780, "src": "653:9:37", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 6752, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "653:7:37", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "641:22:37" }, "returnParameters": { "id": 6759, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 6756, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 6780, "src": "687:4:37", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 6755, "name": "bool", "nodeType": "ElementaryTypeName", "src": "687:4:37", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "visibility": "internal" }, { "constant": false, "id": 6758, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 6780, "src": "693:7:37", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 6757, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "693:7:37", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "686:15:37" }, "scope": 7057, "src": "626:216:37", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 6807, "nodeType": "Block", "src": "1064:113:37", "statements": [ { "id": 6806, "nodeType": "UncheckedBlock", "src": "1074:97:37", "statements": [ { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 6794, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 6792, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6785, "src": "1102:1:37", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "id": 6793, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6783, "src": "1106:1:37", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1102:5:37", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 6799, "nodeType": "IfStatement", "src": "1098:28:37", "trueBody": { "expression": { "components": [ { "hexValue": "66616c7365", "id": 6795, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "1117:5:37", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "false" }, { "hexValue": "30", "id": 6796, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1124:1:37", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" } ], "id": 6797, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "TupleExpression", "src": "1116:10:37", "typeDescriptions": { "typeIdentifier": "t_tuple$_t_bool_$_t_rational_0_by_1_$", "typeString": "tuple(bool,int_const 0)" } }, "functionReturnParameters": 6791, "id": 6798, "nodeType": "Return", "src": "1109:17:37" } }, { "expression": { "components": [ { "hexValue": "74727565", "id": 6800, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "1148:4:37", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "true" }, { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 6803, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 6801, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6783, "src": "1154:1:37", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": { "id": 6802, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6785, "src": "1158:1:37", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1154:5:37", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "id": 6804, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "1147:13:37", "typeDescriptions": { "typeIdentifier": "t_tuple$_t_bool_$_t_uint256_$", "typeString": "tuple(bool,uint256)" } }, "functionReturnParameters": 6791, "id": 6805, "nodeType": "Return", "src": "1140:20:37" } ] } ] }, "documentation": { "id": 6781, "nodeType": "StructuredDocumentation", "src": "848:135:37", "text": " @dev Returns the substraction of two unsigned integers, with an overflow flag.\n _Available since v3.4._" }, "id": 6808, "implemented": true, "kind": "function", "modifiers": [], "name": "trySub", "nameLocation": "997:6:37", "nodeType": "FunctionDefinition", "parameters": { "id": 6786, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 6783, "mutability": "mutable", "name": "a", "nameLocation": "1012:1:37", "nodeType": "VariableDeclaration", "scope": 6808, "src": "1004:9:37", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 6782, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1004:7:37", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" }, { "constant": false, "id": 6785, "mutability": "mutable", "name": "b", "nameLocation": "1023:1:37", "nodeType": "VariableDeclaration", "scope": 6808, "src": "1015:9:37", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 6784, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1015:7:37", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "1003:22:37" }, "returnParameters": { "id": 6791, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 6788, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 6808, "src": "1049:4:37", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 6787, "name": "bool", "nodeType": "ElementaryTypeName", "src": "1049:4:37", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "visibility": "internal" }, { "constant": false, "id": 6790, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 6808, "src": "1055:7:37", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 6789, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1055:7:37", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "1048:15:37" }, "scope": 7057, "src": "988:189:37", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 6849, "nodeType": "Block", "src": "1401:417:37", "statements": [ { "id": 6848, "nodeType": "UncheckedBlock", "src": "1411:401:37", "statements": [ { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 6822, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 6820, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6811, "src": "1669:1:37", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "hexValue": "30", "id": 6821, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1674:1:37", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "1669:6:37", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 6827, "nodeType": "IfStatement", "src": "1665:28:37", "trueBody": { "expression": { "components": [ { "hexValue": "74727565", "id": 6823, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "1685:4:37", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "true" }, { "hexValue": "30", "id": 6824, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1691:1:37", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" } ], "id": 6825, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "TupleExpression", "src": "1684:9:37", "typeDescriptions": { "typeIdentifier": "t_tuple$_t_bool_$_t_rational_0_by_1_$", "typeString": "tuple(bool,int_const 0)" } }, "functionReturnParameters": 6819, "id": 6826, "nodeType": "Return", "src": "1677:16:37" } }, { "assignments": [ 6829 ], "declarations": [ { "constant": false, "id": 6829, "mutability": "mutable", "name": "c", "nameLocation": "1715:1:37", "nodeType": "VariableDeclaration", "scope": 6848, "src": "1707:9:37", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 6828, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1707:7:37", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 6833, "initialValue": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 6832, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 6830, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6811, "src": "1719:1:37", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "id": 6831, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6813, "src": "1723:1:37", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1719:5:37", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "1707:17:37" }, { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 6838, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 6836, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 6834, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6829, "src": "1742:1:37", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "id": 6835, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6811, "src": "1746:1:37", "typeDescriptions": { "typeIdentifier":