moonwalkerswap-v2-periphery
Version:
Moonwalkerswap v2 periphery
1,169 lines (1,168 loc) • 267 kB
JSON
{
"contractName": "FullMath",
"abi": [],
"metadata": "{\"compiler\":{\"version\":\"0.6.6+commit.6c089d02\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"moonwalkerswap-libraries/contracts/libraries/FullMath.sol\":\"FullMath\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"moonwalkerswap-libraries/contracts/libraries/FullMath.sol\":{\"keccak256\":\"0xc4ffcf28169f73fc9fdd1f82345d6d4fcccf3fd5aea83c133437c25e4e0950a9\",\"urls\":[\"bzz-raw://c9257a47501005f0a648bc4801ef4abc33843681aaf03a6d0c43d46b69e37407\",\"dweb:/ipfs/QmciHvDrqhxs5fjsrm9aNq29FZXpunMn17n2wWj83Zsh3B\"]}},\"version\":1}",
"bytecode": "0x60566023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220ada2bd51e00a9982b082c24c9b444a2ee3d6cf0cc2a947960b34a85630f1f8a264736f6c63430006060033",
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220ada2bd51e00a9982b082c24c9b444a2ee3d6cf0cc2a947960b34a85630f1f8a264736f6c63430006060033",
"immutableReferences": {},
"sourceMap": "193:1079:21:-: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": "193:1079:21:-:0;;;;;;12:1:-1;9;2:12",
"source": "// SPDX-License-Identifier: CC-BY-4.0\npragma solidity >=0.4.0;\n\n// taken from https://medium.com/coinmonks/math-in-solidity-part-3-percents-and-proportions-4db014e080b1\n// license is CC-BY-4.0\nlibrary FullMath {\n function fullMul(uint256 x, uint256 y) internal pure returns (uint256 l, uint256 h) {\n uint256 mm = mulmod(x, y, uint256(-1));\n l = x * y;\n h = mm - l;\n if (mm < l) h -= 1;\n }\n\n function fullDiv(\n uint256 l,\n uint256 h,\n uint256 d\n ) private pure returns (uint256) {\n uint256 pow2 = d & -d;\n d /= pow2;\n l /= pow2;\n l += h * ((-pow2) / pow2 + 1);\n uint256 r = 1;\n r *= 2 - d * r;\n r *= 2 - d * r;\n r *= 2 - d * r;\n r *= 2 - d * r;\n r *= 2 - d * r;\n r *= 2 - d * r;\n r *= 2 - d * r;\n r *= 2 - d * r;\n return l * r;\n }\n\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 d\n ) internal pure returns (uint256) {\n (uint256 l, uint256 h) = fullMul(x, y);\n\n uint256 mm = mulmod(x, y, d);\n if (mm > l) h -= 1;\n l -= mm;\n\n if (h == 0) return l / d;\n\n require(h < d, 'FullMath: FULLDIV_OVERFLOW');\n return fullDiv(l, h, d);\n }\n}\n",
"sourcePath": "moonwalkerswap-libraries/contracts/libraries/FullMath.sol",
"ast": {
"absolutePath": "moonwalkerswap-libraries/contracts/libraries/FullMath.sol",
"exportedSymbols": {
"FullMath": [
8079
]
},
"id": 8080,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 7860,
"literals": [
"solidity",
">=",
"0.4",
".0"
],
"nodeType": "PragmaDirective",
"src": "38:24:21"
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": null,
"fullyImplemented": true,
"id": 8079,
"linearizedBaseContracts": [
8079
],
"name": "FullMath",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 7903,
"nodeType": "Block",
"src": "300:122:21",
"statements": [
{
"assignments": [
7872
],
"declarations": [
{
"constant": false,
"id": 7872,
"mutability": "mutable",
"name": "mm",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 7903,
"src": "310:10:21",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 7871,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "310:7:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 7882,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 7874,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7862,
"src": "330:1:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 7875,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7864,
"src": "333:1:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 7879,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "-",
"prefix": true,
"src": "344:2:21",
"subExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 7878,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "345:1:21",
"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": 7877,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "336:7:21",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
},
"typeName": {
"id": 7876,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "336:7:21",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 7880,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "336:11:21",
"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": 7873,
"name": "mulmod",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -16,
"src": "323:6:21",
"typeDescriptions": {
"typeIdentifier": "t_function_mulmod_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint256) pure returns (uint256)"
}
},
"id": 7881,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "323:25:21",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "310:38:21"
},
{
"expression": {
"argumentTypes": null,
"id": 7887,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 7883,
"name": "l",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7867,
"src": "358:1:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 7886,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 7884,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7862,
"src": "362:1:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "*",
"rightExpression": {
"argumentTypes": null,
"id": 7885,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7864,
"src": "366:1:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "362:5:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "358:9:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 7888,
"nodeType": "ExpressionStatement",
"src": "358:9:21"
},
{
"expression": {
"argumentTypes": null,
"id": 7893,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 7889,
"name": "h",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7869,
"src": "377:1:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 7892,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 7890,
"name": "mm",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7872,
"src": "381:2:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"id": 7891,
"name": "l",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7867,
"src": "386:1:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "381:6:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "377:10:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 7894,
"nodeType": "ExpressionStatement",
"src": "377:10:21"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 7897,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 7895,
"name": "mm",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7872,
"src": "401:2:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 7896,
"name": "l",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7867,
"src": "406:1:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "401:6:21",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 7902,
"nodeType": "IfStatement",
"src": "397:18:21",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 7900,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 7898,
"name": "h",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7869,
"src": "409:1:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "-=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "31",
"id": 7899,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "414:1:21",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "409:6:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 7901,
"nodeType": "ExpressionStatement",
"src": "409:6:21"
}
}
]
},
"documentation": null,
"id": 7904,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "fullMul",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 7865,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 7862,
"mutability": "mutable",
"name": "x",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 7904,
"src": "233:9:21",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 7861,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "233:7:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 7864,
"mutability": "mutable",
"name": "y",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 7904,
"src": "244:9:21",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 7863,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "244:7:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "232:22:21"
},
"returnParameters": {
"id": 7870,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 7867,
"mutability": "mutable",
"name": "l",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 7904,
"src": "278:9:21",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 7866,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "278:7:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 7869,
"mutability": "mutable",
"name": "h",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 7904,
"src": "289:9:21",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 7868,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "289:7:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "277:22:21"
},
"scope": 8079,
"src": "216:206:21",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 8015,
"nodeType": "Block",
"src": "539:352:21",
"statements": [
{
"assignments": [
7916
],
"declarations": [
{
"constant": false,
"id": 7916,
"mutability": "mutable",
"name": "pow2",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8015,
"src": "549:12:21",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 7915,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "549:7:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 7921,
"initialValue": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 7920,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 7917,
"name": "d",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7910,
"src": "564:1:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "&",
"rightExpression": {
"argumentTypes": null,
"id": 7919,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "-",
"prefix": true,
"src": "568:2:21",
"subExpression": {
"argumentTypes": null,
"id": 7918,
"name": "d",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7910,
"src": "569:1:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "564:6:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "549:21:21"
},
{
"expression": {
"argumentTypes": null,
"id": 7924,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 7922,
"name": "d",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7910,
"src": "580:1:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "/=",
"rightHandSide": {
"argumentTypes": null,
"id": 7923,
"name": "pow2",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7916,
"src": "585:4:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "580:9:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 7925,
"nodeType": "ExpressionStatement",
"src": "580:9:21"
},
{
"expression": {
"argumentTypes": null,
"id": 7928,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 7926,
"name": "l",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7906,
"src": "599:1:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "/=",
"rightHandSide": {
"argumentTypes": null,
"id": 7927,
"name": "pow2",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7916,
"src": "604:4:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "599:9:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 7929,
"nodeType": "ExpressionStatement",
"src": "599:9:21"
},
{
"expression": {
"argumentTypes": null,
"id": 7941,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 7930,
"name": "l",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7906,
"src": "618:1:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "+=",
"rightHandSide": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 7940,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 7931,
"name": "h",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7908,
"src": "623:1:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "*",
"rightExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 7938,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 7936,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 7933,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "-",
"prefix": true,
"src": "629:5:21",
"subExpression": {
"argumentTypes": null,
"id": 7932,
"name": "pow2",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7916,
"src": "630:4:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 7934,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "628:7:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"argumentTypes": null,
"id": 7935,
"name": "pow2",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7916,
"src": "638:4:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "628:14:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 7937,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "645:1:21",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "628:18:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 7939,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "627:20:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "623:24:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "618:29:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 7942,
"nodeType": "ExpressionStatement",
"src": "618:29:21"
},
{
"assignments": [
7944
],
"declarations": [
{
"constant": false,
"id": 7944,
"mutability": "mutable",
"name": "r",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8015,
"src": "657:9:21",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 7943,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "657:7:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 7946,
"initialValue": {
"argumentTypes": null,
"hexValue": "31",
"id": 7945,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "669:1:21",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"nodeType": "VariableDeclarationStatement",
"src": "657:13:21"
},
{
"expression": {
"argumentTypes": null,
"id": 7953,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 7947,
"name": "r",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7944,
"src": "680:1:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "*=",
"rightHandSide": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 7952,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 7948,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "685:1:21",
"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": 7951,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 7949,
"name": "d",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7910,
"src": "689:1:21",
"typeDescriptions": {
"typeIdentifier": "t_uint256",