{ "contractName": "SafeMath", "abi": [], "metadata": "{\"compiler\":{\"version\":\"0.6.6+commit.6c089d02\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"details\":\"Wrappers over Solidity's arithmetic operations with added overflow checks. * Arithmetic operations in Solidity wrap on overflow. This can easily result in bugs, because programmers usually assume that an overflow raises an error, which is the standard behavior in high level programming languages. `SafeMath` restores this intuition by reverting the transaction when an operation overflows. * Using this library instead of the unchecked operations eliminates an entire class of bugs, so it's recommended to use it always.\",\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/math/SafeMath.sol\":\"SafeMath\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/math/SafeMath.sol\":{\"keccak256\":\"0x9a9cf02622cd7a64261b10534fc3260449da25c98c9e96d1b4ae8110a20e5806\",\"urls\":[\"bzz-raw://2df142592d1dc267d9549049ee3317fa190d2f87eaa565f86ab05ec83f7ab8f5\",\"dweb:/ipfs/QmSkJtcfWo7c42KnL5hho6GFxK6HRNV91XABx1P7xDtfLV\"]}},\"version\":1}", "bytecode": "0x60566023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122079b15707251b75ec1c45bf30c4890f19925abfa2cf311e288c4fc02982738e6864736f6c63430006060033", "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122079b15707251b75ec1c45bf30c4890f19925abfa2cf311e288c4fc02982738e6864736f6c63430006060033", "immutableReferences": {}, "sourceMap": "622:4578:11:-:0;;132:2:-1;166:7;155:9;146:7;137:37;255:7;249:14;246:1;241:23;235:4;232:33;222:2;;269:9;222:2;293:9;290:1;283:20;323:4;314:7;306:22;347:7;338;331:24", "deployedSourceMap": "622:4578:11:-:0;;;;;;12:1:-1;9;2:12", "source": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.0;\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeMath {\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 uint256 c = a + b;\n require(c >= a, \"SafeMath: addition overflow\");\n\n return c;\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 sub(a, b, \"SafeMath: subtraction overflow\");\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 * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n uint256 c = a - b;\n\n return c;\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 // 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) {\n return 0;\n }\n\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n\n return c;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers. Reverts 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(uint256 a, uint256 b) internal pure returns (uint256) {\n return div(a, b, \"SafeMath: division by zero\");\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers. Reverts 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(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n uint256 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 Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * Reverts 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 mod(a, b, \"SafeMath: modulo by zero\");\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * Reverts with custom message 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, string memory errorMessage) internal pure returns (uint256) {\n require(b != 0, errorMessage);\n return a % b;\n }\n}\n", "sourcePath": "@openzeppelin/contracts/math/SafeMath.sol", "ast": { "absolutePath": "@openzeppelin/contracts/math/SafeMath.sol", "exportedSymbols": { "SafeMath": [ 1282 ] }, "id": 1283, "nodeType": "SourceUnit", "nodes": [ { "id": 1088, "literals": [ "solidity", "^", "0.6", ".0" ], "nodeType": "PragmaDirective", "src": "33:23:11" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "library", "documentation": { "id": 1089, "nodeType": "StructuredDocumentation", "src": "58:563:11", "text": "@dev Wrappers over Solidity's arithmetic operations with added overflow\nchecks.\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\nin bugs, because programmers usually assume that an overflow raises an\nerror, which is the standard behavior in high level programming languages.\n`SafeMath` restores this intuition by reverting the transaction when an\noperation overflows.\n * Using this library instead of the unchecked operations eliminates an entire\nclass of bugs, so it's recommended to use it always." }, "fullyImplemented": true, "id": 1282, "linearizedBaseContracts": [ 1282 ], "name": "SafeMath", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 1114, "nodeType": "Block", "src": "941:109:11", "statements": [ { "assignments": [ 1100 ], "declarations": [ { "constant": false, "id": 1100, "mutability": "mutable", "name": "c", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1114, "src": "951:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1099, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "951:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 1104, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1103, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 1101, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1092, "src": "963:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "argumentTypes": null, "id": 1102, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1094, "src": "967:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "963:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "951:17:11" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1108, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 1106, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1100, "src": "986:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "argumentTypes": null, "id": 1107, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1092, "src": "991:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "986:6:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "536166654d6174683a206164646974696f6e206f766572666c6f77", "id": 1109, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "994:29:11", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_30cc447bcc13b3e22b45cef0dd9b0b514842d836dd9b6eb384e20dedfb47723a", "typeString": "literal_string \"SafeMath: addition overflow\"" }, "value": "SafeMath: addition overflow" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_30cc447bcc13b3e22b45cef0dd9b0b514842d836dd9b6eb384e20dedfb47723a", "typeString": "literal_string \"SafeMath: addition overflow\"" } ], "id": 1105, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ -18, -18 ], "referencedDeclaration": -18, "src": "978:7:11", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 1110, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "978:46:11", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1111, "nodeType": "ExpressionStatement", "src": "978:46:11" }, { "expression": { "argumentTypes": null, "id": 1112, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1100, "src": "1042:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 1098, "id": 1113, "nodeType": "Return", "src": "1035:8:11" } ] }, "documentation": { "id": 1090, "nodeType": "StructuredDocumentation", "src": "645:224:11", "text": "@dev Returns the addition of two unsigned integers, reverting on\noverflow.\n * Counterpart to Solidity's `+` operator.\n * Requirements:\n * - Addition cannot overflow." }, "id": 1115, "implemented": true, "kind": "function", "modifiers": [], "name": "add", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 1095, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1092, "mutability": "mutable", "name": "a", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1115, "src": "887:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1091, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "887:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1094, "mutability": "mutable", "name": "b", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1115, "src": "898:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1093, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "898:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "886:22:11" }, "returnParameters": { "id": 1098, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1097, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1115, "src": "932:7:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1096, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "932:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "931:9:11" }, "scope": 1282, "src": "874:176:11", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 1131, "nodeType": "Block", "src": "1388:67:11", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1126, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1118, "src": "1409:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "id": 1127, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1120, "src": "1412:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "hexValue": "536166654d6174683a207375627472616374696f6e206f766572666c6f77", "id": 1128, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1415:32:11", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_50b058e9b5320e58880d88223c9801cd9eecdcf90323d5c2318bc1b6b916e862", "typeString": "literal_string \"SafeMath: subtraction overflow\"" }, "value": "SafeMath: subtraction overflow" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_stringliteral_50b058e9b5320e58880d88223c9801cd9eecdcf90323d5c2318bc1b6b916e862", "typeString": "literal_string \"SafeMath: subtraction overflow\"" } ], "id": 1125, "name": "sub", "nodeType": "Identifier", "overloadedDeclarations": [ 1132, 1160 ], "referencedDeclaration": 1160, "src": "1405:3:11", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_string_memory_ptr_$returns$_t_uint256_$", "typeString": "function (uint256,uint256,string memory) pure returns (uint256)" } }, "id": 1129, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1405:43:11", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 1124, "id": 1130, "nodeType": "Return", "src": "1398:50:11" } ] }, "documentation": { "id": 1116, "nodeType": "StructuredDocumentation", "src": "1056:260:11", "text": "@dev Returns the subtraction of two unsigned integers, reverting on\noverflow (when the result is negative).\n * Counterpart to Solidity's `-` operator.\n * Requirements:\n * - Subtraction cannot overflow." }, "id": 1132, "implemented": true, "kind": "function", "modifiers": [], "name": "sub", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 1121, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1118, "mutability": "mutable", "name": "a", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1132, "src": "1334:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1117, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1334:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1120, "mutability": "mutable", "name": "b", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1132, "src": "1345:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1119, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1345:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1333:22:11" }, "returnParameters": { "id": 1124, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1123, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1132, "src": "1379:7:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1122, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1379:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1378:9:11" }, "scope": 1282, "src": "1321:134:11", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 1159, "nodeType": "Block", "src": "1841:92:11", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1147, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 1145, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1137, "src": "1859:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "<=", "rightExpression": { "argumentTypes": null, "id": 1146, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1135, "src": "1864:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1859:6:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "id": 1148, "name": "errorMessage", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1139, "src": "1867:12:11", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } ], "id": 1144, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ -18, -18 ], "referencedDeclaration": -18, "src": "1851:7:11", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 1149, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1851:29:11", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1150, "nodeType": "ExpressionStatement", "src": "1851:29:11" }, { "assignments": [ 1152 ], "declarations": [ { "constant": false, "id": 1152, "mutability": "mutable", "name": "c", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1159, "src": "1890:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1151, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1890:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 1156, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1155, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 1153, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1135, "src": "1902:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": { "argumentTypes": null, "id": 1154, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1137, "src": "1906:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1902:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "1890:17:11" }, { "expression": { "argumentTypes": null, "id": 1157, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1152, "src": "1925:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 1143, "id": 1158, "nodeType": "Return", "src": "1918:8:11" } ] }, "documentation": { "id": 1133, "nodeType": "StructuredDocumentation", "src": "1461:280:11", "text": "@dev Returns the subtraction of two unsigned integers, reverting with custom message on\noverflow (when the result is negative).\n * Counterpart to Solidity's `-` operator.\n * Requirements:\n * - Subtraction cannot overflow." }, "id": 1160, "implemented": true, "kind": "function", "modifiers": [], "name": "sub", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 1140, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1135, "mutability": "mutable", "name": "a", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1160, "src": "1759:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1134, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1759:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1137, "mutability": "mutable", "name": "b", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1160, "src": "1770:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1136, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1770:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1139, "mutability": "mutable", "name": "errorMessage", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1160, "src": "1781:26:11", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 1138, "name": "string", "nodeType": "ElementaryTypeName", "src": "1781:6:11", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "internal" } ], "src": "1758:50:11" }, "returnParameters": { "id": 1143, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1142, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1160, "src": "1832:7:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1141, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1832:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1831:9:11" }, "scope": 1282, "src": "1746:187:11", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 1194, "nodeType": "Block", "src": "2247:392:11", "statements": [ { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1172, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 1170, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1163, "src": "2479:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 1171, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2484:1:11", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "2479:6:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 1176, "nodeType": "IfStatement", "src": "2475:45:11", "trueBody": { "id": 1175, "nodeType": "Block", "src": "2487:33:11", "statements": [ { "expression": { "argumentTypes": null, "hexValue": "30", "id": 1173, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2508:1:11", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "functionReturnParameters": 1169, "id": 1174, "nodeType": "Return", "src": "2501:8:11" } ] } }, { "assignments": [ 1178 ], "declarations": [ { "constant": false, "id": 1178, "mutability": "mutable", "name": "c", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1194, "src": "2530:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1177, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2530:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 1182, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1181, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 1179, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1163, "src": "2542:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "argumentTypes": null, "id": 1180, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1165, "src": "2546:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "2542:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "2530:17:11" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1188, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1186, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 1184, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1178, "src": "2565:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "argumentTypes": null, "id": 1185, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1163, "src": "2569:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "2565:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "id": 1187, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1165, "src": "2574:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "2565:10:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77", "id": 1189, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "2577:35:11", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_9113bb53c2876a3805b2c9242029423fc540a728243ce887ab24c82cf119fba3", "typeString": "literal_string \"SafeMath: multiplication overflow\"" }, "value": "SafeMath: multiplication overflow" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_9113bb53c2876a3805b2c9242029423fc540a728243ce887ab24c82cf119fba3", "typeString": "literal_string \"SafeMath: multiplication overflow\"" } ], "id": 1183, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ -18, -18 ], "referencedDeclaration": -18, "src": "2557:7:11", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 1190, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2557:56:11", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1191, "nodeType": "ExpressionStatement", "src": "2557:56:11" }, { "expression": { "argumentTypes": null, "id": 1192, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1178, "src": "2631:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 1169, "id": 1193, "nodeType": "Return", "src": "2624:8:11" } ] }, "documentation": { "id": 1161, "nodeType": "StructuredDocumentation", "src": "1939:236:11", "text": "@dev Returns the multiplication of two unsigned integers, reverting on\noverflow.\n * Counterpart to Solidity's `*` operator.\n * Requirements:\n * - Multiplication cannot overflow." }, "id": 1195, "implemented": true, "kind": "function", "modifiers": [], "name": "mul", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 1166, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1163, "mutability": "mutable", "name": "a", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1195, "src": "2193:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1162, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2193:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1165, "mutability": "mutable", "name": "b", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1195, "src": "2204:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1164, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2204:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "2192:22:11" }, "returnParameters": { "id": 1169, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1168, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1195, "src": "2238:7:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1167, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2238:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "2237:9:11" }, "scope": 1282, "src": "2180:459:11", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 1211, "nodeType": "Block", "src": "3168:63:11", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1206, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1198, "src": "3189:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "id": 1207, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1200, "src": "3192:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "hexValue": "536166654d6174683a206469766973696f6e206279207a65726f", "id": 1208, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "3195:28:11", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_5b7cc70dda4dc2143e5adb63bd5d1f349504f461dbdfd9bc76fac1f8ca6d019f", "typeString": "literal_string \"SafeMath: division by zero\"" }, "value": "SafeMath: division by zero" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_stringliteral_5b7cc70dda4dc2143e5adb63bd5d1f349504f461dbdfd9bc76fac1f8ca6d019f", "typeString": "literal_string \"SafeMath: division by zero\"" } ], "id": 1205, "name": "div", "nodeType": "Identifier", "overloadedDeclarations": [ 1212, 1240 ], "referencedDeclaration": 1240, "src": "3185:3:11", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_string_memory_ptr_$returns$_t_uint256_$", "typeString": "function (uint256,uint256,string memory) pure returns (uint256)" } }, "id": 1209, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "3185:39:11", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 1204, "id": 1210, "nodeType": "Return", "src": "3178:46:11" } ] }, "documentation": { "id": 1196, "nodeType": "StructuredDocumentation", "src": "2645:451:11", "text": "@dev Returns the integer division of two unsigned integers. Reverts on\ndivision by zero. The result is rounded towards zero.\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n`revert` opcode (which leaves remaining gas untouched) while Solidity\nuses an invalid opcode to revert (consuming all remaining gas).\n * Requirements:\n * - The divisor cannot be zero." }, "id": 1212, "implemented": true, "kind": "function", "modifiers": [], "name": "div", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 1201, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1198, "mutability": "mutable", "name": "a", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1212, "src": "3114:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1197, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3114:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1200, "mutability": "mutable", "name": "b", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1212, "src": "3125:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1199, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3125:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "3113:22:11" }, "returnParameters": { "id": 1204, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1203, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1212, "src": "3159:7:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1202, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3159:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "3158:9:11" }, "scope": 1282, "src": "3101:130:11", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 1239, "nodeType": "Block", "src": "3808:177:11", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1227, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 1225, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1217, "src": "3826:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 1226, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "3830:1:11", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "3826:5:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "id": 1228, "name": "errorMessage", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1219, "src": "3833:12:11", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } ], "id": 1224, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ -18, -18 ], "referencedDeclaration": -18, "src": "3818:7:11", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 1229, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "3818:28:11", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1230, "nodeType": "ExpressionStatement", "src": "3818:28:11" }, { "assignments": [ 1232 ], "declarations": [ { "constant": false, "id": 1232, "mutability": "mutable", "name": "c", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1239, "src": "3856:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1231, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3856:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 1236, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1235, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 1233, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1215, "src": "3868:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "argumentTypes": null, "id": 1234, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1217, "src": "3872:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "3868:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "3856:17:11" }, { "expression": { "argumentTypes": null, "id": 1237, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1232, "src": "3977:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 1223, "id": 1238, "nodeType": "Return", "src": "3970:8:11" } ] }, "documentation": { "id": 1213, "nodeType": "StructuredDocumentation", "src": "3237:471:11", "text": "@dev Returns the integer division of two unsigned integers. Reverts with custom message on\ndivision by zero. The result is rounded towards zero.\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n`revert` opcode (which leaves remaining gas untouched) while Solidity\nuses an invalid opcode to revert (consuming all remaining gas).\n * Requirements:\n * - The divisor cannot be zero." }, "id": 1240, "implemented": true, "kind": "function", "modifiers": [], "name": "div", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 1220, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1215, "mutability": "mutable", "name": "a", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1240, "src": "3726:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1214, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3726:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1217, "mutability": "mutable", "name": "b", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1240, "src": "3737:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1216, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3737:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1219, "mutability": "mutable", "name": "errorMessage", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1240, "src": "3748:26:11", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 1218, "name": "string", "nodeType": "ElementaryTypeName", "src": "3748:6:11", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "internal" } ], "src": "3725:50:11" }, "returnParameters": { "id": 1223, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1222, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1240, "src": "3799:7:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1221, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3799:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "3798:9:11" }, "scope": 1282, "src": "3713:272:11", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 1256, "nodeType": "Block", "src": "4503:61:11", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1251, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1243, "src": "4524:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "id": 1252, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1245, "src": "4527:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "hexValue": "536166654d6174683a206d6f64756c6f206279207a65726f", "id": 1253, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "4530:26:11", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_726e51f7b81fce0a68f5f214f445e275313b20b1633f08ce954ee39abf8d7832", "typeString": "literal_string \"SafeMath: modulo by zero\"" }, "value": "SafeMath: modulo by zero" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_stringliteral_726e51f7b81fce0a68f5f214f445e275313b20b1633f08ce954ee39abf8d7832", "typeString": "literal_string \"SafeMath: modulo by zero\"" } ], "id": 1250, "name": "mod", "nodeType": "Identifier", "overloadedDeclarations": [ 1257, 1281 ], "referencedDeclaration": 1281, "src": "4520:3:11", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_string_memory_ptr_$returns$_t_uint256_$", "typeString": "function (uint256,uint256,string memory) pure returns (uint256)" } }, "id": 1254, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "4520:37:11", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 1249, "id": 1255, "nodeType": "Return", "src": "4513:44:11" } ] }, "documentation": { "id": 1241, "nodeType": "StructuredDocumentation", "src": "3991:440:11", "text": "@dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\nReverts when dividing by zero.\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\nopcode (which leaves remaining gas untouched) while Solidity uses an\ninvalid opcode to revert (consuming all remaining gas).\n * Requirements:\n * - The divisor cannot be zero." }, "id": 1257, "implemented": true, "kind": "function", "modifiers": [], "name": "mod", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 1246, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1243, "mutability": "mutable", "name": "a", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1257, "src": "4449:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1242, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "4449:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1245, "mutability": "mutable", "name": "b", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1257, "src": "4460:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1244, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "4460:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "4448:22:11" }, "returnParameters": { "id": 1249, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1248, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1257, "src": "4494:7:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1247, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "4494:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "4493:9:11" }, "scope": 1282, "src": "4436:128:11", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 1280, "nodeType": "Block", "src": "5130:68:11", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1272, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 1270, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1262, "src": "5148:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 1271, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "5153:1:11", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "5148:6:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "id": 1273, "name": "errorMessage", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1264, "src": "5156:12:11", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } ], "id": 1269, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ -18, -18 ], "referencedDeclaration": -18, "src": "5140:7:11", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 1274, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "5140:29:11", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1275, "nodeType": "ExpressionStatement", "src": "5140:29:11" }, { "expression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1278, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 1276, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1260, "src": "5186:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "%", "rightExpression": { "argumentTypes": null, "id": 1277, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1262, "src": "5190:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "5186:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 1268, "id": 1279, "nodeType": "Return", "src": "5179:12:11" } ] }, "documentation": { "id": 1258, "nodeType": "StructuredDocumentation", "src": "4570:460:11", "text": "@dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\nReverts with custom message when dividing by zero.\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\nopcode (which leaves remaining gas untouched) while Solidity uses an\ninvalid opcode to revert (consuming all remaining gas).\n * Requirements:\n * - The divisor cannot be zero." }, "id": 1281, "implemented": true, "kind": "function", "modifiers": [], "name": "mod", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 1265, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1260, "mutability": "mutable", "name": "a", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1281, "src": "5048:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1259, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "5048:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1262, "mutability": "mutable", "name": "b", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1281, "src": "5059:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1261, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "5059:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1264, "mutability": "mutable", "name": "errorMessage", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1281, "src": "5070:26:11", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 1263, "name": "string", "nodeType": "ElementaryTypeName", "src": "5070:6:11", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "internal" } ], "src": "5047:50:11" }, "returnParameters": { "id": 1268, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1267, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1281, "src": "5121:7:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1266, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "5121:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "5120:9:11" }, "scope": 1282, "src": "5035:163:11", "stateMutability": "pure", "virtual": false, "visibility": "internal" } ], "scope": 1283, "src": "622:4578:11" } ], "src": "33:5168:11" }, "legacyAST": { "absolutePath": "@openzeppelin/contracts/math/SafeMath.sol", "exportedSymbols": { "SafeMath": [ 1282 ] }, "id": 1283, "nodeType": "SourceUnit", "nodes": [ { "id": 1088, "literals": [ "solidity", "^", "0.6", ".0" ], "nodeType": "PragmaDirective", "src": "33:23:11" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "library", "documentation": { "id": 1089, "nodeType": "StructuredDocumentation", "src": "58:563:11", "text": "@dev Wrappers over Solidity's arithmetic operations with added overflow\nchecks.\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\nin bugs, because programmers usually assume that an overflow raises an\nerror, which is the standard behavior in high level programming languages.\n`SafeMath` restores this intuition by reverting the transaction when an\noperation overflows.\n * Using this library instead of the unchecked operations eliminates an entire\nclass of bugs, so it's recommended to use it always." }, "fullyImplemented": true, "id": 1282, "linearizedBaseContracts": [ 1282 ], "name": "SafeMath", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 1114, "nodeType": "Block", "src": "941:109:11", "statements": [ { "assignments": [ 1100 ], "declarations": [ { "constant": false, "id": 1100, "mutability": "mutable", "name": "c", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1114, "src": "951:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1099, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "951:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 1104, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1103, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 1101, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1092, "src": "963:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "argumentTypes": null, "id": 1102, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1094, "src": "967:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "963:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "951:17:11" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1108, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 1106, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1100, "src": "986:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "argumentTypes": null, "id": 1107, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1092, "src": "991:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "986:6:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "536166654d6174683a206164646974696f6e206f766572666c6f77", "id": 1109, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "994:29:11", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_30cc447bcc13b3e22b45cef0dd9b0b514842d836dd9b6eb384e20dedfb47723a", "typeString": "literal_string \"SafeMath: addition overflow\"" }, "value": "SafeMath: addition overflow" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_30cc447bcc13b3e22b45cef0dd9b0b514842d836dd9b6eb384e20dedfb47723a", "typeString": "literal_string \"SafeMath: addition overflow\"" } ], "id": 1105, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ -18, -18 ], "referencedDeclaration": -18, "src": "978:7:11", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 1110, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "978:46:11", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1111, "nodeType": "ExpressionStatement", "src": "978:46:11" }, { "expression": { "argumentTypes": null, "id": 1112, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1100, "src": "1042:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 1098, "id": 1113, "nodeType": "Return", "src": "1035:8:11" } ] }, "documentation": { "id": 1090, "nodeType": "StructuredDocumentation", "src": "645:224:11", "text": "@dev Returns the addition of two unsigned integers, reverting on\noverflow.\n * Counterpart to Solidity's `+` operator.\n * Requirements:\n * - Addition cannot overflow." }, "id": 1115, "implemented": true, "kind": "function", "modifiers": [], "name": "add", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 1095, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1092, "mutability": "mutable", "name": "a", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1115, "src": "887:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1091, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "887:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1094, "mutability": "mutable", "name": "b", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1115, "src": "898:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1093, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "898:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "886:22:11" }, "returnParameters": { "id": 1098, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1097, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1115, "src": "932:7:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1096, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "932:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "931:9:11" }, "scope": 1282, "src": "874:176:11", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 1131, "nodeType": "Block", "src": "1388:67:11", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1126, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1118, "src": "1409:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "id": 1127, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1120, "src": "1412:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "hexValue": "536166654d6174683a207375627472616374696f6e206f766572666c6f77", "id": 1128, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1415:32:11", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_50b058e9b5320e58880d88223c9801cd9eecdcf90323d5c2318bc1b6b916e862", "typeString": "literal_string \"SafeMath: subtraction overflow\"" }, "value": "SafeMath: subtraction overflow" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_stringliteral_50b058e9b5320e58880d88223c9801cd9eecdcf90323d5c2318bc1b6b916e862", "typeString": "literal_string \"SafeMath: subtraction overflow\"" } ], "id": 1125, "name": "sub", "nodeType": "Identifier", "overloadedDeclarations": [ 1132, 1160 ], "referencedDeclaration": 1160, "src": "1405:3:11", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_string_memory_ptr_$returns$_t_uint256_$", "typeString": "function (uint256,uint256,string memory) pure returns (uint256)" } }, "id": 1129, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1405:43:11", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 1124, "id": 1130, "nodeType": "Return", "src": "1398:50:11" } ] }, "documentation": { "id": 1116, "nodeType": "StructuredDocumentation", "src": "1056:260:11", "text": "@dev Returns the subtraction of two unsigned integers, reverting on\noverflow (when the result is negative).\n * Counterpart to Solidity's `-` operator.\n * Requirements:\n * - Subtraction cannot overflow." }, "id": 1132, "implemented": true, "kind": "function", "modifiers": [], "name": "sub", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 1121, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1118, "mutability": "mutable", "name": "a", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1132, "src": "1334:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1117, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1334:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1120, "mutability": "mutable", "name": "b", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1132, "src": "1345:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1119, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1345:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1333:22:11" }, "returnParameters": { "id": 1124, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1123, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1132, "src": "1379:7:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1122, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1379:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1378:9:11" }, "scope": 1282, "src": "1321:134:11", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 1159, "nodeType": "Block", "src": "1841:92:11", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1147, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 1145, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1137, "src": "1859:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "<=", "rightExpression": { "argumentTypes": null, "id": 1146, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1135, "src": "1864:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1859:6:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "id": 1148, "name": "errorMessage", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1139, "src": "1867:12:11", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } ], "id": 1144, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ -18, -18 ], "referencedDeclaration": -18, "src": "1851:7:11", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 1149, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1851:29:11", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1150, "nodeType": "ExpressionStatement", "src": "1851:29:11" }, { "assignments": [ 1152 ], "declarations": [ { "constant": false, "id": 1152, "mutability": "mutable", "name": "c", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1159, "src": "1890:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1151, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1890:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 1156, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1155, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 1153, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1135, "src": "1902:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": { "argumentTypes": null, "id": 1154, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1137, "src": "1906:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1902:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "1890:17:11" }, { "expression": { "argumentTypes": null, "id": 1157, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1152, "src": "1925:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 1143, "id": 1158, "nodeType": "Return", "src": "1918:8:11" } ] }, "documentation": { "id": 1133, "nodeType": "StructuredDocumentation", "src": "1461:280:11", "text": "@dev Returns the subtraction of two unsigned integers, reverting with custom message on\noverflow (when the result is negative).\n * Counterpart to Solidity's `-` operator.\n * Requirements:\n * - Subtraction cannot overflow." }, "id": 1160, "implemented": true, "kind": "function", "modifiers": [], "name": "sub", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 1140, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1135, "mutability": "mutable", "name": "a", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1160, "src": "1759:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1134, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1759:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1137, "mutability": "mutable", "name": "b", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1160, "src": "1770:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1136, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1770:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1139, "mutability": "mutable", "name": "errorMessage", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1160, "src": "1781:26:11", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 1138, "name": "string", "nodeType": "ElementaryTypeName", "src": "1781:6:11", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "internal" } ], "src": "1758:50:11" }, "returnParameters": { "id": 1143, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1142, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1160, "src": "1832:7:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1141, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1832:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1831:9:11" }, "scope": 1282, "src": "1746:187:11", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 1194, "nodeType": "Block", "src": "2247:392:11", "statements": [ { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1172, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 1170, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1163, "src": "2479:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 1171, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2484:1:11", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "2479:6:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 1176, "nodeType": "IfStatement", "src": "2475:45:11", "trueBody": { "id": 1175, "nodeType": "Block", "src": "2487:33:11", "statements": [ { "expression": { "argumentTypes": null, "hexValue": "30", "id": 1173, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2508:1:11", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "functionReturnParameters": 1169, "id": 1174, "nodeType": "Return", "src": "2501:8:11" } ] } }, { "assignments": [ 1178 ], "declarations": [ { "constant": false, "id": 1178, "mutability": "mutable", "name": "c", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1194, "src": "2530:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1177, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2530:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 1182, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1181, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 1179, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1163, "src": "2542:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "argumentTypes": null, "id": 1180, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1165, "src": "2546:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "2542:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "2530:17:11" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1188, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1186, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 1184, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1178, "src": "2565:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "argumentTypes": null, "id": 1185, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1163, "src": "2569:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "2565:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "id": 1187, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1165, "src": "2574:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "2565:10:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77", "id": 1189, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "2577:35:11", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_9113bb53c2876a3805b2c9242029423fc540a728243ce887ab24c82cf119fba3", "typeString": "literal_string \"SafeMath: multiplication overflow\"" }, "value": "SafeMath: multiplication overflow" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_9113bb53c2876a3805b2c9242029423fc540a728243ce887ab24c82cf119fba3", "typeString": "literal_string \"SafeMath: multiplication overflow\"" } ], "id": 1183, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ -18, -18 ], "referencedDeclaration": -18, "src": "2557:7:11", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 1190, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2557:56:11", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1191, "nodeType": "ExpressionStatement", "src": "2557:56:11" }, { "expression": { "argumentTypes": null, "id": 1192, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1178, "src": "2631:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 1169, "id": 1193, "nodeType": "Return", "src": "2624:8:11" } ] }, "documentation": { "id": 1161, "nodeType": "StructuredDocumentation", "src": "1939:236:11", "text": "@dev Returns the multiplication of two unsigned integers, reverting on\noverflow.\n * Counterpart to Solidity's `*` operator.\n * Requirements:\n * - Multiplication cannot overflow." }, "id": 1195, "implemented": true, "kind": "function", "modifiers": [], "name": "mul", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 1166, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1163, "mutability": "mutable", "name": "a", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1195, "src": "2193:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1162, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2193:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1165, "mutability": "mutable", "name": "b", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1195, "src": "2204:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1164, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2204:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "2192:22:11" }, "returnParameters": { "id": 1169, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1168, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1195, "src": "2238:7:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1167, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2238:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "2237:9:11" }, "scope": 1282, "src": "2180:459:11", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 1211, "nodeType": "Block", "src": "3168:63:11", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1206, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1198, "src": "3189:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "id": 1207, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1200, "src": "3192:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "hexValue": "536166654d6174683a206469766973696f6e206279207a65726f", "id": 1208, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "3195:28:11", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_5b7cc70dda4dc2143e5adb63bd5d1f349504f461dbdfd9bc76fac1f8ca6d019f", "typeString": "literal_string \"SafeMath: division by zero\"" }, "value": "SafeMath: division by zero" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_stringliteral_5b7cc70dda4dc2143e5adb63bd5d1f349504f461dbdfd9bc76fac1f8ca6d019f", "typeString": "literal_string \"SafeMath: division by zero\"" } ], "id": 1205, "name": "div", "nodeType": "Identifier", "overloadedDeclarations": [ 1212, 1240 ], "referencedDeclaration": 1240, "src": "3185:3:11", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_string_memory_ptr_$returns$_t_uint256_$", "typeString": "function (uint256,uint256,string memory) pure returns (uint256)" } }, "id": 1209, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "3185:39:11", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 1204, "id": 1210, "nodeType": "Return", "src": "3178:46:11" } ] }, "documentation": { "id": 1196, "nodeType": "StructuredDocumentation", "src": "2645:451:11", "text": "@dev Returns the integer division of two unsigned integers. Reverts on\ndivision by zero. The result is rounded towards zero.\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n`revert` opcode (which leaves remaining gas untouched) while Solidity\nuses an invalid opcode to revert (consuming all remaining gas).\n * Requirements:\n * - The divisor cannot be zero." }, "id": 1212, "implemented": true, "kind": "function", "modifiers": [], "name": "div", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 1201, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1198, "mutability": "mutable", "name": "a", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1212, "src": "3114:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1197, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3114:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1200, "mutability": "mutable", "name": "b", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1212, "src": "3125:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1199, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3125:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "3113:22:11" }, "returnParameters": { "id": 1204, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1203, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1212, "src": "3159:7:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1202, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3159:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "3158:9:11" }, "scope": 1282, "src": "3101:130:11", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 1239, "nodeType": "Block", "src": "3808:177:11", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1227, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 1225, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1217, "src": "3826:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 1226, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "3830:1:11", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "3826:5:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "id": 1228, "name": "errorMessage", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1219, "src": "3833:12:11", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } ], "id": 1224, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ -18, -18 ], "referencedDeclaration": -18, "src": "3818:7:11", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 1229, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "3818:28:11", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1230, "nodeType": "ExpressionStatement", "src": "3818:28:11" }, { "assignments": [ 1232 ], "declarations": [ { "constant": false, "id": 1232, "mutability": "mutable", "name": "c", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1239, "src": "3856:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1231, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3856:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 1236, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1235, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 1233, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1215, "src": "3868:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "argumentTypes": null, "id": 1234, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1217, "src": "3872:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "3868:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "3856:17:11" }, { "expression": { "argumentTypes": null, "id": 1237, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1232, "src": "3977:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 1223, "id": 1238, "nodeType": "Return", "src": "3970:8:11" } ] }, "documentation": { "id": 1213, "nodeType": "StructuredDocumentation", "src": "3237:471:11", "text": "@dev Returns the integer division of two unsigned integers. Reverts with custom message on\ndivision by zero. The result is rounded towards zero.\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n`revert` opcode (which leaves remaining gas untouched) while Solidity\nuses an invalid opcode to revert (consuming all remaining gas).\n * Requirements:\n * - The divisor cannot be zero." }, "id": 1240, "implemented": true, "kind": "function", "modifiers": [], "name": "div", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 1220, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1215, "mutability": "mutable", "name": "a", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1240, "src": "3726:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1214, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3726:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1217, "mutability": "mutable", "name": "b", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1240, "src": "3737:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1216, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3737:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1219, "mutability": "mutable", "name": "errorMessage", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1240, "src": "3748:26:11", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 1218, "name": "string", "nodeType": "ElementaryTypeName", "src": "3748:6:11", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "internal" } ], "src": "3725:50:11" }, "returnParameters": { "id": 1223, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1222, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1240, "src": "3799:7:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1221, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3799:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "3798:9:11" }, "scope": 1282, "src": "3713:272:11", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 1256, "nodeType": "Block", "src": "4503:61:11", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1251, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1243, "src": "4524:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "id": 1252, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1245, "src": "4527:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "hexValue": "536166654d6174683a206d6f64756c6f206279207a65726f", "id": 1253, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "4530:26:11", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_726e51f7b81fce0a68f5f214f445e275313b20b1633f08ce954ee39abf8d7832", "typeString": "literal_string \"SafeMath: modulo by zero\"" }, "value": "SafeMath: modulo by zero" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_stringliteral_726e51f7b81fce0a68f5f214f445e275313b20b1633f08ce954ee39abf8d7832", "typeString": "literal_string \"SafeMath: modulo by zero\"" } ], "id": 1250, "name": "mod", "nodeType": "Identifier", "overloadedDeclarations": [ 1257, 1281 ], "referencedDeclaration": 1281, "src": "4520:3:11", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_string_memory_ptr_$returns$_t_uint256_$", "typeString": "function (uint256,uint256,string memory) pure returns (uint256)" } }, "id": 1254, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "4520:37:11", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 1249, "id": 1255, "nodeType": "Return", "src": "4513:44:11" } ] }, "documentation": { "id": 1241, "nodeType": "StructuredDocumentation", "src": "3991:440:11", "text": "@dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\nReverts when dividing by zero.\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\nopcode (which leaves remaining gas untouched) while Solidity uses an\ninvalid opcode to revert (consuming all remaining gas).\n * Requirements:\n * - The divisor cannot be zero." }, "id": 1257, "implemented": true, "kind": "function", "modifiers": [], "name": "mod", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 1246, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1243, "mutability": "mutable", "name": "a", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1257, "src": "4449:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1242, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "4449:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1245, "mutability": "mutable", "name": "b", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1257, "src": "4460:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1244, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "4460:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "4448:22:11" }, "returnParameters": { "id": 1249, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1248, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1257, "src": "4494:7:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1247, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "4494:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "4493:9:11" }, "scope": 1282, "src": "4436:128:11", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 1280, "nodeType": "Block", "src": "5130:68:11", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1272, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 1270, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1262, "src": "5148:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 1271, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "5153:1:11", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "5148:6:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "id": 1273, "name": "errorMessage", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1264, "src": "5156:12:11", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } ], "id": 1269, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ -18, -18 ], "referencedDeclaration": -18, "src": "5140:7:11", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 1274, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "5140:29:11", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1275, "nodeType": "ExpressionStatement", "src": "5140:29:11" }, { "expression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1278, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 1276, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1260, "src": "5186:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "%", "rightExpression": { "argumentTypes": null, "id": 1277, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1262, "src": "5190:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "5186:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 1268, "id": 1279, "nodeType": "Return", "src": "5179:12:11" } ] }, "documentation": { "id": 1258, "nodeType": "StructuredDocumentation", "src": "4570:460:11", "text": "@dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\nReverts with custom message when dividing by zero.\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\nopcode (which leaves remaining gas untouched) while Solidity uses an\ninvalid opcode to revert (consuming all remaining gas).\n * Requirements:\n * - The divisor cannot be zero." }, "id": 1281, "implemented": true, "kind": "function", "modifiers": [], "name": "mod", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 1265, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1260, "mutability": "mutable", "name": "a", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1281, "src": "5048:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1259, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "5048:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1262, "mutability": "mutable", "name": "b", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1281, "src": "5059:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1261, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "5059:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1264, "mutability": "mutable", "name": "errorMessage", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1281, "src": "5070:26:11", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 1263, "name": "string", "nodeType": "ElementaryTypeName", "src": "5070:6:11", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "internal" } ], "src": "5047:50:11" }, "returnParameters": { "id": 1268, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1267, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1281, "src": "5121:7:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1266, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "5121:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "5120:9:11" }, "scope": 1282, "src": "5035:163:11", "stateMutability": "pure", "virtual": false, "visibility": "internal" } ], "scope": 1283, "src": "622:4578:11" } ], "src": "33:5168:11" }, "compiler": { "name": "solc", "version": "0.6.6+commit.6c089d02.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.2.5", "updatedAt": "2020-10-28T15:56:43.358Z", "devdoc": { "details": "Wrappers over Solidity's arithmetic operations with added overflow checks. * Arithmetic operations in Solidity wrap on overflow. This can easily result in bugs, because programmers usually assume that an overflow raises an error, which is the standard behavior in high level programming languages. `SafeMath` restores this intuition by reverting the transaction when an operation overflows. * Using this library instead of the unchecked operations eliminates an entire class of bugs, so it's recommended to use it always.", "methods": {} }, "userdoc": { "methods": {} } }