@valueswap/v2-periphery
Version:
🎚 Peripheral smart contracts for interacting with Valueswap V2
1,095 lines (1,094 loc) • 337 kB
JSON
{
"contractName": "BitMath",
"abi": [],
"metadata": "{\"compiler\":{\"version\":\"0.6.6+commit.6c089d02\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"@valueswap/lib/contracts/libraries/BitMath.sol\":\"BitMath\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"@valueswap/lib/contracts/libraries/BitMath.sol\":{\"keccak256\":\"0x19f84d5268286794b44939ec0d85b3c6f59e133f826cdbd9e40112fc94919bb7\",\"urls\":[\"bzz-raw://d21c67ed58cf667d052e141df2fba76c46c159edcc45eb897c908c20c69d2727\",\"dweb:/ipfs/QmUyKz1992wgR8nYAzBuQzjBAKMxLAN3hTgzpYJxusbmVH\"]}},\"version\":1}",
"bytecode": "0x60566023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212204ea17e9aa57a38304b9381a2b521623a0a51e809438d7bd3176ea50b1a2b49b664736f6c63430006060033",
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212204ea17e9aa57a38304b9381a2b521623a0a51e809438d7bd3176ea50b1a2b49b664736f6c63430006060033",
"immutableReferences": {},
"sourceMap": "71:2043:23:-: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": "71:2043:23:-:0;;;;;;12:1:-1;9;2:12",
"source": "// SPDX-License-Identifier: GPL-3.0-or-later\npragma solidity >=0.5.0;\n\nlibrary BitMath {\n // returns the 0 indexed position of the most significant bit of the input x\n // s.t. x >= 2**msb and x < 2**(msb+1)\n function mostSignificantBit(uint256 x) internal pure returns (uint8 r) {\n require(x > 0, 'BitMath::mostSignificantBit: zero');\n\n if (x >= 0x100000000000000000000000000000000) {\n x >>= 128;\n r += 128;\n }\n if (x >= 0x10000000000000000) {\n x >>= 64;\n r += 64;\n }\n if (x >= 0x100000000) {\n x >>= 32;\n r += 32;\n }\n if (x >= 0x10000) {\n x >>= 16;\n r += 16;\n }\n if (x >= 0x100) {\n x >>= 8;\n r += 8;\n }\n if (x >= 0x10) {\n x >>= 4;\n r += 4;\n }\n if (x >= 0x4) {\n x >>= 2;\n r += 2;\n }\n if (x >= 0x2) r += 1;\n }\n\n // returns the 0 indexed position of the least significant bit of the input x\n // s.t. (x & 2**lsb) != 0 and (x & (2**(lsb) - 1)) == 0)\n // i.e. the bit at the index is set and the mask of all lower bits is 0\n function leastSignificantBit(uint256 x) internal pure returns (uint8 r) {\n require(x > 0, 'BitMath::leastSignificantBit: zero');\n\n r = 255;\n if (x & uint128(-1) > 0) {\n r -= 128;\n } else {\n x >>= 128;\n }\n if (x & uint64(-1) > 0) {\n r -= 64;\n } else {\n x >>= 64;\n }\n if (x & uint32(-1) > 0) {\n r -= 32;\n } else {\n x >>= 32;\n }\n if (x & uint16(-1) > 0) {\n r -= 16;\n } else {\n x >>= 16;\n }\n if (x & uint8(-1) > 0) {\n r -= 8;\n } else {\n x >>= 8;\n }\n if (x & 0xf > 0) {\n r -= 4;\n } else {\n x >>= 4;\n }\n if (x & 0x3 > 0) {\n r -= 2;\n } else {\n x >>= 2;\n }\n if (x & 0x1 > 0) r -= 1;\n }\n}\n",
"sourcePath": "@valueswap/lib/contracts/libraries/BitMath.sol",
"ast": {
"absolutePath": "@valueswap/lib/contracts/libraries/BitMath.sol",
"exportedSymbols": {
"BitMath": [
8029
]
},
"id": 8030,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 7753,
"literals": [
"solidity",
">=",
"0.5",
".0"
],
"nodeType": "PragmaDirective",
"src": "45:24:23"
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": null,
"fullyImplemented": true,
"id": 8029,
"linearizedBaseContracts": [
8029
],
"name": "BitMath",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 7866,
"nodeType": "Block",
"src": "288:697:23",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 7763,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 7761,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7755,
"src": "306:1:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 7762,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "310:1:23",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "306:5:23",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4269744d6174683a3a6d6f73745369676e69666963616e744269743a207a65726f",
"id": 7764,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "313:35:23",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_03c73b0187854c5090030bbfe0f7d97709bd7eabff8b89faf5be84b9d8c785d2",
"typeString": "literal_string \"BitMath::mostSignificantBit: zero\""
},
"value": "BitMath::mostSignificantBit: zero"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_03c73b0187854c5090030bbfe0f7d97709bd7eabff8b89faf5be84b9d8c785d2",
"typeString": "literal_string \"BitMath::mostSignificantBit: zero\""
}
],
"id": 7760,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "298:7:23",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 7765,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "298:51:23",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 7766,
"nodeType": "ExpressionStatement",
"src": "298:51:23"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 7769,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 7767,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7755,
"src": "364:1:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"argumentTypes": null,
"hexValue": "3078313030303030303030303030303030303030303030303030303030303030303030",
"id": 7768,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "369:35:23",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_340282366920938463463374607431768211456_by_1",
"typeString": "int_const 3402...(31 digits omitted)...1456"
},
"value": "0x100000000000000000000000000000000"
},
"src": "364:40:23",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 7779,
"nodeType": "IfStatement",
"src": "360:102:23",
"trueBody": {
"id": 7778,
"nodeType": "Block",
"src": "406:56:23",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 7772,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 7770,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7755,
"src": "420:1:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": ">>=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "313238",
"id": 7771,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "426:3:23",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_128_by_1",
"typeString": "int_const 128"
},
"value": "128"
},
"src": "420:9:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 7773,
"nodeType": "ExpressionStatement",
"src": "420:9:23"
},
{
"expression": {
"argumentTypes": null,
"id": 7776,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 7774,
"name": "r",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7758,
"src": "443:1:23",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"nodeType": "Assignment",
"operator": "+=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "313238",
"id": 7775,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "448:3:23",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_128_by_1",
"typeString": "int_const 128"
},
"value": "128"
},
"src": "443:8:23",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"id": 7777,
"nodeType": "ExpressionStatement",
"src": "443:8:23"
}
]
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 7782,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 7780,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7755,
"src": "475:1:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30783130303030303030303030303030303030",
"id": 7781,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "480:19:23",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_18446744073709551616_by_1",
"typeString": "int_const 18446744073709551616"
},
"value": "0x10000000000000000"
},
"src": "475:24:23",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 7792,
"nodeType": "IfStatement",
"src": "471:84:23",
"trueBody": {
"id": 7791,
"nodeType": "Block",
"src": "501:54:23",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 7785,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 7783,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7755,
"src": "515:1:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": ">>=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "3634",
"id": 7784,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "521:2:23",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_64_by_1",
"typeString": "int_const 64"
},
"value": "64"
},
"src": "515:8:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 7786,
"nodeType": "ExpressionStatement",
"src": "515:8:23"
},
{
"expression": {
"argumentTypes": null,
"id": 7789,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 7787,
"name": "r",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7758,
"src": "537:1:23",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"nodeType": "Assignment",
"operator": "+=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "3634",
"id": 7788,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "542:2:23",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_64_by_1",
"typeString": "int_const 64"
},
"value": "64"
},
"src": "537:7:23",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"id": 7790,
"nodeType": "ExpressionStatement",
"src": "537:7:23"
}
]
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 7795,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 7793,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7755,
"src": "568:1:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"argumentTypes": null,
"hexValue": "3078313030303030303030",
"id": 7794,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "573:11:23",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_4294967296_by_1",
"typeString": "int_const 4294967296"
},
"value": "0x100000000"
},
"src": "568:16:23",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 7805,
"nodeType": "IfStatement",
"src": "564:76:23",
"trueBody": {
"id": 7804,
"nodeType": "Block",
"src": "586:54:23",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 7798,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 7796,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7755,
"src": "600:1:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": ">>=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "3332",
"id": 7797,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "606:2:23",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_32_by_1",
"typeString": "int_const 32"
},
"value": "32"
},
"src": "600:8:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 7799,
"nodeType": "ExpressionStatement",
"src": "600:8:23"
},
{
"expression": {
"argumentTypes": null,
"id": 7802,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 7800,
"name": "r",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7758,
"src": "622:1:23",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"nodeType": "Assignment",
"operator": "+=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "3332",
"id": 7801,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "627:2:23",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_32_by_1",
"typeString": "int_const 32"
},
"value": "32"
},
"src": "622:7:23",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"id": 7803,
"nodeType": "ExpressionStatement",
"src": "622:7:23"
}
]
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 7808,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 7806,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7755,
"src": "653:1:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30783130303030",
"id": 7807,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "658:7:23",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_65536_by_1",
"typeString": "int_const 65536"
},
"value": "0x10000"
},
"src": "653:12:23",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 7818,
"nodeType": "IfStatement",
"src": "649:72:23",
"trueBody": {
"id": 7817,
"nodeType": "Block",
"src": "667:54:23",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 7811,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 7809,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7755,
"src": "681:1:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": ">>=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "3136",
"id": 7810,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "687:2:23",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_16_by_1",
"typeString": "int_const 16"
},
"value": "16"
},
"src": "681:8:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 7812,
"nodeType": "ExpressionStatement",
"src": "681:8:23"
},
{
"expression": {
"argumentTypes": null,
"id": 7815,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 7813,
"name": "r",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7758,
"src": "703:1:23",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"nodeType": "Assignment",
"operator": "+=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "3136",
"id": 7814,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "708:2:23",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_16_by_1",
"typeString": "int_const 16"
},
"value": "16"
},
"src": "703:7:23",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"id": 7816,
"nodeType": "ExpressionStatement",
"src": "703:7:23"
}
]
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 7821,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 7819,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7755,
"src": "734:1:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"argumentTypes": null,
"hexValue": "3078313030",
"id": 7820,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "739:5:23",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_256_by_1",
"typeString": "int_const 256"
},
"value": "0x100"
},
"src": "734:10:23",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 7831,
"nodeType": "IfStatement",
"src": "730:68:23",
"trueBody": {
"id": 7830,
"nodeType": "Block",
"src": "746:52:23",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 7824,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 7822,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7755,
"src": "760:1:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": ">>=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "38",
"id": 7823,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "766:1:23",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_8_by_1",
"typeString": "int_const 8"
},
"value": "8"
},
"src": "760:7:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 7825,
"nodeType": "ExpressionStatement",
"src": "760:7:23"
},
{
"expression": {
"argumentTypes": null,
"id": 7828,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 7826,
"name": "r",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7758,
"src": "781:1:23",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"nodeType": "Assignment",
"operator": "+=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "38",
"id": 7827,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "786:1:23",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_8_by_1",
"typeString": "int_const 8"
},
"value": "8"
},
"src": "781:6:23",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"id": 7829,
"nodeType": "ExpressionStatement",
"src": "781:6:23"
}
]
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 7834,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 7832,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7755,
"src": "811:1:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30783130",
"id": 7833,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "816:4:23",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_16_by_1",
"typeString": "int_const 16"
},
"value": "0x10"
},
"src": "811:9:23",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 7844,
"nodeType": "IfStatement",
"src": "807:67:23",
"trueBody": {
"id": 7843,
"nodeType": "Block",
"src": "822:52:23",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 7837,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 7835,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7755,
"src": "836:1:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": ">>=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "34",
"id": 7836,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "842:1:23",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_4_by_1",
"typeString": "int_const 4"
},
"value": "4"