@valueswap/v2-periphery
Version:
🎚 Peripheral smart contracts for interacting with Valueswap V2
1,131 lines (1,130 loc) • 257 kB
JSON
{
"contractName": "Babylonian",
"abi": [],
"metadata": "{\"compiler\":{\"version\":\"0.6.6+commit.6c089d02\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"@valueswap/lib/contracts/libraries/Babylonian.sol\":\"Babylonian\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"@valueswap/lib/contracts/libraries/Babylonian.sol\":{\"keccak256\":\"0xeb1c2a281a00f4660775f75ccfa1e51fbe1d75f86aeb9d0d297151ecdb900177\",\"urls\":[\"bzz-raw://68515f0265381bddfb1d1356ea10ce4e5784276fc09f197fcdcedfa5c75cc069\",\"dweb:/ipfs/QmXWVVPnuJwRUAu3Qpu1s7Fyc5WPQxmZPczVEe5cJ5wVHZ\"]}},\"version\":1}",
"bytecode": "0x60566023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220b3ce0e87469566960e090f8f3b377dc77374690818af30f73a5dc23248496b2764736f6c63430006060033",
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220b3ce0e87469566960e090f8f3b377dc77374690818af30f73a5dc23248496b2764736f6c63430006060033",
"immutableReferences": {},
"sourceMap": "210:1371:22:-: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": "210:1371:22:-:0;;;;;;12:1:-1;9;2:12",
"source": "// SPDX-License-Identifier: GPL-3.0-or-later\n\npragma solidity >=0.4.0;\n\n// computes square roots using the babylonian method\n// https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method\nlibrary Babylonian {\n // credit for this implementation goes to\n // https://github.com/abdk-consulting/abdk-libraries-solidity/blob/master/ABDKMath64x64.sol#L687\n function sqrt(uint256 x) internal pure returns (uint256) {\n if (x == 0) return 0;\n // this block is equivalent to r = uint256(1) << (BitMath.mostSignificantBit(x) / 2);\n // however that code costs significantly more gas\n uint256 xx = x;\n uint256 r = 1;\n if (xx >= 0x100000000000000000000000000000000) {\n xx >>= 128;\n r <<= 64;\n }\n if (xx >= 0x10000000000000000) {\n xx >>= 64;\n r <<= 32;\n }\n if (xx >= 0x100000000) {\n xx >>= 32;\n r <<= 16;\n }\n if (xx >= 0x10000) {\n xx >>= 16;\n r <<= 8;\n }\n if (xx >= 0x100) {\n xx >>= 8;\n r <<= 4;\n }\n if (xx >= 0x10) {\n xx >>= 4;\n r <<= 2;\n }\n if (xx >= 0x8) {\n r <<= 1;\n }\n r = (r + x / r) >> 1;\n r = (r + x / r) >> 1;\n r = (r + x / r) >> 1;\n r = (r + x / r) >> 1;\n r = (r + x / r) >> 1;\n r = (r + x / r) >> 1;\n r = (r + x / r) >> 1; // Seven iterations should be enough\n uint256 r1 = x / r;\n return (r < r1 ? r : r1);\n }\n}\n",
"sourcePath": "@valueswap/lib/contracts/libraries/Babylonian.sol",
"ast": {
"absolutePath": "@valueswap/lib/contracts/libraries/Babylonian.sol",
"exportedSymbols": {
"Babylonian": [
7751
]
},
"id": 7752,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 7550,
"literals": [
"solidity",
">=",
"0.4",
".0"
],
"nodeType": "PragmaDirective",
"src": "46:24:22"
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": null,
"fullyImplemented": true,
"id": 7751,
"linearizedBaseContracts": [
7751
],
"name": "Babylonian",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 7749,
"nodeType": "Block",
"src": "439:1140:22",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 7559,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 7557,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7552,
"src": "453:1:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 7558,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "458:1:22",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "453:6:22",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 7562,
"nodeType": "IfStatement",
"src": "449:20:22",
"trueBody": {
"expression": {
"argumentTypes": null,
"hexValue": "30",
"id": 7560,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "468:1:22",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"functionReturnParameters": 7556,
"id": 7561,
"nodeType": "Return",
"src": "461:8:22"
}
},
{
"assignments": [
7564
],
"declarations": [
{
"constant": false,
"id": 7564,
"mutability": "mutable",
"name": "xx",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 7749,
"src": "631:10:22",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 7563,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "631:7:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 7566,
"initialValue": {
"argumentTypes": null,
"id": 7565,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7552,
"src": "644:1:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "631:14:22"
},
{
"assignments": [
7568
],
"declarations": [
{
"constant": false,
"id": 7568,
"mutability": "mutable",
"name": "r",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 7749,
"src": "655:9:22",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 7567,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "655:7:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 7570,
"initialValue": {
"argumentTypes": null,
"hexValue": "31",
"id": 7569,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "667:1:22",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"nodeType": "VariableDeclarationStatement",
"src": "655:13:22"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 7573,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 7571,
"name": "xx",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7564,
"src": "682:2:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"argumentTypes": null,
"hexValue": "3078313030303030303030303030303030303030303030303030303030303030303030",
"id": 7572,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "688:35:22",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_340282366920938463463374607431768211456_by_1",
"typeString": "int_const 3402...(31 digits omitted)...1456"
},
"value": "0x100000000000000000000000000000000"
},
"src": "682:41:22",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 7583,
"nodeType": "IfStatement",
"src": "678:104:22",
"trueBody": {
"id": 7582,
"nodeType": "Block",
"src": "725:57:22",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 7576,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 7574,
"name": "xx",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7564,
"src": "739:2:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": ">>=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "313238",
"id": 7575,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "746:3:22",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_128_by_1",
"typeString": "int_const 128"
},
"value": "128"
},
"src": "739:10:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 7577,
"nodeType": "ExpressionStatement",
"src": "739:10:22"
},
{
"expression": {
"argumentTypes": null,
"id": 7580,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 7578,
"name": "r",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7568,
"src": "763:1:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "<<=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "3634",
"id": 7579,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "769:2:22",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_64_by_1",
"typeString": "int_const 64"
},
"value": "64"
},
"src": "763:8:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 7581,
"nodeType": "ExpressionStatement",
"src": "763:8:22"
}
]
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 7586,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 7584,
"name": "xx",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7564,
"src": "795:2:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30783130303030303030303030303030303030",
"id": 7585,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "801:19:22",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_18446744073709551616_by_1",
"typeString": "int_const 18446744073709551616"
},
"value": "0x10000000000000000"
},
"src": "795:25:22",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 7596,
"nodeType": "IfStatement",
"src": "791:87:22",
"trueBody": {
"id": 7595,
"nodeType": "Block",
"src": "822:56:22",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 7589,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 7587,
"name": "xx",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7564,
"src": "836:2:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": ">>=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "3634",
"id": 7588,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "843:2:22",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_64_by_1",
"typeString": "int_const 64"
},
"value": "64"
},
"src": "836:9:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 7590,
"nodeType": "ExpressionStatement",
"src": "836:9:22"
},
{
"expression": {
"argumentTypes": null,
"id": 7593,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 7591,
"name": "r",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7568,
"src": "859:1:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "<<=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "3332",
"id": 7592,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "865:2:22",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_32_by_1",
"typeString": "int_const 32"
},
"value": "32"
},
"src": "859:8:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 7594,
"nodeType": "ExpressionStatement",
"src": "859:8:22"
}
]
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 7599,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 7597,
"name": "xx",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7564,
"src": "891:2:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"argumentTypes": null,
"hexValue": "3078313030303030303030",
"id": 7598,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "897:11:22",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_4294967296_by_1",
"typeString": "int_const 4294967296"
},
"value": "0x100000000"
},
"src": "891:17:22",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 7609,
"nodeType": "IfStatement",
"src": "887:79:22",
"trueBody": {
"id": 7608,
"nodeType": "Block",
"src": "910:56:22",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 7602,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 7600,
"name": "xx",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7564,
"src": "924:2:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": ">>=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "3332",
"id": 7601,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "931:2:22",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_32_by_1",
"typeString": "int_const 32"
},
"value": "32"
},
"src": "924:9:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 7603,
"nodeType": "ExpressionStatement",
"src": "924:9:22"
},
{
"expression": {
"argumentTypes": null,
"id": 7606,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 7604,
"name": "r",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7568,
"src": "947:1:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "<<=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "3136",
"id": 7605,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "953:2:22",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_16_by_1",
"typeString": "int_const 16"
},
"value": "16"
},
"src": "947:8:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 7607,
"nodeType": "ExpressionStatement",
"src": "947:8:22"
}
]
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 7612,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 7610,
"name": "xx",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7564,
"src": "979:2:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30783130303030",
"id": 7611,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "985:7:22",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_65536_by_1",
"typeString": "int_const 65536"
},
"value": "0x10000"
},
"src": "979:13:22",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 7622,
"nodeType": "IfStatement",
"src": "975:74:22",
"trueBody": {
"id": 7621,
"nodeType": "Block",
"src": "994:55:22",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 7615,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 7613,
"name": "xx",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7564,
"src": "1008:2:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": ">>=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "3136",
"id": 7614,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1015:2:22",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_16_by_1",
"typeString": "int_const 16"
},
"value": "16"
},
"src": "1008:9:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 7616,
"nodeType": "ExpressionStatement",
"src": "1008:9:22"
},
{
"expression": {
"argumentTypes": null,
"id": 7619,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 7617,
"name": "r",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7568,
"src": "1031:1:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "<<=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "38",
"id": 7618,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1037:1:22",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_8_by_1",
"typeString": "int_const 8"
},
"value": "8"
},
"src": "1031:7:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 7620,
"nodeType": "ExpressionStatement",
"src": "1031:7:22"
}
]
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 7625,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 7623,
"name": "xx",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7564,
"src": "1062:2:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"argumentTypes": null,
"hexValue": "3078313030",
"id": 7624,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1068:5:22",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_256_by_1",
"typeString": "int_const 256"
},
"value": "0x100"
},
"src": "1062:11:22",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 7635,
"nodeType": "IfStatement",
"src": "1058:71:22",
"trueBody": {
"id": 7634,
"nodeType": "Block",
"src": "1075:54:22",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 7628,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 7626,
"name": "xx",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7564,
"src": "1089:2:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": ">>=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "38",
"id": 7627,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1096:1:22",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_8_by_1",
"typeString": "int_const 8"
},
"value": "8"
},
"src": "1089:8:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 7629,
"nodeType": "ExpressionStatement",
"src": "1089:8:22"
},
{
"expression": {
"argumentTypes": null,
"id": 7632,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 7630,
"name": "r",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7568,
"src": "1111:1:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "<<=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "34",
"id": 7631,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1117:1:22",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_4_by_1",
"typeString": "int_const 4"
},
"value": "4"
},
"src": "1111:7:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 7633,
"nodeType": "ExpressionStatement",
"src": "1111:7:22"
}
]
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 7638,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 7636,
"name": "xx",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7564,
"src": "1142:2:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30783130",
"id": 7637,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1148:4:22",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_16_by_1",
"typeString": "int_const 16"
},
"value": "0x10"
},
"src": "1142:10:22",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 7648,
"nodeType": "IfStatement",
"src": "1138:70:22",
"trueBody": {
"id": 7647,
"nodeType": "Block",
"src": "1154:54:22",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 7641,
"isConstant": false,
"isLValue": false,