{ "contractName": "SafeMath", "abi": [], "metadata": "{\"compiler\":{\"version\":\"0.6.9+commit.3e3065ac\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"author\":\"DODO Breeder\",\"methods\":{},\"title\":\"SafeMath\"},\"userdoc\":{\"methods\":{},\"notice\":\"Math operations with safety checks that revert on error\"}},\"settings\":{\"compilationTarget\":{\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/SafeMath.sol\":\"SafeMath\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/SafeMath.sol\":{\"keccak256\":\"0x57d750628881687f826b54f60cbfd46c1a172433eed892bbb123f91869886af1\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://b40bd7946010ddae9679f36630510217dcaa9cb8643824f9edc8ef52bda95717\",\"dweb:/ipfs/QmZSjpfUGyrmokZyaMc74a8h6zy2qFVECPVP8VfTvzNEFb\"]}},\"version\":1}", "bytecode": "0x60566023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212204f99a1a380d3a07e18cd342849bc4d71903ab299005ff70b898034a0decf695864736f6c63430006090033", "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212204f99a1a380d3a07e18cd342849bc4d71903ab299005ff70b898034a0decf695864736f6c63430006090033", "immutableReferences": {}, "sourceMap": "258:1179:41:-:0;;;;;;;;;;;;;;;;;;;;;;;;;", "deployedSourceMap": "258:1179:41:-:0;;;;;;;;", "source": "/*\n\n Copyright 2020 DODO ZOO.\n SPDX-License-Identifier: Apache-2.0\n\n*/\n\npragma solidity 0.6.9;\npragma experimental ABIEncoderV2;\n\n\n/**\n * @title SafeMath\n * @author DODO Breeder\n *\n * @notice Math operations with safety checks that revert on error\n */\nlibrary SafeMath {\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n uint256 c = a * b;\n require(c / a == b, \"MUL_ERROR\");\n\n return c;\n }\n\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"DIVIDING_ERROR\");\n return a / b;\n }\n\n function divCeil(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 quotient = div(a, b);\n uint256 remainder = a - quotient * b;\n if (remainder > 0) {\n return quotient + 1;\n } else {\n return quotient;\n }\n }\n\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a, \"SUB_ERROR\");\n return a - b;\n }\n\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, \"ADD_ERROR\");\n return c;\n }\n\n function sqrt(uint256 x) internal pure returns (uint256 y) {\n uint256 z = x / 2 + 1;\n y = x;\n while (z < y) {\n y = z;\n z = (x / z + z) / 2;\n }\n }\n}\n", "sourcePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/SafeMath.sol", "ast": { "absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/SafeMath.sol", "exportedSymbols": { "SafeMath": [ 11623 ] }, "id": 11624, "license": "Apache-2.0", "nodeType": "SourceUnit", "nodes": [ { "id": 11442, "literals": [ "solidity", "0.6", ".9" ], "nodeType": "PragmaDirective", "src": "78:22:41" }, { "id": 11443, "literals": [ "experimental", "ABIEncoderV2" ], "nodeType": "PragmaDirective", "src": "101:33:41" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "library", "documentation": { "id": 11444, "nodeType": "StructuredDocumentation", "src": "137:120:41", "text": " @title SafeMath\n @author DODO Breeder\n @notice Math operations with safety checks that revert on error" }, "fullyImplemented": true, "id": 11623, "linearizedBaseContracts": [ 11623 ], "name": "SafeMath", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 11477, "nodeType": "Block", "src": "348:150:41", "statements": [ { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11455, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11453, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11446, "src": "362:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 11454, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "367:1:41", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "362:6:41", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 11459, "nodeType": "IfStatement", "src": "358:45:41", "trueBody": { "id": 11458, "nodeType": "Block", "src": "370:33:41", "statements": [ { "expression": { "argumentTypes": null, "hexValue": "30", "id": 11456, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "391:1:41", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "functionReturnParameters": 11452, "id": 11457, "nodeType": "Return", "src": "384:8:41" } ] } }, { "assignments": [ 11461 ], "declarations": [ { "constant": false, "id": 11461, "mutability": "mutable", "name": "c", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11477, "src": "413:9:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11460, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "413:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 11465, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11464, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11462, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11446, "src": "425:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "argumentTypes": null, "id": 11463, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11448, "src": "429:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "425:5:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "413:17:41" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11471, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11469, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11467, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11461, "src": "448:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "argumentTypes": null, "id": 11468, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11446, "src": "452:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "448:5:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "id": 11470, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11448, "src": "457:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "448:10:41", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "4d554c5f4552524f52", "id": 11472, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "460:11:41", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_f15de75b890fc71862dae54a774d957f0461cb8f954cec0f22848d646e50110f", "typeString": "literal_string \"MUL_ERROR\"" }, "value": "MUL_ERROR" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_f15de75b890fc71862dae54a774d957f0461cb8f954cec0f22848d646e50110f", "typeString": "literal_string \"MUL_ERROR\"" } ], "id": 11466, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ -18, -18 ], "referencedDeclaration": -18, "src": "440:7:41", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 11473, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "440:32:41", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 11474, "nodeType": "ExpressionStatement", "src": "440:32:41" }, { "expression": { "argumentTypes": null, "id": 11475, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11461, "src": "490:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 11452, "id": 11476, "nodeType": "Return", "src": "483:8:41" } ] }, "documentation": null, "id": 11478, "implemented": true, "kind": "function", "modifiers": [], "name": "mul", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 11449, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 11446, "mutability": "mutable", "name": "a", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11478, "src": "294:9:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11445, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "294:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 11448, "mutability": "mutable", "name": "b", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11478, "src": "305:9:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11447, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "305:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "293:22:41" }, "returnParameters": { "id": 11452, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 11451, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11478, "src": "339:7:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11450, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "339:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "338:9:41" }, "scope": 11623, "src": "281:217:41", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 11498, "nodeType": "Block", "src": "571:71:41", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11490, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11488, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11482, "src": "589:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 11489, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "593:1:41", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "589:5:41", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "4449564944494e475f4552524f52", "id": 11491, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "596:16:41", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_583be15a4a9aee3ef6d29bfba17fb7fe394ac90caa4352e8a6c1e95a37366a64", "typeString": "literal_string \"DIVIDING_ERROR\"" }, "value": "DIVIDING_ERROR" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_583be15a4a9aee3ef6d29bfba17fb7fe394ac90caa4352e8a6c1e95a37366a64", "typeString": "literal_string \"DIVIDING_ERROR\"" } ], "id": 11487, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ -18, -18 ], "referencedDeclaration": -18, "src": "581:7:41", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 11492, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "581:32:41", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 11493, "nodeType": "ExpressionStatement", "src": "581:32:41" }, { "expression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11496, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11494, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11480, "src": "630:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "argumentTypes": null, "id": 11495, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11482, "src": "634:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "630:5:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 11486, "id": 11497, "nodeType": "Return", "src": "623:12:41" } ] }, "documentation": null, "id": 11499, "implemented": true, "kind": "function", "modifiers": [], "name": "div", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 11483, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 11480, "mutability": "mutable", "name": "a", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11499, "src": "517:9:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11479, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "517:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 11482, "mutability": "mutable", "name": "b", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11499, "src": "528:9:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11481, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "528:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "516:22:41" }, "returnParameters": { "id": 11486, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 11485, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11499, "src": "562:7:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11484, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "562:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "561:9:41" }, "scope": 11623, "src": "504:138:41", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 11535, "nodeType": "Block", "src": "719:209:41", "statements": [ { "assignments": [ 11509 ], "declarations": [ { "constant": false, "id": 11509, "mutability": "mutable", "name": "quotient", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11535, "src": "729:16:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11508, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "729:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 11514, "initialValue": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 11511, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11501, "src": "752:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "id": 11512, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11503, "src": "755:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 11510, "name": "div", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11499, "src": "748:3:41", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", "typeString": "function (uint256,uint256) pure returns (uint256)" } }, "id": 11513, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "748:9:41", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "729:28:41" }, { "assignments": [ 11516 ], "declarations": [ { "constant": false, "id": 11516, "mutability": "mutable", "name": "remainder", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11535, "src": "767:17:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11515, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "767:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 11522, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11521, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11517, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11501, "src": "787:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11520, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11518, "name": "quotient", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11509, "src": "791:8:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "argumentTypes": null, "id": 11519, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11503, "src": "802:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "791:12:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "787:16:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "767:36:41" }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11525, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11523, "name": "remainder", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11516, "src": "817:9:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 11524, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "829:1:41", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "817:13:41", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": { "id": 11533, "nodeType": "Block", "src": "882:40:41", "statements": [ { "expression": { "argumentTypes": null, "id": 11531, "name": "quotient", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11509, "src": "903:8:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 11507, "id": 11532, "nodeType": "Return", "src": "896:15:41" } ] }, "id": 11534, "nodeType": "IfStatement", "src": "813:109:41", "trueBody": { "id": 11530, "nodeType": "Block", "src": "832:44:41", "statements": [ { "expression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11528, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11526, "name": "quotient", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11509, "src": "853:8:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "argumentTypes": null, "hexValue": "31", "id": 11527, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "864:1:41", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "853:12:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 11507, "id": 11529, "nodeType": "Return", "src": "846:19:41" } ] } } ] }, "documentation": null, "id": 11536, "implemented": true, "kind": "function", "modifiers": [], "name": "divCeil", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 11504, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 11501, "mutability": "mutable", "name": "a", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11536, "src": "665:9:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11500, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "665:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 11503, "mutability": "mutable", "name": "b", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11536, "src": "676:9:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11502, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "676:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "664:22:41" }, "returnParameters": { "id": 11507, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 11506, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11536, "src": "710:7:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11505, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "710:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "709:9:41" }, "scope": 11623, "src": "648:280:41", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 11556, "nodeType": "Block", "src": "1001:67:41", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11548, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11546, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11540, "src": "1019:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "<=", "rightExpression": { "argumentTypes": null, "id": 11547, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11538, "src": "1024:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1019:6:41", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "5355425f4552524f52", "id": 11549, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1027:11:41", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_8c20885bc87603b27150b555979fd4ced812adaa007c9ca583e7fb0ad94e1fb1", "typeString": "literal_string \"SUB_ERROR\"" }, "value": "SUB_ERROR" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_8c20885bc87603b27150b555979fd4ced812adaa007c9ca583e7fb0ad94e1fb1", "typeString": "literal_string \"SUB_ERROR\"" } ], "id": 11545, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ -18, -18 ], "referencedDeclaration": -18, "src": "1011:7:41", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 11550, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1011:28:41", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 11551, "nodeType": "ExpressionStatement", "src": "1011:28:41" }, { "expression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11554, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11552, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11538, "src": "1056:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": { "argumentTypes": null, "id": 11553, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11540, "src": "1060:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1056:5:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 11544, "id": 11555, "nodeType": "Return", "src": "1049:12:41" } ] }, "documentation": null, "id": 11557, "implemented": true, "kind": "function", "modifiers": [], "name": "sub", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 11541, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 11538, "mutability": "mutable", "name": "a", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11557, "src": "947:9:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11537, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "947:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 11540, "mutability": "mutable", "name": "b", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11557, "src": "958:9:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11539, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "958:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "946:22:41" }, "returnParameters": { "id": 11544, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 11543, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11557, "src": "992:7:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11542, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "992:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "991:9:41" }, "scope": 11623, "src": "934:134:41", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 11581, "nodeType": "Block", "src": "1141:90:41", "statements": [ { "assignments": [ 11567 ], "declarations": [ { "constant": false, "id": 11567, "mutability": "mutable", "name": "c", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11581, "src": "1151:9:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11566, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1151:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 11571, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11570, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11568, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11559, "src": "1163:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "argumentTypes": null, "id": 11569, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11561, "src": "1167:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1163:5:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "1151:17:41" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11575, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11573, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11567, "src": "1186:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "argumentTypes": null, "id": 11574, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11559, "src": "1191:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1186:6:41", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "4144445f4552524f52", "id": 11576, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1194:11:41", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_db5ce4bdd57c365768e4ced49819a8b22d9737a9a1f0821626d5d162f0c4f58b", "typeString": "literal_string \"ADD_ERROR\"" }, "value": "ADD_ERROR" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_db5ce4bdd57c365768e4ced49819a8b22d9737a9a1f0821626d5d162f0c4f58b", "typeString": "literal_string \"ADD_ERROR\"" } ], "id": 11572, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ -18, -18 ], "referencedDeclaration": -18, "src": "1178:7:41", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 11577, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1178:28:41", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 11578, "nodeType": "ExpressionStatement", "src": "1178:28:41" }, { "expression": { "argumentTypes": null, "id": 11579, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11567, "src": "1223:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 11565, "id": 11580, "nodeType": "Return", "src": "1216:8:41" } ] }, "documentation": null, "id": 11582, "implemented": true, "kind": "function", "modifiers": [], "name": "add", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 11562, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 11559, "mutability": "mutable", "name": "a", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11582, "src": "1087:9:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11558, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1087:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 11561, "mutability": "mutable", "name": "b", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11582, "src": "1098:9:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11560, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1098:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1086:22:41" }, "returnParameters": { "id": 11565, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 11564, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11582, "src": "1132:7:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11563, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1132:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1131:9:41" }, "scope": 11623, "src": "1074:157:41", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 11621, "nodeType": "Block", "src": "1296:139:41", "statements": [ { "assignments": [ 11590 ], "declarations": [ { "constant": false, "id": 11590, "mutability": "mutable", "name": "z", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11621, "src": "1306:9:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11589, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1306:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 11596, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11595, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11593, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11591, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11584, "src": "1318:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "argumentTypes": null, "hexValue": "32", "id": 11592, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1322:1:41", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2" }, "value": "2" }, "src": "1318:5:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "argumentTypes": null, "hexValue": "31", "id": 11594, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1326:1:41", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "1318:9:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "1306:21:41" }, { "expression": { "argumentTypes": null, "id": 11599, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 11597, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11587, "src": "1337:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 11598, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11584, "src": "1341:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1337:5:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 11600, "nodeType": "ExpressionStatement", "src": "1337:5:41" }, { "body": { "id": 11619, "nodeType": "Block", "src": "1366:63:41", "statements": [ { "expression": { "argumentTypes": null, "id": 11606, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 11604, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11587, "src": "1380:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 11605, "name": "z", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11590, "src": "1384:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1380:5:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 11607, "nodeType": "ExpressionStatement", "src": "1380:5:41" }, { "expression": { "argumentTypes": null, "id": 11617, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 11608, "name": "z", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11590, "src": "1399:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11616, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "components": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11613, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11611, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11609, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11584, "src": "1404:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "argumentTypes": null, "id": 11610, "name": "z", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11590, "src": "1408:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1404:5:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "argumentTypes": null, "id": 11612, "name": "z", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11590, "src": "1412:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1404:9:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "id": 11614, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "1403:11:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "argumentTypes": null, "hexValue": "32", "id": 11615, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1417:1:41", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2" }, "value": "2" }, "src": "1403:15:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1399:19:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 11618, "nodeType": "ExpressionStatement", "src": "1399:19:41" } ] }, "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11603, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11601, "name": "z", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11590, "src": "1359:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "<", "rightExpression": { "argumentTypes": null, "id": 11602, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11587, "src": "1363:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1359:5:41", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 11620, "nodeType": "WhileStatement", "src": "1352:77:41" } ] }, "documentation": null, "id": 11622, "implemented": true, "kind": "function", "modifiers": [], "name": "sqrt", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 11585, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 11584, "mutability": "mutable", "name": "x", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11622, "src": "1251:9:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11583, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1251:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1250:11:41" }, "returnParameters": { "id": 11588, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 11587, "mutability": "mutable", "name": "y", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11622, "src": "1285:9:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11586, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1285:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1284:11:41" }, "scope": 11623, "src": "1237:198:41", "stateMutability": "pure", "virtual": false, "visibility": "internal" } ], "scope": 11624, "src": "258:1179:41" } ], "src": "78:1360:41" }, "legacyAST": { "absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/SafeMath.sol", "exportedSymbols": { "SafeMath": [ 11623 ] }, "id": 11624, "license": "Apache-2.0", "nodeType": "SourceUnit", "nodes": [ { "id": 11442, "literals": [ "solidity", "0.6", ".9" ], "nodeType": "PragmaDirective", "src": "78:22:41" }, { "id": 11443, "literals": [ "experimental", "ABIEncoderV2" ], "nodeType": "PragmaDirective", "src": "101:33:41" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "library", "documentation": { "id": 11444, "nodeType": "StructuredDocumentation", "src": "137:120:41", "text": " @title SafeMath\n @author DODO Breeder\n @notice Math operations with safety checks that revert on error" }, "fullyImplemented": true, "id": 11623, "linearizedBaseContracts": [ 11623 ], "name": "SafeMath", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 11477, "nodeType": "Block", "src": "348:150:41", "statements": [ { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11455, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11453, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11446, "src": "362:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 11454, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "367:1:41", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "362:6:41", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 11459, "nodeType": "IfStatement", "src": "358:45:41", "trueBody": { "id": 11458, "nodeType": "Block", "src": "370:33:41", "statements": [ { "expression": { "argumentTypes": null, "hexValue": "30", "id": 11456, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "391:1:41", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "functionReturnParameters": 11452, "id": 11457, "nodeType": "Return", "src": "384:8:41" } ] } }, { "assignments": [ 11461 ], "declarations": [ { "constant": false, "id": 11461, "mutability": "mutable", "name": "c", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11477, "src": "413:9:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11460, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "413:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 11465, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11464, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11462, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11446, "src": "425:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "argumentTypes": null, "id": 11463, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11448, "src": "429:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "425:5:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "413:17:41" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11471, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11469, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11467, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11461, "src": "448:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "argumentTypes": null, "id": 11468, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11446, "src": "452:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "448:5:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "id": 11470, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11448, "src": "457:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "448:10:41", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "4d554c5f4552524f52", "id": 11472, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "460:11:41", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_f15de75b890fc71862dae54a774d957f0461cb8f954cec0f22848d646e50110f", "typeString": "literal_string \"MUL_ERROR\"" }, "value": "MUL_ERROR" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_f15de75b890fc71862dae54a774d957f0461cb8f954cec0f22848d646e50110f", "typeString": "literal_string \"MUL_ERROR\"" } ], "id": 11466, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ -18, -18 ], "referencedDeclaration": -18, "src": "440:7:41", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 11473, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "440:32:41", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 11474, "nodeType": "ExpressionStatement", "src": "440:32:41" }, { "expression": { "argumentTypes": null, "id": 11475, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11461, "src": "490:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 11452, "id": 11476, "nodeType": "Return", "src": "483:8:41" } ] }, "documentation": null, "id": 11478, "implemented": true, "kind": "function", "modifiers": [], "name": "mul", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 11449, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 11446, "mutability": "mutable", "name": "a", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11478, "src": "294:9:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11445, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "294:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 11448, "mutability": "mutable", "name": "b", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11478, "src": "305:9:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11447, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "305:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "293:22:41" }, "returnParameters": { "id": 11452, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 11451, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11478, "src": "339:7:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11450, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "339:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "338:9:41" }, "scope": 11623, "src": "281:217:41", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 11498, "nodeType": "Block", "src": "571:71:41", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11490, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11488, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11482, "src": "589:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 11489, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "593:1:41", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "589:5:41", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "4449564944494e475f4552524f52", "id": 11491, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "596:16:41", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_583be15a4a9aee3ef6d29bfba17fb7fe394ac90caa4352e8a6c1e95a37366a64", "typeString": "literal_string \"DIVIDING_ERROR\"" }, "value": "DIVIDING_ERROR" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_583be15a4a9aee3ef6d29bfba17fb7fe394ac90caa4352e8a6c1e95a37366a64", "typeString": "literal_string \"DIVIDING_ERROR\"" } ], "id": 11487, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ -18, -18 ], "referencedDeclaration": -18, "src": "581:7:41", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 11492, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "581:32:41", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 11493, "nodeType": "ExpressionStatement", "src": "581:32:41" }, { "expression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11496, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11494, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11480, "src": "630:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "argumentTypes": null, "id": 11495, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11482, "src": "634:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "630:5:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 11486, "id": 11497, "nodeType": "Return", "src": "623:12:41" } ] }, "documentation": null, "id": 11499, "implemented": true, "kind": "function", "modifiers": [], "name": "div", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 11483, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 11480, "mutability": "mutable", "name": "a", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11499, "src": "517:9:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11479, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "517:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 11482, "mutability": "mutable", "name": "b", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11499, "src": "528:9:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11481, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "528:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "516:22:41" }, "returnParameters": { "id": 11486, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 11485, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11499, "src": "562:7:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11484, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "562:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "561:9:41" }, "scope": 11623, "src": "504:138:41", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 11535, "nodeType": "Block", "src": "719:209:41", "statements": [ { "assignments": [ 11509 ], "declarations": [ { "constant": false, "id": 11509, "mutability": "mutable", "name": "quotient", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11535, "src": "729:16:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11508, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "729:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 11514, "initialValue": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 11511, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11501, "src": "752:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "id": 11512, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11503, "src": "755:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 11510, "name": "div", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11499, "src": "748:3:41", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", "typeString": "function (uint256,uint256) pure returns (uint256)" } }, "id": 11513, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "748:9:41", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "729:28:41" }, { "assignments": [ 11516 ], "declarations": [ { "constant": false, "id": 11516, "mutability": "mutable", "name": "remainder", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11535, "src": "767:17:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11515, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "767:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 11522, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11521, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11517, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11501, "src": "787:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11520, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11518, "name": "quotient", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11509, "src": "791:8:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "argumentTypes": null, "id": 11519, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11503, "src": "802:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "791:12:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "787:16:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "767:36:41" }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11525, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11523, "name": "remainder", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11516, "src": "817:9:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 11524, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "829:1:41", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "817:13:41", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": { "id": 11533, "nodeType": "Block", "src": "882:40:41", "statements": [ { "expression": { "argumentTypes": null, "id": 11531, "name": "quotient", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11509, "src": "903:8:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 11507, "id": 11532, "nodeType": "Return", "src": "896:15:41" } ] }, "id": 11534, "nodeType": "IfStatement", "src": "813:109:41", "trueBody": { "id": 11530, "nodeType": "Block", "src": "832:44:41", "statements": [ { "expression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11528, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11526, "name": "quotient", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11509, "src": "853:8:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "argumentTypes": null, "hexValue": "31", "id": 11527, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "864:1:41", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "853:12:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 11507, "id": 11529, "nodeType": "Return", "src": "846:19:41" } ] } } ] }, "documentation": null, "id": 11536, "implemented": true, "kind": "function", "modifiers": [], "name": "divCeil", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 11504, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 11501, "mutability": "mutable", "name": "a", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11536, "src": "665:9:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11500, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "665:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 11503, "mutability": "mutable", "name": "b", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11536, "src": "676:9:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11502, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "676:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "664:22:41" }, "returnParameters": { "id": 11507, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 11506, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11536, "src": "710:7:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11505, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "710:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "709:9:41" }, "scope": 11623, "src": "648:280:41", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 11556, "nodeType": "Block", "src": "1001:67:41", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11548, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11546, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11540, "src": "1019:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "<=", "rightExpression": { "argumentTypes": null, "id": 11547, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11538, "src": "1024:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1019:6:41", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "5355425f4552524f52", "id": 11549, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1027:11:41", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_8c20885bc87603b27150b555979fd4ced812adaa007c9ca583e7fb0ad94e1fb1", "typeString": "literal_string \"SUB_ERROR\"" }, "value": "SUB_ERROR" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_8c20885bc87603b27150b555979fd4ced812adaa007c9ca583e7fb0ad94e1fb1", "typeString": "literal_string \"SUB_ERROR\"" } ], "id": 11545, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ -18, -18 ], "referencedDeclaration": -18, "src": "1011:7:41", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 11550, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1011:28:41", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 11551, "nodeType": "ExpressionStatement", "src": "1011:28:41" }, { "expression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11554, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11552, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11538, "src": "1056:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": { "argumentTypes": null, "id": 11553, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11540, "src": "1060:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1056:5:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 11544, "id": 11555, "nodeType": "Return", "src": "1049:12:41" } ] }, "documentation": null, "id": 11557, "implemented": true, "kind": "function", "modifiers": [], "name": "sub", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 11541, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 11538, "mutability": "mutable", "name": "a", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11557, "src": "947:9:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11537, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "947:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 11540, "mutability": "mutable", "name": "b", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11557, "src": "958:9:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11539, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "958:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "946:22:41" }, "returnParameters": { "id": 11544, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 11543, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11557, "src": "992:7:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11542, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "992:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "991:9:41" }, "scope": 11623, "src": "934:134:41", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 11581, "nodeType": "Block", "src": "1141:90:41", "statements": [ { "assignments": [ 11567 ], "declarations": [ { "constant": false, "id": 11567, "mutability": "mutable", "name": "c", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11581, "src": "1151:9:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11566, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1151:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 11571, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11570, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11568, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11559, "src": "1163:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "argumentTypes": null, "id": 11569, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11561, "src": "1167:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1163:5:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "1151:17:41" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11575, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11573, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11567, "src": "1186:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "argumentTypes": null, "id": 11574, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11559, "src": "1191:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1186:6:41", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "4144445f4552524f52", "id": 11576, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1194:11:41", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_db5ce4bdd57c365768e4ced49819a8b22d9737a9a1f0821626d5d162f0c4f58b", "typeString": "literal_string \"ADD_ERROR\"" }, "value": "ADD_ERROR" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_db5ce4bdd57c365768e4ced49819a8b22d9737a9a1f0821626d5d162f0c4f58b", "typeString": "literal_string \"ADD_ERROR\"" } ], "id": 11572, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ -18, -18 ], "referencedDeclaration": -18, "src": "1178:7:41", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 11577, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1178:28:41", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 11578, "nodeType": "ExpressionStatement", "src": "1178:28:41" }, { "expression": { "argumentTypes": null, "id": 11579, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11567, "src": "1223:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 11565, "id": 11580, "nodeType": "Return", "src": "1216:8:41" } ] }, "documentation": null, "id": 11582, "implemented": true, "kind": "function", "modifiers": [], "name": "add", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 11562, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 11559, "mutability": "mutable", "name": "a", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11582, "src": "1087:9:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11558, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1087:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 11561, "mutability": "mutable", "name": "b", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11582, "src": "1098:9:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11560, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1098:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1086:22:41" }, "returnParameters": { "id": 11565, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 11564, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11582, "src": "1132:7:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11563, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1132:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1131:9:41" }, "scope": 11623, "src": "1074:157:41", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 11621, "nodeType": "Block", "src": "1296:139:41", "statements": [ { "assignments": [ 11590 ], "declarations": [ { "constant": false, "id": 11590, "mutability": "mutable", "name": "z", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11621, "src": "1306:9:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11589, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1306:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 11596, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11595, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11593, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11591, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11584, "src": "1318:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "argumentTypes": null, "hexValue": "32", "id": 11592, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1322:1:41", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2" }, "value": "2" }, "src": "1318:5:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "argumentTypes": null, "hexValue": "31", "id": 11594, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1326:1:41", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "1318:9:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "1306:21:41" }, { "expression": { "argumentTypes": null, "id": 11599, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 11597, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11587, "src": "1337:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 11598, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11584, "src": "1341:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1337:5:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 11600, "nodeType": "ExpressionStatement", "src": "1337:5:41" }, { "body": { "id": 11619, "nodeType": "Block", "src": "1366:63:41", "statements": [ { "expression": { "argumentTypes": null, "id": 11606, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 11604, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11587, "src": "1380:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 11605, "name": "z", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11590, "src": "1384:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1380:5:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 11607, "nodeType": "ExpressionStatement", "src": "1380:5:41" }, { "expression": { "argumentTypes": null, "id": 11617, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 11608, "name": "z", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11590, "src": "1399:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11616, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "components": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11613, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11611, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11609, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11584, "src": "1404:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "argumentTypes": null, "id": 11610, "name": "z", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11590, "src": "1408:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1404:5:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "argumentTypes": null, "id": 11612, "name": "z", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11590, "src": "1412:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1404:9:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "id": 11614, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "1403:11:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "argumentTypes": null, "hexValue": "32", "id": 11615, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1417:1:41", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2" }, "value": "2" }, "src": "1403:15:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1399:19:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 11618, "nodeType": "ExpressionStatement", "src": "1399:19:41" } ] }, "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 11603, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11601, "name": "z", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11590, "src": "1359:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "<", "rightExpression": { "argumentTypes": null, "id": 11602, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11587, "src": "1363:1:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1359:5:41", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 11620, "nodeType": "WhileStatement", "src": "1352:77:41" } ] }, "documentation": null, "id": 11622, "implemented": true, "kind": "function", "modifiers": [], "name": "sqrt", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 11585, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 11584, "mutability": "mutable", "name": "x", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11622, "src": "1251:9:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11583, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1251:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1250:11:41" }, "returnParameters": { "id": 11588, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 11587, "mutability": "mutable", "name": "y", "nodeType": "VariableDeclaration", "overrides": null, "scope": 11622, "src": "1285:9:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11586, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1285:7:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1284:11:41" }, "scope": 11623, "src": "1237:198:41", "stateMutability": "pure", "virtual": false, "visibility": "internal" } ], "scope": 11624, "src": "258:1179:41" } ], "src": "78:1360:41" }, "compiler": { "name": "solc", "version": "0.6.9+commit.3e3065ac.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.2.3", "updatedAt": "2020-11-06T08:03:35.623Z", "devdoc": { "author": "DODO Breeder", "methods": {}, "title": "SafeMath" }, "userdoc": { "methods": {}, "notice": "Math operations with safety checks that revert on error" } }