{ "contractName": "SafeMath", "abi": [], "bytecode": "0x604c602c600b82828239805160001a60731460008114601c57601e565bfe5b5030600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea165627a7a723058201c0a8c2261cb5f548df4142b30bd1b003a398bd31cdc2348a4b383cba139dd6f0029", "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea165627a7a723058201c0a8c2261cb5f548df4142b30bd1b003a398bd31cdc2348a4b383cba139dd6f0029", "sourceMap": "125:1737:8:-;;132:2:-1;166:7;155:9;146:7;137:37;252:7;246:14;243:1;238:23;232:4;229:33;270:1;265:20;;;;222:63;;265:20;274:9;222:63;;298:9;295:1;288:20;328:4;319:7;311:22;352:7;343;336:24", "deployedSourceMap": "125:1737:8:-;;;;;;;;", "source": "pragma solidity ^0.5.2;\n\n/**\n * @title SafeMath\n * @dev Unsigned math operations with safety checks that revert on error\n */\nlibrary SafeMath {\n /**\n * @dev Multiplies two unsigned integers, reverts on 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-solidity/pull/522\n if (a == 0) {\n return 0;\n }\n\n uint256 c = a * b;\n require(c / a == b);\n\n return c;\n }\n\n /**\n * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n // Solidity only automatically asserts when dividing by 0\n require(b > 0);\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 Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a);\n uint256 c = a - b;\n\n return c;\n }\n\n /**\n * @dev Adds two unsigned integers, reverts on overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a);\n\n return c;\n }\n\n /**\n * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),\n * reverts when dividing by zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b != 0);\n return a % b;\n }\n}\n", "sourcePath": "openzeppelin-solidity/contracts/math/SafeMath.sol", "ast": { "absolutePath": "openzeppelin-solidity/contracts/math/SafeMath.sol", "exportedSymbols": { "SafeMath": [ 2764 ] }, "id": 2765, "nodeType": "SourceUnit", "nodes": [ { "id": 2638, "literals": [ "solidity", "^", "0.5", ".2" ], "nodeType": "PragmaDirective", "src": "0:23:8" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "library", "documentation": "@title SafeMath\n@dev Unsigned math operations with safety checks that revert on error", "fullyImplemented": true, "id": 2764, "linearizedBaseContracts": [ 2764 ], "name": "SafeMath", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 2670, "nodeType": "Block", "src": "298:354:8", "statements": [ { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2649, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2647, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2640, "src": "529:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 2648, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "534:1:8", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "529:6:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 2653, "nodeType": "IfStatement", "src": "525:45:8", "trueBody": { "id": 2652, "nodeType": "Block", "src": "537:33:8", "statements": [ { "expression": { "argumentTypes": null, "hexValue": "30", "id": 2650, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "558:1:8", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "functionReturnParameters": 2646, "id": 2651, "nodeType": "Return", "src": "551:8:8" } ] } }, { "assignments": [ 2655 ], "declarations": [ { "constant": false, "id": 2655, "name": "c", "nodeType": "VariableDeclaration", "scope": 2670, "src": "580:9:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2654, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "580:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 2659, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2658, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2656, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2640, "src": "592:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "argumentTypes": null, "id": 2657, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2642, "src": "596:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "592:5:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "580:17:8" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2665, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2663, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2661, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2655, "src": "615:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "argumentTypes": null, "id": 2662, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2640, "src": "619:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "615:5:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "id": 2664, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2642, "src": "624:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "615:10:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 2660, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 3292, 3293 ], "referencedDeclaration": 3292, "src": "607:7:8", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 2666, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "607:19:8", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2667, "nodeType": "ExpressionStatement", "src": "607:19:8" }, { "expression": { "argumentTypes": null, "id": 2668, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2655, "src": "644:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 2646, "id": 2669, "nodeType": "Return", "src": "637:8:8" } ] }, "documentation": "@dev Multiplies two unsigned integers, reverts on overflow.", "id": 2671, "implemented": true, "kind": "function", "modifiers": [], "name": "mul", "nodeType": "FunctionDefinition", "parameters": { "id": 2643, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2640, "name": "a", "nodeType": "VariableDeclaration", "scope": 2671, "src": "244:9:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2639, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "244:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2642, "name": "b", "nodeType": "VariableDeclaration", "scope": 2671, "src": "255:9:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2641, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "255:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "243:22:8" }, "returnParameters": { "id": 2646, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2645, "name": "", "nodeType": "VariableDeclaration", "scope": 2671, "src": "289:7:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2644, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "289:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "288:9:8" }, "scope": 2764, "src": "231:421:8", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 2694, "nodeType": "Block", "src": "849:229:8", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2683, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2681, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2675, "src": "933:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 2682, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "937:1:8", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "933:5:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 2680, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 3292, 3293 ], "referencedDeclaration": 3292, "src": "925:7:8", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 2684, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "925:14:8", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2685, "nodeType": "ExpressionStatement", "src": "925:14:8" }, { "assignments": [ 2687 ], "declarations": [ { "constant": false, "id": 2687, "name": "c", "nodeType": "VariableDeclaration", "scope": 2694, "src": "949:9:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2686, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "949:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 2691, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2690, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2688, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2673, "src": "961:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "argumentTypes": null, "id": 2689, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2675, "src": "965:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "961:5:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "949:17:8" }, { "expression": { "argumentTypes": null, "id": 2692, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2687, "src": "1070:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 2679, "id": 2693, "nodeType": "Return", "src": "1063:8:8" } ] }, "documentation": "@dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.", "id": 2695, "implemented": true, "kind": "function", "modifiers": [], "name": "div", "nodeType": "FunctionDefinition", "parameters": { "id": 2676, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2673, "name": "a", "nodeType": "VariableDeclaration", "scope": 2695, "src": "795:9:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2672, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "795:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2675, "name": "b", "nodeType": "VariableDeclaration", "scope": 2695, "src": "806:9:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2674, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "806:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "794:22:8" }, "returnParameters": { "id": 2679, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2678, "name": "", "nodeType": "VariableDeclaration", "scope": 2695, "src": "840:7:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2677, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "840:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "839:9:8" }, "scope": 2764, "src": "782:296:8", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 2718, "nodeType": "Block", "src": "1278:78:8", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2707, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2705, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2699, "src": "1296:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "<=", "rightExpression": { "argumentTypes": null, "id": 2706, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2697, "src": "1301:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1296:6:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 2704, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 3292, 3293 ], "referencedDeclaration": 3292, "src": "1288:7:8", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 2708, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1288:15:8", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2709, "nodeType": "ExpressionStatement", "src": "1288:15:8" }, { "assignments": [ 2711 ], "declarations": [ { "constant": false, "id": 2711, "name": "c", "nodeType": "VariableDeclaration", "scope": 2718, "src": "1313:9:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2710, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1313:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 2715, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2714, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2712, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2697, "src": "1325:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": { "argumentTypes": null, "id": 2713, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2699, "src": "1329:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1325:5:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "1313:17:8" }, { "expression": { "argumentTypes": null, "id": 2716, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2711, "src": "1348:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 2703, "id": 2717, "nodeType": "Return", "src": "1341:8:8" } ] }, "documentation": "@dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).", "id": 2719, "implemented": true, "kind": "function", "modifiers": [], "name": "sub", "nodeType": "FunctionDefinition", "parameters": { "id": 2700, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2697, "name": "a", "nodeType": "VariableDeclaration", "scope": 2719, "src": "1224:9:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2696, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1224:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2699, "name": "b", "nodeType": "VariableDeclaration", "scope": 2719, "src": "1235:9:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2698, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1235:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1223:22:8" }, "returnParameters": { "id": 2703, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2702, "name": "", "nodeType": "VariableDeclaration", "scope": 2719, "src": "1269:7:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2701, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1269:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1268:9:8" }, "scope": 2764, "src": "1211:145:8", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 2742, "nodeType": "Block", "src": "1506:78:8", "statements": [ { "assignments": [ 2729 ], "declarations": [ { "constant": false, "id": 2729, "name": "c", "nodeType": "VariableDeclaration", "scope": 2742, "src": "1516:9:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2728, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1516:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 2733, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2732, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2730, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2721, "src": "1528:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "argumentTypes": null, "id": 2731, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2723, "src": "1532:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1528:5:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "1516:17:8" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2737, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2735, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2729, "src": "1551:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "argumentTypes": null, "id": 2736, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2721, "src": "1556:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1551:6:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 2734, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 3292, 3293 ], "referencedDeclaration": 3292, "src": "1543:7:8", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 2738, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1543:15:8", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2739, "nodeType": "ExpressionStatement", "src": "1543:15:8" }, { "expression": { "argumentTypes": null, "id": 2740, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2729, "src": "1576:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 2727, "id": 2741, "nodeType": "Return", "src": "1569:8:8" } ] }, "documentation": "@dev Adds two unsigned integers, reverts on overflow.", "id": 2743, "implemented": true, "kind": "function", "modifiers": [], "name": "add", "nodeType": "FunctionDefinition", "parameters": { "id": 2724, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2721, "name": "a", "nodeType": "VariableDeclaration", "scope": 2743, "src": "1452:9:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2720, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1452:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2723, "name": "b", "nodeType": "VariableDeclaration", "scope": 2743, "src": "1463:9:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2722, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1463:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1451:22:8" }, "returnParameters": { "id": 2727, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2726, "name": "", "nodeType": "VariableDeclaration", "scope": 2743, "src": "1497:7:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2725, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1497:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1496:9:8" }, "scope": 2764, "src": "1439:145:8", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 2762, "nodeType": "Block", "src": "1806:54:8", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2755, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2753, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2747, "src": "1824:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 2754, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1829:1:8", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "1824:6:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 2752, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 3292, 3293 ], "referencedDeclaration": 3292, "src": "1816:7:8", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 2756, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1816:15:8", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2757, "nodeType": "ExpressionStatement", "src": "1816:15:8" }, { "expression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2760, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2758, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2745, "src": "1848:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "%", "rightExpression": { "argumentTypes": null, "id": 2759, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2747, "src": "1852:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1848:5:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 2751, "id": 2761, "nodeType": "Return", "src": "1841:12:8" } ] }, "documentation": "@dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),\nreverts when dividing by zero.", "id": 2763, "implemented": true, "kind": "function", "modifiers": [], "name": "mod", "nodeType": "FunctionDefinition", "parameters": { "id": 2748, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2745, "name": "a", "nodeType": "VariableDeclaration", "scope": 2763, "src": "1752:9:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2744, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1752:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2747, "name": "b", "nodeType": "VariableDeclaration", "scope": 2763, "src": "1763:9:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2746, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1763:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1751:22:8" }, "returnParameters": { "id": 2751, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2750, "name": "", "nodeType": "VariableDeclaration", "scope": 2763, "src": "1797:7:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2749, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1797:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1796:9:8" }, "scope": 2764, "src": "1739:121:8", "stateMutability": "pure", "superFunction": null, "visibility": "internal" } ], "scope": 2765, "src": "125:1737:8" } ], "src": "0:1863:8" }, "legacyAST": { "absolutePath": "openzeppelin-solidity/contracts/math/SafeMath.sol", "exportedSymbols": { "SafeMath": [ 2764 ] }, "id": 2765, "nodeType": "SourceUnit", "nodes": [ { "id": 2638, "literals": [ "solidity", "^", "0.5", ".2" ], "nodeType": "PragmaDirective", "src": "0:23:8" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "library", "documentation": "@title SafeMath\n@dev Unsigned math operations with safety checks that revert on error", "fullyImplemented": true, "id": 2764, "linearizedBaseContracts": [ 2764 ], "name": "SafeMath", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 2670, "nodeType": "Block", "src": "298:354:8", "statements": [ { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2649, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2647, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2640, "src": "529:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 2648, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "534:1:8", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "529:6:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 2653, "nodeType": "IfStatement", "src": "525:45:8", "trueBody": { "id": 2652, "nodeType": "Block", "src": "537:33:8", "statements": [ { "expression": { "argumentTypes": null, "hexValue": "30", "id": 2650, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "558:1:8", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "functionReturnParameters": 2646, "id": 2651, "nodeType": "Return", "src": "551:8:8" } ] } }, { "assignments": [ 2655 ], "declarations": [ { "constant": false, "id": 2655, "name": "c", "nodeType": "VariableDeclaration", "scope": 2670, "src": "580:9:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2654, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "580:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 2659, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2658, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2656, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2640, "src": "592:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "argumentTypes": null, "id": 2657, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2642, "src": "596:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "592:5:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "580:17:8" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2665, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2663, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2661, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2655, "src": "615:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "argumentTypes": null, "id": 2662, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2640, "src": "619:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "615:5:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "id": 2664, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2642, "src": "624:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "615:10:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 2660, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 3292, 3293 ], "referencedDeclaration": 3292, "src": "607:7:8", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 2666, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "607:19:8", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2667, "nodeType": "ExpressionStatement", "src": "607:19:8" }, { "expression": { "argumentTypes": null, "id": 2668, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2655, "src": "644:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 2646, "id": 2669, "nodeType": "Return", "src": "637:8:8" } ] }, "documentation": "@dev Multiplies two unsigned integers, reverts on overflow.", "id": 2671, "implemented": true, "kind": "function", "modifiers": [], "name": "mul", "nodeType": "FunctionDefinition", "parameters": { "id": 2643, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2640, "name": "a", "nodeType": "VariableDeclaration", "scope": 2671, "src": "244:9:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2639, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "244:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2642, "name": "b", "nodeType": "VariableDeclaration", "scope": 2671, "src": "255:9:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2641, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "255:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "243:22:8" }, "returnParameters": { "id": 2646, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2645, "name": "", "nodeType": "VariableDeclaration", "scope": 2671, "src": "289:7:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2644, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "289:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "288:9:8" }, "scope": 2764, "src": "231:421:8", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 2694, "nodeType": "Block", "src": "849:229:8", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2683, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2681, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2675, "src": "933:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 2682, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "937:1:8", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "933:5:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 2680, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 3292, 3293 ], "referencedDeclaration": 3292, "src": "925:7:8", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 2684, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "925:14:8", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2685, "nodeType": "ExpressionStatement", "src": "925:14:8" }, { "assignments": [ 2687 ], "declarations": [ { "constant": false, "id": 2687, "name": "c", "nodeType": "VariableDeclaration", "scope": 2694, "src": "949:9:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2686, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "949:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 2691, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2690, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2688, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2673, "src": "961:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "argumentTypes": null, "id": 2689, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2675, "src": "965:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "961:5:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "949:17:8" }, { "expression": { "argumentTypes": null, "id": 2692, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2687, "src": "1070:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 2679, "id": 2693, "nodeType": "Return", "src": "1063:8:8" } ] }, "documentation": "@dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.", "id": 2695, "implemented": true, "kind": "function", "modifiers": [], "name": "div", "nodeType": "FunctionDefinition", "parameters": { "id": 2676, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2673, "name": "a", "nodeType": "VariableDeclaration", "scope": 2695, "src": "795:9:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2672, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "795:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2675, "name": "b", "nodeType": "VariableDeclaration", "scope": 2695, "src": "806:9:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2674, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "806:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "794:22:8" }, "returnParameters": { "id": 2679, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2678, "name": "", "nodeType": "VariableDeclaration", "scope": 2695, "src": "840:7:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2677, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "840:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "839:9:8" }, "scope": 2764, "src": "782:296:8", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 2718, "nodeType": "Block", "src": "1278:78:8", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2707, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2705, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2699, "src": "1296:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "<=", "rightExpression": { "argumentTypes": null, "id": 2706, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2697, "src": "1301:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1296:6:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 2704, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 3292, 3293 ], "referencedDeclaration": 3292, "src": "1288:7:8", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 2708, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1288:15:8", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2709, "nodeType": "ExpressionStatement", "src": "1288:15:8" }, { "assignments": [ 2711 ], "declarations": [ { "constant": false, "id": 2711, "name": "c", "nodeType": "VariableDeclaration", "scope": 2718, "src": "1313:9:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2710, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1313:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 2715, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2714, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2712, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2697, "src": "1325:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": { "argumentTypes": null, "id": 2713, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2699, "src": "1329:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1325:5:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "1313:17:8" }, { "expression": { "argumentTypes": null, "id": 2716, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2711, "src": "1348:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 2703, "id": 2717, "nodeType": "Return", "src": "1341:8:8" } ] }, "documentation": "@dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).", "id": 2719, "implemented": true, "kind": "function", "modifiers": [], "name": "sub", "nodeType": "FunctionDefinition", "parameters": { "id": 2700, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2697, "name": "a", "nodeType": "VariableDeclaration", "scope": 2719, "src": "1224:9:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2696, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1224:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2699, "name": "b", "nodeType": "VariableDeclaration", "scope": 2719, "src": "1235:9:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2698, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1235:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1223:22:8" }, "returnParameters": { "id": 2703, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2702, "name": "", "nodeType": "VariableDeclaration", "scope": 2719, "src": "1269:7:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2701, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1269:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1268:9:8" }, "scope": 2764, "src": "1211:145:8", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 2742, "nodeType": "Block", "src": "1506:78:8", "statements": [ { "assignments": [ 2729 ], "declarations": [ { "constant": false, "id": 2729, "name": "c", "nodeType": "VariableDeclaration", "scope": 2742, "src": "1516:9:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2728, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1516:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 2733, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2732, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2730, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2721, "src": "1528:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "argumentTypes": null, "id": 2731, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2723, "src": "1532:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1528:5:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "1516:17:8" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2737, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2735, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2729, "src": "1551:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "argumentTypes": null, "id": 2736, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2721, "src": "1556:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1551:6:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 2734, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 3292, 3293 ], "referencedDeclaration": 3292, "src": "1543:7:8", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 2738, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1543:15:8", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2739, "nodeType": "ExpressionStatement", "src": "1543:15:8" }, { "expression": { "argumentTypes": null, "id": 2740, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2729, "src": "1576:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 2727, "id": 2741, "nodeType": "Return", "src": "1569:8:8" } ] }, "documentation": "@dev Adds two unsigned integers, reverts on overflow.", "id": 2743, "implemented": true, "kind": "function", "modifiers": [], "name": "add", "nodeType": "FunctionDefinition", "parameters": { "id": 2724, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2721, "name": "a", "nodeType": "VariableDeclaration", "scope": 2743, "src": "1452:9:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2720, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1452:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2723, "name": "b", "nodeType": "VariableDeclaration", "scope": 2743, "src": "1463:9:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2722, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1463:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1451:22:8" }, "returnParameters": { "id": 2727, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2726, "name": "", "nodeType": "VariableDeclaration", "scope": 2743, "src": "1497:7:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2725, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1497:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1496:9:8" }, "scope": 2764, "src": "1439:145:8", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 2762, "nodeType": "Block", "src": "1806:54:8", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2755, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2753, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2747, "src": "1824:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 2754, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1829:1:8", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "1824:6:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 2752, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 3292, 3293 ], "referencedDeclaration": 3292, "src": "1816:7:8", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 2756, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1816:15:8", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2757, "nodeType": "ExpressionStatement", "src": "1816:15:8" }, { "expression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2760, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2758, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2745, "src": "1848:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "%", "rightExpression": { "argumentTypes": null, "id": 2759, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2747, "src": "1852:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1848:5:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 2751, "id": 2761, "nodeType": "Return", "src": "1841:12:8" } ] }, "documentation": "@dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),\nreverts when dividing by zero.", "id": 2763, "implemented": true, "kind": "function", "modifiers": [], "name": "mod", "nodeType": "FunctionDefinition", "parameters": { "id": 2748, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2745, "name": "a", "nodeType": "VariableDeclaration", "scope": 2763, "src": "1752:9:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2744, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1752:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2747, "name": "b", "nodeType": "VariableDeclaration", "scope": 2763, "src": "1763:9:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2746, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1763:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1751:22:8" }, "returnParameters": { "id": 2751, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2750, "name": "", "nodeType": "VariableDeclaration", "scope": 2763, "src": "1797:7:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2749, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1797:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1796:9:8" }, "scope": 2764, "src": "1739:121:8", "stateMutability": "pure", "superFunction": null, "visibility": "internal" } ], "scope": 2765, "src": "125:1737:8" } ], "src": "0:1863:8" }, "compiler": { "name": "solc", "version": "0.5.2+commit.1df8f40c.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.0.5", "updatedAt": "2019-06-04T10:01:11.424Z", "devdoc": { "details": "Unsigned math operations with safety checks that revert on error", "methods": {}, "title": "SafeMath" }, "userdoc": { "methods": {} } }