UNPKG

@windfallswap/periphery

Version:

🎚 Peripheral smart contracts for interacting with Windfall Swap

1,128 lines (1,127 loc) • 241 kB
{ "contractName": "Babylonian", "abi": [], "metadata": "{\"compiler\":{\"version\":\"0.6.6+commit.6c089d02\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"@windfallswap/lib/contracts/libraries/Babylonian.sol\":\"Babylonian\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"@windfallswap/lib/contracts/libraries/Babylonian.sol\":{\"keccak256\":\"0x81eb4c5866c15c48b9b75d004f82dcda6c9d7342fb5cf136c27e8761601c35cb\",\"urls\":[\"bzz-raw://eedefbef0159af045769189dc9bfa2f01dea7fe7767943f409dc5cff05de4619\",\"dweb:/ipfs/QmUEaa5Cu9vpUxZMdFmwpLgby95Xo76v1BjFFxMhFwbEqP\"]}},\"version\":1}", "bytecode": "0x60566023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220b08882b0a0f3cb3e45d9b2f8631cf4ecfa71e98b0af1933743da3b9ad6a4699c64736f6c63430006060033", "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220b08882b0a0f3cb3e45d9b2f8631cf4ecfa71e98b0af1933743da3b9ad6a4699c64736f6c63430006060033", "immutableReferences": {}, "sourceMap": "216:1417:15:-: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": "216:1417:15:-:0;;;;;;12:1:-1;9;2:12", "source": "// SPDX-License-Identifier: GPL-3.0-or-later\r\n\r\npragma solidity >=0.4.0;\r\n\r\n// computes square roots using the babylonian method\r\n// https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method\r\nlibrary Babylonian {\r\n // credit for this implementation goes to\r\n // https://github.com/abdk-consulting/abdk-libraries-solidity/blob/master/ABDKMath64x64.sol#L687\r\n function sqrt(uint256 x) internal pure returns (uint256) {\r\n if (x == 0) return 0;\r\n // this block is equivalent to r = uint256(1) << (BitMath.mostSignificantBit(x) / 2);\r\n // however that code costs significantly more gas\r\n uint256 xx = x;\r\n uint256 r = 1;\r\n if (xx >= 0x100000000000000000000000000000000) {\r\n xx >>= 128;\r\n r <<= 64;\r\n }\r\n if (xx >= 0x10000000000000000) {\r\n xx >>= 64;\r\n r <<= 32;\r\n }\r\n if (xx >= 0x100000000) {\r\n xx >>= 32;\r\n r <<= 16;\r\n }\r\n if (xx >= 0x10000) {\r\n xx >>= 16;\r\n r <<= 8;\r\n }\r\n if (xx >= 0x100) {\r\n xx >>= 8;\r\n r <<= 4;\r\n }\r\n if (xx >= 0x10) {\r\n xx >>= 4;\r\n r <<= 2;\r\n }\r\n if (xx >= 0x8) {\r\n r <<= 1;\r\n }\r\n r = (r + x / r) >> 1;\r\n r = (r + x / r) >> 1;\r\n r = (r + x / r) >> 1;\r\n r = (r + x / r) >> 1;\r\n r = (r + x / r) >> 1;\r\n r = (r + x / r) >> 1;\r\n r = (r + x / r) >> 1; // Seven iterations should be enough\r\n uint256 r1 = x / r;\r\n return (r < r1 ? r : r1);\r\n }\r\n}\r\n", "sourcePath": "@windfallswap\\lib\\contracts\\libraries\\Babylonian.sol", "ast": { "absolutePath": "@windfallswap/lib/contracts/libraries/Babylonian.sol", "exportedSymbols": { "Babylonian": [ 5355 ] }, "id": 5356, "nodeType": "SourceUnit", "nodes": [ { "id": 5154, "literals": [ "solidity", ">=", "0.4", ".0" ], "nodeType": "PragmaDirective", "src": "48:24:15" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "library", "documentation": null, "fullyImplemented": true, "id": 5355, "linearizedBaseContracts": [ 5355 ], "name": "Babylonian", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 5353, "nodeType": "Block", "src": "448:1182:15", "statements": [ { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5163, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5161, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5156, "src": "463:1:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 5162, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "468:1:15", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "463:6:15", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 5166, "nodeType": "IfStatement", "src": "459:20:15", "trueBody": { "expression": { "argumentTypes": null, "hexValue": "30", "id": 5164, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "478:1:15", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "functionReturnParameters": 5160, "id": 5165, "nodeType": "Return", "src": "471:8:15" } }, { "assignments": [ 5168 ], "declarations": [ { "constant": false, "id": 5168, "mutability": "mutable", "name": "xx", "nodeType": "VariableDeclaration", "overrides": null, "scope": 5353, "src": "644:10:15", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5167, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "644:7:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 5170, "initialValue": { "argumentTypes": null, "id": 5169, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5156, "src": "657:1:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "644:14:15" }, { "assignments": [ 5172 ], "declarations": [ { "constant": false, "id": 5172, "mutability": "mutable", "name": "r", "nodeType": "VariableDeclaration", "overrides": null, "scope": 5353, "src": "669:9:15", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5171, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "669:7:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 5174, "initialValue": { "argumentTypes": null, "hexValue": "31", "id": 5173, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "681:1:15", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "nodeType": "VariableDeclarationStatement", "src": "669:13:15" }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5177, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5175, "name": "xx", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5168, "src": "697:2:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "argumentTypes": null, "hexValue": "3078313030303030303030303030303030303030303030303030303030303030303030", "id": 5176, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "703:35:15", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_340282366920938463463374607431768211456_by_1", "typeString": "int_const 3402...(31 digits omitted)...1456" }, "value": "0x100000000000000000000000000000000" }, "src": "697:41:15", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 5187, "nodeType": "IfStatement", "src": "693:107:15", "trueBody": { "id": 5186, "nodeType": "Block", "src": "740:60:15", "statements": [ { "expression": { "argumentTypes": null, "id": 5180, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 5178, "name": "xx", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5168, "src": "755:2:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": ">>=", "rightHandSide": { "argumentTypes": null, "hexValue": "313238", "id": 5179, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "762:3:15", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_128_by_1", "typeString": "int_const 128" }, "value": "128" }, "src": "755:10:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 5181, "nodeType": "ExpressionStatement", "src": "755:10:15" }, { "expression": { "argumentTypes": null, "id": 5184, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 5182, "name": "r", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5172, "src": "780:1:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "<<=", "rightHandSide": { "argumentTypes": null, "hexValue": "3634", "id": 5183, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "786:2:15", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_64_by_1", "typeString": "int_const 64" }, "value": "64" }, "src": "780:8:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 5185, "nodeType": "ExpressionStatement", "src": "780:8:15" } ] } }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5190, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5188, "name": "xx", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5168, "src": "814:2:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "argumentTypes": null, "hexValue": "30783130303030303030303030303030303030", "id": 5189, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "820:19:15", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_18446744073709551616_by_1", "typeString": "int_const 18446744073709551616" }, "value": "0x10000000000000000" }, "src": "814:25:15", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 5200, "nodeType": "IfStatement", "src": "810:90:15", "trueBody": { "id": 5199, "nodeType": "Block", "src": "841:59:15", "statements": [ { "expression": { "argumentTypes": null, "id": 5193, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 5191, "name": "xx", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5168, "src": "856:2:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": ">>=", "rightHandSide": { "argumentTypes": null, "hexValue": "3634", "id": 5192, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "863:2:15", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_64_by_1", "typeString": "int_const 64" }, "value": "64" }, "src": "856:9:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 5194, "nodeType": "ExpressionStatement", "src": "856:9:15" }, { "expression": { "argumentTypes": null, "id": 5197, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 5195, "name": "r", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5172, "src": "880:1:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "<<=", "rightHandSide": { "argumentTypes": null, "hexValue": "3332", "id": 5196, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "886:2:15", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_32_by_1", "typeString": "int_const 32" }, "value": "32" }, "src": "880:8:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 5198, "nodeType": "ExpressionStatement", "src": "880:8:15" } ] } }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5203, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5201, "name": "xx", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5168, "src": "914:2:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "argumentTypes": null, "hexValue": "3078313030303030303030", "id": 5202, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "920:11:15", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_4294967296_by_1", "typeString": "int_const 4294967296" }, "value": "0x100000000" }, "src": "914:17:15", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 5213, "nodeType": "IfStatement", "src": "910:82:15", "trueBody": { "id": 5212, "nodeType": "Block", "src": "933:59:15", "statements": [ { "expression": { "argumentTypes": null, "id": 5206, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 5204, "name": "xx", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5168, "src": "948:2:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": ">>=", "rightHandSide": { "argumentTypes": null, "hexValue": "3332", "id": 5205, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "955:2:15", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_32_by_1", "typeString": "int_const 32" }, "value": "32" }, "src": "948:9:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 5207, "nodeType": "ExpressionStatement", "src": "948:9:15" }, { "expression": { "argumentTypes": null, "id": 5210, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 5208, "name": "r", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5172, "src": "972:1:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "<<=", "rightHandSide": { "argumentTypes": null, "hexValue": "3136", "id": 5209, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "978:2:15", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_16_by_1", "typeString": "int_const 16" }, "value": "16" }, "src": "972:8:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 5211, "nodeType": "ExpressionStatement", "src": "972:8:15" } ] } }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5216, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5214, "name": "xx", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5168, "src": "1006:2:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "argumentTypes": null, "hexValue": "30783130303030", "id": 5215, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1012:7:15", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_65536_by_1", "typeString": "int_const 65536" }, "value": "0x10000" }, "src": "1006:13:15", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 5226, "nodeType": "IfStatement", "src": "1002:77:15", "trueBody": { "id": 5225, "nodeType": "Block", "src": "1021:58:15", "statements": [ { "expression": { "argumentTypes": null, "id": 5219, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 5217, "name": "xx", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5168, "src": "1036:2:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": ">>=", "rightHandSide": { "argumentTypes": null, "hexValue": "3136", "id": 5218, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1043:2:15", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_16_by_1", "typeString": "int_const 16" }, "value": "16" }, "src": "1036:9:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 5220, "nodeType": "ExpressionStatement", "src": "1036:9:15" }, { "expression": { "argumentTypes": null, "id": 5223, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 5221, "name": "r", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5172, "src": "1060:1:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "<<=", "rightHandSide": { "argumentTypes": null, "hexValue": "38", "id": 5222, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1066:1:15", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_8_by_1", "typeString": "int_const 8" }, "value": "8" }, "src": "1060:7:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 5224, "nodeType": "ExpressionStatement", "src": "1060:7:15" } ] } }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5229, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5227, "name": "xx", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5168, "src": "1093:2:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "argumentTypes": null, "hexValue": "3078313030", "id": 5228, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1099:5:15", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_256_by_1", "typeString": "int_const 256" }, "value": "0x100" }, "src": "1093:11:15", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 5239, "nodeType": "IfStatement", "src": "1089:74:15", "trueBody": { "id": 5238, "nodeType": "Block", "src": "1106:57:15", "statements": [ { "expression": { "argumentTypes": null, "id": 5232, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 5230, "name": "xx", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5168, "src": "1121:2:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": ">>=", "rightHandSide": { "argumentTypes": null, "hexValue": "38", "id": 5231, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1128:1:15", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_8_by_1", "typeString": "int_const 8" }, "value": "8" }, "src": "1121:8:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 5233, "nodeType": "ExpressionStatement", "src": "1121:8:15" }, { "expression": { "argumentTypes": null, "id": 5236, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 5234, "name": "r", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5172, "src": "1144:1:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "<<=", "rightHandSide": { "argumentTypes": null, "hexValue": "34", "id": 5235, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1150:1:15", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_4_by_1", "typeString": "int_const 4" }, "value": "4" }, "src": "1144:7:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 5237, "nodeType": "ExpressionStatement", "src": "1144:7:15" } ] } }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 5242, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5240, "name": "xx", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5168, "src": "1177:2:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "argumentTypes": null, "hexValue": "30783130", "id": 5241, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1183:4:15", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_16_by_1", "typeString": "int_const 16" }, "value": "0x10" }, "src": "1177:10:15", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 5252, "nodeType": "IfStatement", "src": "1173:73:15", "trueBody": { "id": 5251, "nodeType": "Block", "src": "1189:57:15", "statements": [ { "expression": { "argumentTypes": null,