UNPKG

@gooddollar/goodcontracts

Version:
1,093 lines (1,092 loc) 340 kB
{ "contractName": "DSMath", "abi": [], "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/DSMath.sol\":\"DSMath\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/DSMath.sol\":{\"keccak256\":\"0x59fb5b1c4c3f68c1694f6ff5698016ac8ee9401b61e87473113dc103b7a6b0ff\",\"urls\":[\"bzz-raw://7410f43989dea44e64bed870958ce9199606dd8a9783e79fe8deca7b544164af\",\"dweb:/ipfs/QmPrrdvp2ErwL6SJSveB3JANo7ivadSMnk9gpWZD8nR7hy\"]}},\"version\":1}", "bytecode": "0x6080604052348015600f57600080fd5b50603e80601d6000396000f3fe6080604052600080fdfea265627a7a723158202ce60635a432509575a6297ecde79747d0469f891ac6520af0da605e6b8a0b6664736f6c63430005100032", "deployedBytecode": "0x6080604052600080fdfea265627a7a723158202ce60635a432509575a6297ecde79747d0469f891ac6520af0da605e6b8a0b6664736f6c63430005100032", "sourceMap": "722:2296:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;722:2296:0;;;;;;;", "deployedSourceMap": "722:2296:0:-;;;;;", "source": "/// math.sol -- mixin for inline numerical wizardry\n\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see <http://www.gnu.org/licenses/>.\n\npragma solidity >0.4.13;\n\ncontract DSMath {\n function add(uint256 x, uint256 y) internal pure returns (uint256 z) {\n require((z = x + y) >= x, \"ds-math-add-overflow\");\n }\n function sub(uint256 x, uint256 y) internal pure returns (uint256 z) {\n require((z = x - y) <= x, \"ds-math-sub-underflow\");\n }\n function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n require(y == 0 || (z = x * y) / y == x, \"ds-math-mul-overflow\");\n }\n\n function min(uint256 x, uint256 y) internal pure returns (uint256 z) {\n return x <= y ? x : y;\n }\n function max(uint256 x, uint256 y) internal pure returns (uint256 z) {\n return x >= y ? x : y;\n }\n function imin(int256 x, int256 y) internal pure returns (int256 z) {\n return x <= y ? x : y;\n }\n function imax(int256 x, int256 y) internal pure returns (int256 z) {\n return x >= y ? x : y;\n }\n\n uint256 constant WAD = 10**18;\n uint256 constant RAY = 10**27;\n\n function wmul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n z = add(mul(x, y), WAD / 2) / WAD;\n }\n function rmul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n z = add(mul(x, y), RAY / 2) / RAY;\n }\n function wdiv(uint256 x, uint256 y) internal pure returns (uint256 z) {\n z = add(mul(x, WAD), y / 2) / y;\n }\n function rdiv(uint256 x, uint256 y) internal pure returns (uint256 z) {\n z = add(mul(x, RAY), y / 2) / y;\n }\n\n // This famous algorithm is called \"exponentiation by squaring\"\n // and calculates x^n with x as fixed-point and n as regular unsigned.\n //\n // It's O(log n), instead of O(n) for naive repeated multiplication.\n //\n // These facts are why it works:\n //\n // If n is even, then x^n = (x^2)^(n/2).\n // If n is odd, then x^n = x * x^(n-1),\n // and applying the equation for even x gives\n // x^n = x * (x^2)^((n-1) / 2).\n //\n // Also, EVM division is flooring and\n // floor[(n-1) / 2] = floor[n / 2].\n //\n function rpow(uint256 x, uint256 n) internal pure returns (uint256 z) {\n z = n % 2 != 0 ? x : RAY;\n\n for (n /= 2; n != 0; n /= 2) {\n x = rmul(x, x);\n\n if (n % 2 != 0) {\n z = rmul(z, x);\n }\n }\n }\n}\n", "sourcePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/DSMath.sol", "ast": { "absolutePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/DSMath.sol", "exportedSymbols": { "DSMath": [ 303 ] }, "id": 304, "nodeType": "SourceUnit", "nodes": [ { "id": 1, "literals": [ "solidity", ">", "0.4", ".13" ], "nodeType": "PragmaDirective", "src": "696:24:0" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 303, "linearizedBaseContracts": [ 303 ], "name": "DSMath", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 22, "nodeType": "Block", "src": "813:66:0", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 18, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "components": [ { "argumentTypes": null, "id": 15, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 11, "name": "z", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8, "src": "832:1:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 14, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 12, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3, "src": "836:1:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "argumentTypes": null, "id": 13, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5, "src": "840:1:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "836:5:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "832:9:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "id": 16, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "831:11:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "argumentTypes": null, "id": 17, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3, "src": "846:1:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "831:16:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "64732d6d6174682d6164642d6f766572666c6f77", "id": 19, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "849:22:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_3903056b84ed2aba2be78662dc6c5c99b160cebe9af9bd9493d0fc28ff16f6db", "typeString": "literal_string \"ds-math-add-overflow\"" }, "value": "ds-math-add-overflow" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_3903056b84ed2aba2be78662dc6c5c99b160cebe9af9bd9493d0fc28ff16f6db", "typeString": "literal_string \"ds-math-add-overflow\"" } ], "id": 10, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 22174, 22175 ], "referencedDeclaration": 22175, "src": "823:7:0", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 20, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "823:49:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 21, "nodeType": "ExpressionStatement", "src": "823:49:0" } ] }, "documentation": null, "id": 23, "implemented": true, "kind": "function", "modifiers": [], "name": "add", "nodeType": "FunctionDefinition", "parameters": { "id": 6, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 3, "name": "x", "nodeType": "VariableDeclaration", "scope": 23, "src": "757:9:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "757:7:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5, "name": "y", "nodeType": "VariableDeclaration", "scope": 23, "src": "768:9:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 4, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "768:7:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "756:22:0" }, "returnParameters": { "id": 9, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 8, "name": "z", "nodeType": "VariableDeclaration", "scope": 23, "src": "802:9:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 7, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "802:7:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "801:11:0" }, "scope": 303, "src": "744:135:0", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 44, "nodeType": "Block", "src": "953:67:0", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 40, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "components": [ { "argumentTypes": null, "id": 37, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 33, "name": "z", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 30, "src": "972:1:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 36, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 34, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 25, "src": "976:1:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": { "argumentTypes": null, "id": 35, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 27, "src": "980:1:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "976:5:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "972:9:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "id": 38, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "971:11:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "<=", "rightExpression": { "argumentTypes": null, "id": 39, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 25, "src": "986:1:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "971:16:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "64732d6d6174682d7375622d756e646572666c6f77", "id": 41, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "989:23:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_03b20b9f6e6e7905f077509fd420fb44afc685f254bcefe49147296e1ba25590", "typeString": "literal_string \"ds-math-sub-underflow\"" }, "value": "ds-math-sub-underflow" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_03b20b9f6e6e7905f077509fd420fb44afc685f254bcefe49147296e1ba25590", "typeString": "literal_string \"ds-math-sub-underflow\"" } ], "id": 32, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 22174, 22175 ], "referencedDeclaration": 22175, "src": "963:7:0", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 42, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "963:50:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 43, "nodeType": "ExpressionStatement", "src": "963:50:0" } ] }, "documentation": null, "id": 45, "implemented": true, "kind": "function", "modifiers": [], "name": "sub", "nodeType": "FunctionDefinition", "parameters": { "id": 28, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 25, "name": "x", "nodeType": "VariableDeclaration", "scope": 45, "src": "897:9:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 24, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "897:7:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 27, "name": "y", "nodeType": "VariableDeclaration", "scope": 45, "src": "908:9:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 26, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "908:7:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "896:22:0" }, "returnParameters": { "id": 31, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 30, "name": "z", "nodeType": "VariableDeclaration", "scope": 45, "src": "942:9:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 29, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "942:7:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "941:11:0" }, "scope": 303, "src": "884:136:0", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 72, "nodeType": "Block", "src": "1094:80:0", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_bool", "typeString": "bool" }, "id": 68, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 57, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 55, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 49, "src": "1112:1:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 56, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1117:1:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "1112:6:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "BinaryOperation", "operator": "||", "rightExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 67, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 65, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "components": [ { "argumentTypes": null, "id": 62, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 58, "name": "z", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 52, "src": "1123:1:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 61, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 59, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 47, "src": "1127:1:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "argumentTypes": null, "id": 60, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 49, "src": "1131:1:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1127:5:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1123:9:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "id": 63, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "1122:11:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "argumentTypes": null, "id": 64, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 49, "src": "1136:1:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1122:15:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "id": 66, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 47, "src": "1141:1:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1122:20:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "src": "1112:30:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "64732d6d6174682d6d756c2d6f766572666c6f77", "id": 69, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1144:22:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_25a0ef6406c6af6852555433653ce478274cd9f03a5dec44d001868a76b3bfdd", "typeString": "literal_string \"ds-math-mul-overflow\"" }, "value": "ds-math-mul-overflow" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_25a0ef6406c6af6852555433653ce478274cd9f03a5dec44d001868a76b3bfdd", "typeString": "literal_string \"ds-math-mul-overflow\"" } ], "id": 54, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 22174, 22175 ], "referencedDeclaration": 22175, "src": "1104:7:0", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 70, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1104:63:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 71, "nodeType": "ExpressionStatement", "src": "1104:63:0" } ] }, "documentation": null, "id": 73, "implemented": true, "kind": "function", "modifiers": [], "name": "mul", "nodeType": "FunctionDefinition", "parameters": { "id": 50, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 47, "name": "x", "nodeType": "VariableDeclaration", "scope": 73, "src": "1038:9:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 46, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1038:7:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 49, "name": "y", "nodeType": "VariableDeclaration", "scope": 73, "src": "1049:9:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 48, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1049:7:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1037:22:0" }, "returnParameters": { "id": 53, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 52, "name": "z", "nodeType": "VariableDeclaration", "scope": 73, "src": "1083:9:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 51, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1083:7:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "1082:11:0" }, "scope": 303, "src": "1025:149:0", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 89, "nodeType": "Block", "src": "1249:38:0", "statements": [ { "expression": { "argumentTypes": null, "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 84, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 82, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 75, "src": "1266:1:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "<=", "rightExpression": { "argumentTypes": null, "id": 83, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 77, "src": "1271:1:0", "typeDescriptions": {