UNPKG

@windfallswap/periphery

Version:

🎚 Peripheral smart contracts for interacting with Windfall Swap

1,167 lines • 252 kB
{ "contractName": "FullMath", "abi": [], "metadata": "{\"compiler\":{\"version\":\"0.6.6+commit.6c089d02\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"@windfallswap/lib/contracts/libraries/FullMath.sol\":\"FullMath\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"@windfallswap/lib/contracts/libraries/FullMath.sol\":{\"keccak256\":\"0x551088475af882db32a532bbf16c82859ce727bfa6b390b7ca1ba2ee1d913284\",\"urls\":[\"bzz-raw://b2967b56e05e57d367680628e244725d6d5271cb1fd3355308a6eba5ccfa01ae\",\"dweb:/ipfs/QmZZpc7PQ2wynS1XW2sStFpWWRwyLb8XHMvWx3SKmdmuvq\"]}},\"version\":1}", "bytecode": "0x60566023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220b104effbd8ae17b4873fc20a499b6665e4bea487a46e04e8ad05e76ef0e69dd864736f6c63430006060033", "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220b104effbd8ae17b4873fc20a499b6665e4bea487a46e04e8ad05e76ef0e69dd864736f6c63430006060033", "immutableReferences": {}, "sourceMap": "198:1124:18:-:0;;132:2:-1;166:7;155:9;146:7;137:37;255:7;249:14;246:1;241:23;235:4;232:33;222:2;;269:9;222:2;293:9;290:1;283:20;323:4;314:7;306:22;347:7;338;331:24", "deployedSourceMap": "198:1124:18:-:0;;;;;;12:1:-1;9;2:12", "source": "// SPDX-License-Identifier: CC-BY-4.0\r\npragma solidity >=0.4.0;\r\n\r\n// taken from https://medium.com/coinmonks/math-in-solidity-part-3-percents-and-proportions-4db014e080b1\r\n// license is CC-BY-4.0\r\nlibrary FullMath {\r\n function fullMul(uint256 x, uint256 y) internal pure returns (uint256 l, uint256 h) {\r\n uint256 mm = mulmod(x, y, uint256(-1));\r\n l = x * y;\r\n h = mm - l;\r\n if (mm < l) h -= 1;\r\n }\r\n\r\n function fullDiv(\r\n uint256 l,\r\n uint256 h,\r\n uint256 d\r\n ) private pure returns (uint256) {\r\n uint256 pow2 = d & -d;\r\n d /= pow2;\r\n l /= pow2;\r\n l += h * ((-pow2) / pow2 + 1);\r\n uint256 r = 1;\r\n r *= 2 - d * r;\r\n r *= 2 - d * r;\r\n r *= 2 - d * r;\r\n r *= 2 - d * r;\r\n r *= 2 - d * r;\r\n r *= 2 - d * r;\r\n r *= 2 - d * r;\r\n r *= 2 - d * r;\r\n return l * r;\r\n }\r\n\r\n function mulDiv(\r\n uint256 x,\r\n uint256 y,\r\n uint256 d\r\n ) internal pure returns (uint256) {\r\n (uint256 l, uint256 h) = fullMul(x, y);\r\n\r\n uint256 mm = mulmod(x, y, d);\r\n if (mm > l) h -= 1;\r\n l -= mm;\r\n\r\n if (h == 0) return l / d;\r\n\r\n require(h < d, 'FullMath: FULLDIV_OVERFLOW');\r\n return fullDiv(l, h, d);\r\n }\r\n}\r\n", "sourcePath": "@windfallswap\\lib\\contracts\\libraries\\FullMath.sol", "ast": { "absolutePath": "@windfallswap/lib/contracts/libraries/FullMath.sol", "exportedSymbols": { "FullMath": [ 6483 ] }, "id": 6484, "nodeType": "SourceUnit", "nodes": [ { "id": 6264, "literals": [ "solidity", ">=", "0.4", ".0" ], "nodeType": "PragmaDirective", "src": "39:24:18" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "library", "documentation": null, "fullyImplemented": true, "id": 6483, "linearizedBaseContracts": [ 6483 ], "name": "FullMath", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 6307, "nodeType": "Block", "src": "306:127:18", "statements": [ { "assignments": [ 6276 ], "declarations": [ { "constant": false, "id": 6276, "mutability": "mutable", "name": "mm", "nodeType": "VariableDeclaration", "overrides": null, "scope": 6307, "src": "317:10:18", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 6275, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "317:7:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 6286, "initialValue": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 6278, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6266, "src": "337:1:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "id": 6279, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6268, "src": "340:1:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 6283, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "-", "prefix": true, "src": "351:2:18", "subExpression": { "argumentTypes": null, "hexValue": "31", "id": 6282, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "352:1:18", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "typeDescriptions": { "typeIdentifier": "t_rational_minus_1_by_1", "typeString": "int_const -1" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_rational_minus_1_by_1", "typeString": "int_const -1" } ], "id": 6281, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "343:7:18", "typeDescriptions": { "typeIdentifier": "t_type$_t_uint256_$", "typeString": "type(uint256)" }, "typeName": { "id": 6280, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "343:7:18", "typeDescriptions": { "typeIdentifier": null, "typeString": null } } }, "id": 6284, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "343:11:18", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 6277, "name": "mulmod", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": -16, "src": "330:6:18", "typeDescriptions": { "typeIdentifier": "t_function_mulmod_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", "typeString": "function (uint256,uint256,uint256) pure returns (uint256)" } }, "id": 6285, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "330:25:18", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "317:38:18" }, { "expression": { "argumentTypes": null, "id": 6291, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 6287, "name": "l", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6271, "src": "366:1:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 6290, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 6288, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6266, "src": "370:1:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "argumentTypes": null, "id": 6289, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6268, "src": "374:1:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "370:5:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "366:9:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 6292, "nodeType": "ExpressionStatement", "src": "366:9:18" }, { "expression": { "argumentTypes": null, "id": 6297, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 6293, "name": "h", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6273, "src": "386:1:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 6296, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 6294, "name": "mm", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6276, "src": "390:2:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": { "argumentTypes": null, "id": 6295, "name": "l", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6271, "src": "395:1:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "390:6:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "386:10:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 6298, "nodeType": "ExpressionStatement", "src": "386:10:18" }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 6301, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 6299, "name": "mm", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6276, "src": "411:2:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "<", "rightExpression": { "argumentTypes": null, "id": 6300, "name": "l", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6271, "src": "416:1:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "411:6:18", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 6306, "nodeType": "IfStatement", "src": "407:18:18", "trueBody": { "expression": { "argumentTypes": null, "id": 6304, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 6302, "name": "h", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6273, "src": "419:1:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "-=", "rightHandSide": { "argumentTypes": null, "hexValue": "31", "id": 6303, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "424:1:18", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "419:6:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 6305, "nodeType": "ExpressionStatement", "src": "419:6:18" } } ] }, "documentation": null, "id": 6308, "implemented": true, "kind": "function", "modifiers": [], "name": "fullMul", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 6269, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 6266, "mutability": "mutable", "name": "x", "nodeType": "VariableDeclaration", "overrides": null, "scope": 6308, "src": "239:9:18", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 6265, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "239:7:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 6268, "mutability": "mutable", "name": "y", "nodeType": "VariableDeclaration", "overrides": null, "scope": 6308, "src": "250:9:18", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 6267, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "250:7:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "238:22:18" }, "returnParameters": { "id": 6274, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 6271, "mutability": "mutable", "name": "l", "nodeType": "VariableDeclaration", "overrides": null, "scope": 6308, "src": "284:9:18", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 6270, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "284:7:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 6273, "mutability": "mutable", "name": "h", "nodeType": "VariableDeclaration", "overrides": null, "scope": 6308, "src": "295:9:18", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 6272, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "295:7:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "283:22:18" }, "scope": 6483, "src": "222:211:18", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 6419, "nodeType": "Block", "src": "556:367:18", "statements": [ { "assignments": [ 6320 ], "declarations": [ { "constant": false, "id": 6320, "mutability": "mutable", "name": "pow2", "nodeType": "VariableDeclaration", "overrides": null, "scope": 6419, "src": "567:12:18", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 6319, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "567:7:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 6325, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 6324, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 6321, "name": "d", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6314, "src": "582:1:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "&", "rightExpression": { "argumentTypes": null, "id": 6323, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "-", "prefix": true, "src": "586:2:18", "subExpression": { "argumentTypes": null, "id": 6322, "name": "d", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6314, "src": "587:1:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "582:6:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "567:21:18" }, { "expression": { "argumentTypes": null, "id": 6328, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 6326, "name": "d", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6314, "src": "599:1:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "/=", "rightHandSide": { "argumentTypes": null, "id": 6327, "name": "pow2", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6320, "src": "604:4:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "599:9:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 6329, "nodeType": "ExpressionStatement", "src": "599:9:18" }, { "expression": { "argumentTypes": null, "id": 6332, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 6330, "name": "l", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6310, "src": "619:1:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "/=", "rightHandSide": { "argumentTypes": null, "id": 6331, "name": "pow2", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6320, "src": "624:4:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "619:9:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 6333, "nodeType": "ExpressionStatement", "src": "619:9:18" }, { "expression": { "argumentTypes": null, "id": 6345, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 6334, "name": "l", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6310, "src": "639:1:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "+=", "rightHandSide": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 6344, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 6335, "name": "h", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6312, "src": "644:1:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "argumentTypes": null, "components": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 6342, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 6340, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "components": [ { "argumentTypes": null, "id": 6337, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "-", "prefix": true, "src": "650:5:18", "subExpression": { "argumentTypes": null, "id": 6336, "name": "pow2", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6320, "src": "651:4:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "id": 6338, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "649:7:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "argumentTypes": null, "id": 6339, "name": "pow2", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6320, "src": "659:4:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "649:14:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "argumentTypes": null, "hexValue": "31", "id": 6341, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "666:1:18", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "649:18:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "id": 6343, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "648:20:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "644:24:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "639:29:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 6346, "nodeType": "ExpressionStatement", "src": "639:29:18" }, { "assignments": [ 6348 ], "declarations": [ { "constant": false, "id": 6348, "mutability": "mutable", "name": "r", "nodeType": "VariableDeclaration", "overrides": null, "scope": 6419, "src": "679:9:18", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 6347, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "679:7:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 6350, "initialValue": { "argumentTypes": null, "hexValue": "31", "id": 6349, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "691:1:18", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "nodeType": "VariableDeclarationStatement", "src": "679:13:18" }, { "expression": { "argumentTypes": null, "id": 6357, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 6351, "name": "r", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6348, "src": "703:1:18", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "*=", "rightHandSide": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 6356, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "hexValue": "32", "id": 6352, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "708:1:18", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2" }, "value": "2" }, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 6355, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 6353, "name": "d", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6314, "src": "712:1:18", "typeDescripti