{ "contractName": "SafeMath", "abi": [], "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"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-solidity/contracts/math/SafeMath.sol\":\"SafeMath\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"openzeppelin-solidity/contracts/math/SafeMath.sol\":{\"keccak256\":\"0x640b6dee7a4b830bdfd52b5031a07fc2b12209f5b2e29e5d364a7d37f69d8076\",\"urls\":[\"bzz-raw://31113152e1ddb78fe7a4197f247591ca894e93f916867beb708d8e747b6cc74f\",\"dweb:/ipfs/QmbZaJyXdpsYGykVhHH9qpVGQg9DGCxE2QufbCUy3daTgq\"]}},\"version\":1}", "bytecode": "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820265971a60ce65d3ed0e9eb81da3a1cddecc06d15f7346d777d423511ccf1981464736f6c63430005100032", "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820265971a60ce65d3ed0e9eb81da3a1cddecc06d15f7346d777d423511ccf1981464736f6c63430005100032", "sourceMap": "589:4708:13:-;;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": "589:4708:13:-;;;;;;;;", "source": "pragma solidity ^0.5.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 * - 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 * - 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 * - Subtraction cannot overflow.\n *\n * _Available since v2.4.0._\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 * - 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 * - 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 * - The divisor cannot be zero.\n *\n * _Available since v2.4.0._\n */\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n // Solidity only automatically asserts when dividing by 0\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 * - 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 * - The divisor cannot be zero.\n *\n * _Available since v2.4.0._\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-solidity/contracts/math/SafeMath.sol", "ast": { "absolutePath": "openzeppelin-solidity/contracts/math/SafeMath.sol", "exportedSymbols": { "SafeMath": [ 5801 ] }, "id": 5802, "nodeType": "SourceUnit", "nodes": [ { "id": 5616, "literals": [ "solidity", "^", "0.5", ".0" ], "nodeType": "PragmaDirective", "src": "0:23:13" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "library", "documentation": "@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": 5801, "linearizedBaseContracts": [ 5801 ], "name": "SafeMath", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 5640, "nodeType": "Block", "src": "901:109:13", "statements": [ { "assignments": [ 5626 ], "declarations": [ { "constant": false, "id": 5626, "name": "c", "nodeType": "VariableDeclaration", "scope": 5640, "src": "911:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5625, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "911:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 5630, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5629, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5627, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5618, "src": "923:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "argumentTypes": null, "id": 5628, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5620, "src": "927:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "923:5:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "911:17:13" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5634, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5632, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5626, "src": "946:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "argumentTypes": null, "id": 5633, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5618, "src": "951:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "946:6:13", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "536166654d6174683a206164646974696f6e206f766572666c6f77", "id": 5635, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "954:29:13", "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": 5631, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 6351, 6352 ], "referencedDeclaration": 6352, "src": "938:7:13", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 5636, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "938:46:13", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 5637, "nodeType": "ExpressionStatement", "src": "938:46:13" }, { "expression": { "argumentTypes": null, "id": 5638, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5626, "src": "1002:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 5624, "id": 5639, "nodeType": "Return", "src": "995:8:13" } ] }, "documentation": "@dev Returns the addition of two unsigned integers, reverting on\noverflow.\n * Counterpart to Solidity's `+` operator.\n * Requirements:\n- Addition cannot overflow.", "id": 5641, "implemented": true, "kind": "function", "modifiers": [], "name": "add", "nodeType": "FunctionDefinition", "parameters": { "id": 5621, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5618, "name": "a", "nodeType": "VariableDeclaration", "scope": 5641, "src": "847:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5617, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "847:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5620, "name": "b", "nodeType": "VariableDeclaration", "scope": 5641, "src": "858:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5619, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "858:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "846:22:13" }, "returnParameters": { "id": 5624, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5623, "name": "", "nodeType": "VariableDeclaration", "scope": 5641, "src": "892:7:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5622, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "892:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "891:9:13" }, "scope": 5801, "src": "834:176:13", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 5656, "nodeType": "Block", "src": "1341:67:13", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 5651, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5643, "src": "1362:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "id": 5652, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5645, "src": "1365:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "hexValue": "536166654d6174683a207375627472616374696f6e206f766572666c6f77", "id": 5653, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1368:32:13", "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": 5650, "name": "sub", "nodeType": "Identifier", "overloadedDeclarations": [ 5657, 5684 ], "referencedDeclaration": 5684, "src": "1358:3:13", "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": 5654, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1358:43:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 5649, "id": 5655, "nodeType": "Return", "src": "1351:50:13" } ] }, "documentation": "@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": 5657, "implemented": true, "kind": "function", "modifiers": [], "name": "sub", "nodeType": "FunctionDefinition", "parameters": { "id": 5646, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5643, "name": "a", "nodeType": "VariableDeclaration", "scope": 5657, "src": "1287:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5642, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1287:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5645, "name": "b", "nodeType": "VariableDeclaration", "scope": 5657, "src": "1298:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5644, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1298:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1286:22:13" }, "returnParameters": { "id": 5649, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5648, "name": "", "nodeType": "VariableDeclaration", "scope": 5657, "src": "1332:7:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5647, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1332:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1331:9:13" }, "scope": 5801, "src": "1274:134:13", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 5683, "nodeType": "Block", "src": "1827:92:13", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5671, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5669, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5661, "src": "1845:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "<=", "rightExpression": { "argumentTypes": null, "id": 5670, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5659, "src": "1850:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1845:6:13", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "id": 5672, "name": "errorMessage", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5663, "src": "1853:12:13", "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": 5668, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 6351, 6352 ], "referencedDeclaration": 6352, "src": "1837:7:13", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 5673, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1837:29:13", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 5674, "nodeType": "ExpressionStatement", "src": "1837:29:13" }, { "assignments": [ 5676 ], "declarations": [ { "constant": false, "id": 5676, "name": "c", "nodeType": "VariableDeclaration", "scope": 5683, "src": "1876:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5675, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1876:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 5680, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5679, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5677, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5659, "src": "1888:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": { "argumentTypes": null, "id": 5678, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5661, "src": "1892:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1888:5:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "1876:17:13" }, { "expression": { "argumentTypes": null, "id": 5681, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5676, "src": "1911:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 5667, "id": 5682, "nodeType": "Return", "src": "1904:8:13" } ] }, "documentation": "@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.\n * _Available since v2.4.0._", "id": 5684, "implemented": true, "kind": "function", "modifiers": [], "name": "sub", "nodeType": "FunctionDefinition", "parameters": { "id": 5664, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5659, "name": "a", "nodeType": "VariableDeclaration", "scope": 5684, "src": "1745:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5658, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1745:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5661, "name": "b", "nodeType": "VariableDeclaration", "scope": 5684, "src": "1756:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5660, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1756:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5663, "name": "errorMessage", "nodeType": "VariableDeclaration", "scope": 5684, "src": "1767:26:13", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 5662, "name": "string", "nodeType": "ElementaryTypeName", "src": "1767:6:13", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "internal" } ], "src": "1744:50:13" }, "returnParameters": { "id": 5667, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5666, "name": "", "nodeType": "VariableDeclaration", "scope": 5684, "src": "1818:7:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5665, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1818:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1817:9:13" }, "scope": 5801, "src": "1732:187:13", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 5717, "nodeType": "Block", "src": "2226:392:13", "statements": [ { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5695, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5693, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5686, "src": "2458:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 5694, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2463:1:13", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "2458:6:13", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 5699, "nodeType": "IfStatement", "src": "2454:45:13", "trueBody": { "id": 5698, "nodeType": "Block", "src": "2466:33:13", "statements": [ { "expression": { "argumentTypes": null, "hexValue": "30", "id": 5696, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2487:1:13", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "functionReturnParameters": 5692, "id": 5697, "nodeType": "Return", "src": "2480:8:13" } ] } }, { "assignments": [ 5701 ], "declarations": [ { "constant": false, "id": 5701, "name": "c", "nodeType": "VariableDeclaration", "scope": 5717, "src": "2509:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5700, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2509:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 5705, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5704, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5702, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5686, "src": "2521:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "argumentTypes": null, "id": 5703, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5688, "src": "2525:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "2521:5:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "2509:17:13" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5711, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5709, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5707, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5701, "src": "2544:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "argumentTypes": null, "id": 5708, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5686, "src": "2548:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "2544:5:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "id": 5710, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5688, "src": "2553:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "2544:10:13", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77", "id": 5712, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "2556:35:13", "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": 5706, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 6351, 6352 ], "referencedDeclaration": 6352, "src": "2536:7:13", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 5713, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2536:56:13", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 5714, "nodeType": "ExpressionStatement", "src": "2536:56:13" }, { "expression": { "argumentTypes": null, "id": 5715, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5701, "src": "2610:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 5692, "id": 5716, "nodeType": "Return", "src": "2603:8:13" } ] }, "documentation": "@dev Returns the multiplication of two unsigned integers, reverting on\noverflow.\n * Counterpart to Solidity's `*` operator.\n * Requirements:\n- Multiplication cannot overflow.", "id": 5718, "implemented": true, "kind": "function", "modifiers": [], "name": "mul", "nodeType": "FunctionDefinition", "parameters": { "id": 5689, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5686, "name": "a", "nodeType": "VariableDeclaration", "scope": 5718, "src": "2172:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5685, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2172:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5688, "name": "b", "nodeType": "VariableDeclaration", "scope": 5718, "src": "2183:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5687, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2183:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "2171:22:13" }, "returnParameters": { "id": 5692, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5691, "name": "", "nodeType": "VariableDeclaration", "scope": 5718, "src": "2217:7:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5690, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2217:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "2216:9:13" }, "scope": 5801, "src": "2159:459:13", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 5733, "nodeType": "Block", "src": "3140:63:13", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 5728, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5720, "src": "3161:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "id": 5729, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5722, "src": "3164:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "hexValue": "536166654d6174683a206469766973696f6e206279207a65726f", "id": 5730, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "3167:28:13", "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": 5727, "name": "div", "nodeType": "Identifier", "overloadedDeclarations": [ 5734, 5761 ], "referencedDeclaration": 5761, "src": "3157:3:13", "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": 5731, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "3157:39:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 5726, "id": 5732, "nodeType": "Return", "src": "3150:46:13" } ] }, "documentation": "@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": 5734, "implemented": true, "kind": "function", "modifiers": [], "name": "div", "nodeType": "FunctionDefinition", "parameters": { "id": 5723, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5720, "name": "a", "nodeType": "VariableDeclaration", "scope": 5734, "src": "3086:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5719, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3086:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5722, "name": "b", "nodeType": "VariableDeclaration", "scope": 5734, "src": "3097:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5721, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3097:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "3085:22:13" }, "returnParameters": { "id": 5726, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5725, "name": "", "nodeType": "VariableDeclaration", "scope": 5734, "src": "3131:7:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5724, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3131:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "3130:9:13" }, "scope": 5801, "src": "3073:130:13", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 5760, "nodeType": "Block", "src": "3813:243:13", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5748, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5746, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5738, "src": "3897:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 5747, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "3901:1:13", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "3897:5:13", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "id": 5749, "name": "errorMessage", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5740, "src": "3904:12:13", "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": 5745, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 6351, 6352 ], "referencedDeclaration": 6352, "src": "3889:7:13", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 5750, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "3889:28:13", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 5751, "nodeType": "ExpressionStatement", "src": "3889:28:13" }, { "assignments": [ 5753 ], "declarations": [ { "constant": false, "id": 5753, "name": "c", "nodeType": "VariableDeclaration", "scope": 5760, "src": "3927:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5752, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3927:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 5757, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5756, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5754, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5736, "src": "3939:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "argumentTypes": null, "id": 5755, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5738, "src": "3943:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "3939:5:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "3927:17:13" }, { "expression": { "argumentTypes": null, "id": 5758, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5753, "src": "4048:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 5744, "id": 5759, "nodeType": "Return", "src": "4041:8:13" } ] }, "documentation": "@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.\n * _Available since v2.4.0._", "id": 5761, "implemented": true, "kind": "function", "modifiers": [], "name": "div", "nodeType": "FunctionDefinition", "parameters": { "id": 5741, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5736, "name": "a", "nodeType": "VariableDeclaration", "scope": 5761, "src": "3731:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5735, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3731:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5738, "name": "b", "nodeType": "VariableDeclaration", "scope": 5761, "src": "3742:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5737, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3742:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5740, "name": "errorMessage", "nodeType": "VariableDeclaration", "scope": 5761, "src": "3753:26:13", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 5739, "name": "string", "nodeType": "ElementaryTypeName", "src": "3753:6:13", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "internal" } ], "src": "3730:50:13" }, "returnParameters": { "id": 5744, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5743, "name": "", "nodeType": "VariableDeclaration", "scope": 5761, "src": "3804:7:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5742, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3804:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "3803:9:13" }, "scope": 5801, "src": "3718:338:13", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 5776, "nodeType": "Block", "src": "4567:61:13", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 5771, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5763, "src": "4588:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "id": 5772, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5765, "src": "4591:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "hexValue": "536166654d6174683a206d6f64756c6f206279207a65726f", "id": 5773, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "4594:26:13", "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": 5770, "name": "mod", "nodeType": "Identifier", "overloadedDeclarations": [ 5777, 5800 ], "referencedDeclaration": 5800, "src": "4584:3:13", "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": 5774, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "4584:37:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 5769, "id": 5775, "nodeType": "Return", "src": "4577:44:13" } ] }, "documentation": "@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": 5777, "implemented": true, "kind": "function", "modifiers": [], "name": "mod", "nodeType": "FunctionDefinition", "parameters": { "id": 5766, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5763, "name": "a", "nodeType": "VariableDeclaration", "scope": 5777, "src": "4513:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5762, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "4513:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5765, "name": "b", "nodeType": "VariableDeclaration", "scope": 5777, "src": "4524:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5764, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "4524:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "4512:22:13" }, "returnParameters": { "id": 5769, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5768, "name": "", "nodeType": "VariableDeclaration", "scope": 5777, "src": "4558:7:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5767, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "4558:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "4557:9:13" }, "scope": 5801, "src": "4500:128:13", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 5799, "nodeType": "Block", "src": "5227:68:13", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5791, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5789, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5781, "src": "5245:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 5790, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "5250:1:13", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "5245:6:13", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "id": 5792, "name": "errorMessage", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5783, "src": "5253:12:13", "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": 5788, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 6351, 6352 ], "referencedDeclaration": 6352, "src": "5237:7:13", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 5793, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "5237:29:13", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 5794, "nodeType": "ExpressionStatement", "src": "5237:29:13" }, { "expression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5797, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5795, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5779, "src": "5283:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "%", "rightExpression": { "argumentTypes": null, "id": 5796, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5781, "src": "5287:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "5283:5:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 5787, "id": 5798, "nodeType": "Return", "src": "5276:12:13" } ] }, "documentation": "@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.\n * _Available since v2.4.0._", "id": 5800, "implemented": true, "kind": "function", "modifiers": [], "name": "mod", "nodeType": "FunctionDefinition", "parameters": { "id": 5784, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5779, "name": "a", "nodeType": "VariableDeclaration", "scope": 5800, "src": "5145:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5778, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "5145:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5781, "name": "b", "nodeType": "VariableDeclaration", "scope": 5800, "src": "5156:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5780, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "5156:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5783, "name": "errorMessage", "nodeType": "VariableDeclaration", "scope": 5800, "src": "5167:26:13", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 5782, "name": "string", "nodeType": "ElementaryTypeName", "src": "5167:6:13", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "internal" } ], "src": "5144:50:13" }, "returnParameters": { "id": 5787, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5786, "name": "", "nodeType": "VariableDeclaration", "scope": 5800, "src": "5218:7:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5785, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "5218:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "5217:9:13" }, "scope": 5801, "src": "5132:163:13", "stateMutability": "pure", "superFunction": null, "visibility": "internal" } ], "scope": 5802, "src": "589:4708:13" } ], "src": "0:5298:13" }, "legacyAST": { "absolutePath": "openzeppelin-solidity/contracts/math/SafeMath.sol", "exportedSymbols": { "SafeMath": [ 5801 ] }, "id": 5802, "nodeType": "SourceUnit", "nodes": [ { "id": 5616, "literals": [ "solidity", "^", "0.5", ".0" ], "nodeType": "PragmaDirective", "src": "0:23:13" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "library", "documentation": "@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": 5801, "linearizedBaseContracts": [ 5801 ], "name": "SafeMath", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 5640, "nodeType": "Block", "src": "901:109:13", "statements": [ { "assignments": [ 5626 ], "declarations": [ { "constant": false, "id": 5626, "name": "c", "nodeType": "VariableDeclaration", "scope": 5640, "src": "911:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5625, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "911:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 5630, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5629, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5627, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5618, "src": "923:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "argumentTypes": null, "id": 5628, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5620, "src": "927:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "923:5:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "911:17:13" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5634, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5632, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5626, "src": "946:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "argumentTypes": null, "id": 5633, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5618, "src": "951:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "946:6:13", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "536166654d6174683a206164646974696f6e206f766572666c6f77", "id": 5635, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "954:29:13", "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": 5631, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 6351, 6352 ], "referencedDeclaration": 6352, "src": "938:7:13", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 5636, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "938:46:13", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 5637, "nodeType": "ExpressionStatement", "src": "938:46:13" }, { "expression": { "argumentTypes": null, "id": 5638, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5626, "src": "1002:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 5624, "id": 5639, "nodeType": "Return", "src": "995:8:13" } ] }, "documentation": "@dev Returns the addition of two unsigned integers, reverting on\noverflow.\n * Counterpart to Solidity's `+` operator.\n * Requirements:\n- Addition cannot overflow.", "id": 5641, "implemented": true, "kind": "function", "modifiers": [], "name": "add", "nodeType": "FunctionDefinition", "parameters": { "id": 5621, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5618, "name": "a", "nodeType": "VariableDeclaration", "scope": 5641, "src": "847:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5617, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "847:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5620, "name": "b", "nodeType": "VariableDeclaration", "scope": 5641, "src": "858:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5619, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "858:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "846:22:13" }, "returnParameters": { "id": 5624, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5623, "name": "", "nodeType": "VariableDeclaration", "scope": 5641, "src": "892:7:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5622, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "892:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "891:9:13" }, "scope": 5801, "src": "834:176:13", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 5656, "nodeType": "Block", "src": "1341:67:13", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 5651, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5643, "src": "1362:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "id": 5652, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5645, "src": "1365:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "hexValue": "536166654d6174683a207375627472616374696f6e206f766572666c6f77", "id": 5653, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1368:32:13", "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": 5650, "name": "sub", "nodeType": "Identifier", "overloadedDeclarations": [ 5657, 5684 ], "referencedDeclaration": 5684, "src": "1358:3:13", "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": 5654, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1358:43:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 5649, "id": 5655, "nodeType": "Return", "src": "1351:50:13" } ] }, "documentation": "@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": 5657, "implemented": true, "kind": "function", "modifiers": [], "name": "sub", "nodeType": "FunctionDefinition", "parameters": { "id": 5646, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5643, "name": "a", "nodeType": "VariableDeclaration", "scope": 5657, "src": "1287:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5642, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1287:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5645, "name": "b", "nodeType": "VariableDeclaration", "scope": 5657, "src": "1298:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5644, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1298:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1286:22:13" }, "returnParameters": { "id": 5649, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5648, "name": "", "nodeType": "VariableDeclaration", "scope": 5657, "src": "1332:7:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5647, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1332:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1331:9:13" }, "scope": 5801, "src": "1274:134:13", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 5683, "nodeType": "Block", "src": "1827:92:13", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5671, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5669, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5661, "src": "1845:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "<=", "rightExpression": { "argumentTypes": null, "id": 5670, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5659, "src": "1850:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1845:6:13", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "id": 5672, "name": "errorMessage", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5663, "src": "1853:12:13", "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": 5668, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 6351, 6352 ], "referencedDeclaration": 6352, "src": "1837:7:13", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 5673, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1837:29:13", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 5674, "nodeType": "ExpressionStatement", "src": "1837:29:13" }, { "assignments": [ 5676 ], "declarations": [ { "constant": false, "id": 5676, "name": "c", "nodeType": "VariableDeclaration", "scope": 5683, "src": "1876:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5675, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1876:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 5680, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5679, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5677, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5659, "src": "1888:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": { "argumentTypes": null, "id": 5678, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5661, "src": "1892:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1888:5:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "1876:17:13" }, { "expression": { "argumentTypes": null, "id": 5681, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5676, "src": "1911:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 5667, "id": 5682, "nodeType": "Return", "src": "1904:8:13" } ] }, "documentation": "@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.\n * _Available since v2.4.0._", "id": 5684, "implemented": true, "kind": "function", "modifiers": [], "name": "sub", "nodeType": "FunctionDefinition", "parameters": { "id": 5664, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5659, "name": "a", "nodeType": "VariableDeclaration", "scope": 5684, "src": "1745:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5658, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1745:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5661, "name": "b", "nodeType": "VariableDeclaration", "scope": 5684, "src": "1756:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5660, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1756:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5663, "name": "errorMessage", "nodeType": "VariableDeclaration", "scope": 5684, "src": "1767:26:13", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 5662, "name": "string", "nodeType": "ElementaryTypeName", "src": "1767:6:13", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "internal" } ], "src": "1744:50:13" }, "returnParameters": { "id": 5667, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5666, "name": "", "nodeType": "VariableDeclaration", "scope": 5684, "src": "1818:7:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5665, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1818:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1817:9:13" }, "scope": 5801, "src": "1732:187:13", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 5717, "nodeType": "Block", "src": "2226:392:13", "statements": [ { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5695, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5693, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5686, "src": "2458:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 5694, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2463:1:13", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "2458:6:13", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 5699, "nodeType": "IfStatement", "src": "2454:45:13", "trueBody": { "id": 5698, "nodeType": "Block", "src": "2466:33:13", "statements": [ { "expression": { "argumentTypes": null, "hexValue": "30", "id": 5696, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2487:1:13", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "functionReturnParameters": 5692, "id": 5697, "nodeType": "Return", "src": "2480:8:13" } ] } }, { "assignments": [ 5701 ], "declarations": [ { "constant": false, "id": 5701, "name": "c", "nodeType": "VariableDeclaration", "scope": 5717, "src": "2509:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5700, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2509:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 5705, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5704, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5702, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5686, "src": "2521:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "argumentTypes": null, "id": 5703, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5688, "src": "2525:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "2521:5:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "2509:17:13" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5711, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5709, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5707, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5701, "src": "2544:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "argumentTypes": null, "id": 5708, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5686, "src": "2548:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "2544:5:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "id": 5710, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5688, "src": "2553:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "2544:10:13", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77", "id": 5712, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "2556:35:13", "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": 5706, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 6351, 6352 ], "referencedDeclaration": 6352, "src": "2536:7:13", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 5713, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2536:56:13", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 5714, "nodeType": "ExpressionStatement", "src": "2536:56:13" }, { "expression": { "argumentTypes": null, "id": 5715, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5701, "src": "2610:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 5692, "id": 5716, "nodeType": "Return", "src": "2603:8:13" } ] }, "documentation": "@dev Returns the multiplication of two unsigned integers, reverting on\noverflow.\n * Counterpart to Solidity's `*` operator.\n * Requirements:\n- Multiplication cannot overflow.", "id": 5718, "implemented": true, "kind": "function", "modifiers": [], "name": "mul", "nodeType": "FunctionDefinition", "parameters": { "id": 5689, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5686, "name": "a", "nodeType": "VariableDeclaration", "scope": 5718, "src": "2172:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5685, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2172:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5688, "name": "b", "nodeType": "VariableDeclaration", "scope": 5718, "src": "2183:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5687, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2183:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "2171:22:13" }, "returnParameters": { "id": 5692, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5691, "name": "", "nodeType": "VariableDeclaration", "scope": 5718, "src": "2217:7:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5690, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2217:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "2216:9:13" }, "scope": 5801, "src": "2159:459:13", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 5733, "nodeType": "Block", "src": "3140:63:13", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 5728, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5720, "src": "3161:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "id": 5729, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5722, "src": "3164:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "hexValue": "536166654d6174683a206469766973696f6e206279207a65726f", "id": 5730, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "3167:28:13", "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": 5727, "name": "div", "nodeType": "Identifier", "overloadedDeclarations": [ 5734, 5761 ], "referencedDeclaration": 5761, "src": "3157:3:13", "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": 5731, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "3157:39:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 5726, "id": 5732, "nodeType": "Return", "src": "3150:46:13" } ] }, "documentation": "@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": 5734, "implemented": true, "kind": "function", "modifiers": [], "name": "div", "nodeType": "FunctionDefinition", "parameters": { "id": 5723, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5720, "name": "a", "nodeType": "VariableDeclaration", "scope": 5734, "src": "3086:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5719, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3086:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5722, "name": "b", "nodeType": "VariableDeclaration", "scope": 5734, "src": "3097:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5721, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3097:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "3085:22:13" }, "returnParameters": { "id": 5726, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5725, "name": "", "nodeType": "VariableDeclaration", "scope": 5734, "src": "3131:7:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5724, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3131:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "3130:9:13" }, "scope": 5801, "src": "3073:130:13", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 5760, "nodeType": "Block", "src": "3813:243:13", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5748, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5746, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5738, "src": "3897:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 5747, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "3901:1:13", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "3897:5:13", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "id": 5749, "name": "errorMessage", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5740, "src": "3904:12:13", "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": 5745, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 6351, 6352 ], "referencedDeclaration": 6352, "src": "3889:7:13", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 5750, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "3889:28:13", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 5751, "nodeType": "ExpressionStatement", "src": "3889:28:13" }, { "assignments": [ 5753 ], "declarations": [ { "constant": false, "id": 5753, "name": "c", "nodeType": "VariableDeclaration", "scope": 5760, "src": "3927:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5752, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3927:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 5757, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5756, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5754, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5736, "src": "3939:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "argumentTypes": null, "id": 5755, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5738, "src": "3943:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "3939:5:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "3927:17:13" }, { "expression": { "argumentTypes": null, "id": 5758, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5753, "src": "4048:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 5744, "id": 5759, "nodeType": "Return", "src": "4041:8:13" } ] }, "documentation": "@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.\n * _Available since v2.4.0._", "id": 5761, "implemented": true, "kind": "function", "modifiers": [], "name": "div", "nodeType": "FunctionDefinition", "parameters": { "id": 5741, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5736, "name": "a", "nodeType": "VariableDeclaration", "scope": 5761, "src": "3731:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5735, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3731:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5738, "name": "b", "nodeType": "VariableDeclaration", "scope": 5761, "src": "3742:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5737, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3742:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5740, "name": "errorMessage", "nodeType": "VariableDeclaration", "scope": 5761, "src": "3753:26:13", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 5739, "name": "string", "nodeType": "ElementaryTypeName", "src": "3753:6:13", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "internal" } ], "src": "3730:50:13" }, "returnParameters": { "id": 5744, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5743, "name": "", "nodeType": "VariableDeclaration", "scope": 5761, "src": "3804:7:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5742, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3804:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "3803:9:13" }, "scope": 5801, "src": "3718:338:13", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 5776, "nodeType": "Block", "src": "4567:61:13", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 5771, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5763, "src": "4588:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "id": 5772, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5765, "src": "4591:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "hexValue": "536166654d6174683a206d6f64756c6f206279207a65726f", "id": 5773, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "4594:26:13", "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": 5770, "name": "mod", "nodeType": "Identifier", "overloadedDeclarations": [ 5777, 5800 ], "referencedDeclaration": 5800, "src": "4584:3:13", "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": 5774, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "4584:37:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 5769, "id": 5775, "nodeType": "Return", "src": "4577:44:13" } ] }, "documentation": "@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": 5777, "implemented": true, "kind": "function", "modifiers": [], "name": "mod", "nodeType": "FunctionDefinition", "parameters": { "id": 5766, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5763, "name": "a", "nodeType": "VariableDeclaration", "scope": 5777, "src": "4513:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5762, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "4513:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5765, "name": "b", "nodeType": "VariableDeclaration", "scope": 5777, "src": "4524:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5764, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "4524:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "4512:22:13" }, "returnParameters": { "id": 5769, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5768, "name": "", "nodeType": "VariableDeclaration", "scope": 5777, "src": "4558:7:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5767, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "4558:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "4557:9:13" }, "scope": 5801, "src": "4500:128:13", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 5799, "nodeType": "Block", "src": "5227:68:13", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5791, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5789, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5781, "src": "5245:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 5790, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "5250:1:13", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "5245:6:13", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "id": 5792, "name": "errorMessage", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5783, "src": "5253:12:13", "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": 5788, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 6351, 6352 ], "referencedDeclaration": 6352, "src": "5237:7:13", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 5793, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "5237:29:13", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 5794, "nodeType": "ExpressionStatement", "src": "5237:29:13" }, { "expression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5797, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5795, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5779, "src": "5283:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "%", "rightExpression": { "argumentTypes": null, "id": 5796, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5781, "src": "5287:1:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "5283:5:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 5787, "id": 5798, "nodeType": "Return", "src": "5276:12:13" } ] }, "documentation": "@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.\n * _Available since v2.4.0._", "id": 5800, "implemented": true, "kind": "function", "modifiers": [], "name": "mod", "nodeType": "FunctionDefinition", "parameters": { "id": 5784, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5779, "name": "a", "nodeType": "VariableDeclaration", "scope": 5800, "src": "5145:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5778, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "5145:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5781, "name": "b", "nodeType": "VariableDeclaration", "scope": 5800, "src": "5156:9:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5780, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "5156:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5783, "name": "errorMessage", "nodeType": "VariableDeclaration", "scope": 5800, "src": "5167:26:13", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 5782, "name": "string", "nodeType": "ElementaryTypeName", "src": "5167:6:13", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "internal" } ], "src": "5144:50:13" }, "returnParameters": { "id": 5787, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5786, "name": "", "nodeType": "VariableDeclaration", "scope": 5800, "src": "5218:7:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5785, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "5218:7:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "5217:9:13" }, "scope": 5801, "src": "5132:163:13", "stateMutability": "pure", "superFunction": null, "visibility": "internal" } ], "scope": 5802, "src": "589:4708:13" } ], "src": "0:5298:13" }, "compiler": { "name": "solc", "version": "0.5.16+commit.9c3226ce.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.1.0", "updatedAt": "2020-04-13T15:29:57.227Z", "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": {} } }