{ "contractName": "Math", "abi": [], "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"details\":\"Standard math utilities missing in the Solidity language.\",\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/utils/math/Math.sol\":\"Math\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/math/Math.sol\":{\"keccak256\":\"0xe4455ac1eb7fc497bb7402579e7b4d64d928b846fce7d2b6fde06d366f21c2b3\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://cc8841b3cd48ad125e2f46323c8bad3aa0e88e399ec62acb9e57efa7e7c8058c\",\"dweb:/ipfs/QmSqE4mXHA2BXW58deDbXE8MTcsL5JSKNDbm23sVQxRLPS\"]}},\"version\":1}", "bytecode": "0x60566050600b82828239805160001a6073146043577f4e487b7100000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220e43ca308c8369fc15a2001a17a85cff4ee9a28330f9ae1e7ff2b25f2c22eb12f64736f6c63430008130033", "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220e43ca308c8369fc15a2001a17a85cff4ee9a28330f9ae1e7ff2b25f2c22eb12f64736f6c63430008130033", "immutableReferences": {}, "generatedSources": [], "deployedGeneratedSources": [], "sourceMap": "202:12582:11:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;", "deployedSourceMap": "202:12582:11:-:0;;;;;;;;", "source": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n // The surrounding unchecked block does not change this fact.\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1, \"Math: mulDiv overflow\");\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10 ** 64) {\n value /= 10 ** 64;\n result += 64;\n }\n if (value >= 10 ** 32) {\n value /= 10 ** 32;\n result += 32;\n }\n if (value >= 10 ** 16) {\n value /= 10 ** 16;\n result += 16;\n }\n if (value >= 10 ** 8) {\n value /= 10 ** 8;\n result += 8;\n }\n if (value >= 10 ** 4) {\n value /= 10 ** 4;\n result += 4;\n }\n if (value >= 10 ** 2) {\n value /= 10 ** 2;\n result += 2;\n }\n if (value >= 10 ** 1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);\n }\n }\n}\n", "sourcePath": "@openzeppelin/contracts/utils/math/Math.sol", "ast": { "absolutePath": "@openzeppelin/contracts/utils/math/Math.sol", "exportedSymbols": { "Math": [ 2691 ] }, "id": 2692, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 1827, "literals": [ "solidity", "^", "0.8", ".0" ], "nodeType": "PragmaDirective", "src": "103:23:11" }, { "abstract": false, "baseContracts": [], "canonicalName": "Math", "contractDependencies": [], "contractKind": "library", "documentation": { "id": 1828, "nodeType": "StructuredDocumentation", "src": "128:73:11", "text": " @dev Standard math utilities missing in the Solidity language." }, "fullyImplemented": true, "id": 2691, "linearizedBaseContracts": [ 2691 ], "name": "Math", "nameLocation": "210:4:11", "nodeType": "ContractDefinition", "nodes": [ { "canonicalName": "Math.Rounding", "id": 1832, "members": [ { "id": 1829, "name": "Down", "nameLocation": "245:4:11", "nodeType": "EnumValue", "src": "245:4:11" }, { "id": 1830, "name": "Up", "nameLocation": "287:2:11", "nodeType": "EnumValue", "src": "287:2:11" }, { "id": 1831, "name": "Zero", "nameLocation": "318:4:11", "nodeType": "EnumValue", "src": "318:4:11" } ], "name": "Rounding", "nameLocation": "226:8:11", "nodeType": "EnumDefinition", "src": "221:122:11" }, { "body": { "id": 1849, "nodeType": "Block", "src": "480:37:11", "statements": [ { "expression": { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1844, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1842, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1835, "src": "497:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "id": 1843, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1837, "src": "501:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "497:5:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseExpression": { "id": 1846, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1837, "src": "509:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 1847, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "Conditional", "src": "497:13:11", "trueExpression": { "id": 1845, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1835, "src": "505:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 1841, "id": 1848, "nodeType": "Return", "src": "490:20:11" } ] }, "documentation": { "id": 1833, "nodeType": "StructuredDocumentation", "src": "349:59:11", "text": " @dev Returns the largest of two numbers." }, "id": 1850, "implemented": true, "kind": "function", "modifiers": [], "name": "max", "nameLocation": "422:3:11", "nodeType": "FunctionDefinition", "parameters": { "id": 1838, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1835, "mutability": "mutable", "name": "a", "nameLocation": "434:1:11", "nodeType": "VariableDeclaration", "scope": 1850, "src": "426:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1834, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "426:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" }, { "constant": false, "id": 1837, "mutability": "mutable", "name": "b", "nameLocation": "445:1:11", "nodeType": "VariableDeclaration", "scope": 1850, "src": "437:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1836, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "437:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "425:22:11" }, "returnParameters": { "id": 1841, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1840, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 1850, "src": "471:7:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1839, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "471:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "470:9:11" }, "scope": 2691, "src": "413:104:11", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 1867, "nodeType": "Block", "src": "655:37:11", "statements": [ { "expression": { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1862, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1860, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1853, "src": "672:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "<", "rightExpression": { "id": 1861, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1855, "src": "676:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "672:5:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseExpression": { "id": 1864, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1855, "src": "684:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 1865, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "Conditional", "src": "672:13:11", "trueExpression": { "id": 1863, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1853, "src": "680:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 1859, "id": 1866, "nodeType": "Return", "src": "665:20:11" } ] }, "documentation": { "id": 1851, "nodeType": "StructuredDocumentation", "src": "523:60:11", "text": " @dev Returns the smallest of two numbers." }, "id": 1868, "implemented": true, "kind": "function", "modifiers": [], "name": "min", "nameLocation": "597:3:11", "nodeType": "FunctionDefinition", "parameters": { "id": 1856, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1853, "mutability": "mutable", "name": "a", "nameLocation": "609:1:11", "nodeType": "VariableDeclaration", "scope": 1868, "src": "601:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1852, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "601:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" }, { "constant": false, "id": 1855, "mutability": "mutable", "name": "b", "nameLocation": "620:1:11", "nodeType": "VariableDeclaration", "scope": 1868, "src": "612:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1854, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "612:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "600:22:11" }, "returnParameters": { "id": 1859, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1858, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 1868, "src": "646:7:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1857, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "646:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "645:9:11" }, "scope": 2691, "src": "588:104:11", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 1890, "nodeType": "Block", "src": "876:82:11", "statements": [ { "expression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1888, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "components": [ { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1880, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1878, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1871, "src": "931:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "&", "rightExpression": { "id": 1879, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1873, "src": "935:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "931:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "id": 1881, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "930:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1887, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "components": [ { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1884, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1882, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1871, "src": "941:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "^", "rightExpression": { "id": 1883, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1873, "src": "945:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "941:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "id": 1885, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "940:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "hexValue": "32", "id": 1886, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "950:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2" }, "value": "2" }, "src": "940:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "930:21:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 1877, "id": 1889, "nodeType": "Return", "src": "923:28:11" } ] }, "documentation": { "id": 1869, "nodeType": "StructuredDocumentation", "src": "698:102:11", "text": " @dev Returns the average of two numbers. The result is rounded towards\n zero." }, "id": 1891, "implemented": true, "kind": "function", "modifiers": [], "name": "average", "nameLocation": "814:7:11", "nodeType": "FunctionDefinition", "parameters": { "id": 1874, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1871, "mutability": "mutable", "name": "a", "nameLocation": "830:1:11", "nodeType": "VariableDeclaration", "scope": 1891, "src": "822:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1870, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "822:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" }, { "constant": false, "id": 1873, "mutability": "mutable", "name": "b", "nameLocation": "841:1:11", "nodeType": "VariableDeclaration", "scope": 1891, "src": "833:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1872, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "833:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "821:22:11" }, "returnParameters": { "id": 1877, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1876, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 1891, "src": "867:7:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1875, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "867:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "866:9:11" }, "scope": 2691, "src": "805:153:11", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 1915, "nodeType": "Block", "src": "1228:123:11", "statements": [ { "expression": { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1903, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1901, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1894, "src": "1316:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "hexValue": "30", "id": 1902, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1321:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "1316:6:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1912, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1910, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "components": [ { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1907, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1905, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1894, "src": "1330:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": { "hexValue": "31", "id": 1906, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1334:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "1330:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "id": 1908, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "1329:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "id": 1909, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1896, "src": "1339:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1329:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "hexValue": "31", "id": 1911, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1343:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "1329:15:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 1913, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "Conditional", "src": "1316:28:11", "trueExpression": { "hexValue": "30", "id": 1904, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1325:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 1900, "id": 1914, "nodeType": "Return", "src": "1309:35:11" } ] }, "documentation": { "id": 1892, "nodeType": "StructuredDocumentation", "src": "964:188:11", "text": " @dev Returns the ceiling of the division of two numbers.\n This differs from standard division with `/` in that it rounds up instead\n of rounding down." }, "id": 1916, "implemented": true, "kind": "function", "modifiers": [], "name": "ceilDiv", "nameLocation": "1166:7:11", "nodeType": "FunctionDefinition", "parameters": { "id": 1897, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1894, "mutability": "mutable", "name": "a", "nameLocation": "1182:1:11", "nodeType": "VariableDeclaration", "scope": 1916, "src": "1174:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1893, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1174:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" }, { "constant": false, "id": 1896, "mutability": "mutable", "name": "b", "nameLocation": "1193:1:11", "nodeType": "VariableDeclaration", "scope": 1916, "src": "1185:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1895, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1185:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "1173:22:11" }, "returnParameters": { "id": 1900, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1899, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 1916, "src": "1219:7:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1898, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1219:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "1218:9:11" }, "scope": 2691, "src": "1157:194:11", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 2038, "nodeType": "Block", "src": "1765:4115:11", "statements": [ { "id": 2037, "nodeType": "UncheckedBlock", "src": "1775:4099:11", "statements": [ { "assignments": [ 1929 ], "declarations": [ { "constant": false, "id": 1929, "mutability": "mutable", "name": "prod0", "nameLocation": "2104:5:11", "nodeType": "VariableDeclaration", "scope": 2037, "src": "2096:13:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1928, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2096:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 1930, "nodeType": "VariableDeclarationStatement", "src": "2096:13:11" }, { "assignments": [ 1932 ], "declarations": [ { "constant": false, "id": 1932, "mutability": "mutable", "name": "prod1", "nameLocation": "2176:5:11", "nodeType": "VariableDeclaration", "scope": 2037, "src": "2168:13:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1931, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2168:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 1933, "nodeType": "VariableDeclarationStatement", "src": "2168:13:11" }, { "AST": { "nodeType": "YulBlock", "src": "2248:157:11", "statements": [ { "nodeType": "YulVariableDeclaration", "src": "2266:30:11", "value": { "arguments": [ { "name": "x", "nodeType": "YulIdentifier", "src": "2283:1:11" }, { "name": "y", "nodeType": "YulIdentifier", "src": "2286:1:11" }, { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "2293:1:11", "type": "", "value": "0" } ], "functionName": { "name": "not", "nodeType": "YulIdentifier", "src": "2289:3:11" }, "nodeType": "YulFunctionCall", "src": "2289:6:11" } ], "functionName": { "name": "mulmod", "nodeType": "YulIdentifier", "src": "2276:6:11" }, "nodeType": "YulFunctionCall", "src": "2276:20:11" }, "variables": [ { "name": "mm", "nodeType": "YulTypedName", "src": "2270:2:11", "type": "" } ] }, { "nodeType": "YulAssignment", "src": "2313:18:11", "value": { "arguments": [ { "name": "x", "nodeType": "YulIdentifier", "src": "2326:1:11" }, { "name": "y", "nodeType": "YulIdentifier", "src": "2329:1:11" } ], "functionName": { "name": "mul", "nodeType": "YulIdentifier", "src": "2322:3:11" }, "nodeType": "YulFunctionCall", "src": "2322:9:11" }, "variableNames": [ { "name": "prod0", "nodeType": "YulIdentifier", "src": "2313:5:11" } ] }, { "nodeType": "YulAssignment", "src": "2348:43:11", "value": { "arguments": [ { "arguments": [ { "name": "mm", "nodeType": "YulIdentifier", "src": "2365:2:11" }, { "name": "prod0", "nodeType": "YulIdentifier", "src": "2369:5:11" } ], "functionName": { "name": "sub", "nodeType": "YulIdentifier", "src": "2361:3:11" }, "nodeType": "YulFunctionCall", "src": "2361:14:11" }, { "arguments": [ { "name": "mm", "nodeType": "YulIdentifier", "src": "2380:2:11" }, { "name": "prod0", "nodeType": "YulIdentifier", "src": "2384:5:11" } ], "functionName": { "name": "lt", "nodeType": "YulIdentifier", "src": "2377:2:11" }, "nodeType": "YulFunctionCall", "src": "2377:13:11" } ], "functionName": { "name": "sub", "nodeType": "YulIdentifier", "src": "2357:3:11" }, "nodeType": "YulFunctionCall", "src": "2357:34:11" }, "variableNames": [ { "name": "prod1", "nodeType": "YulIdentifier", "src": "2348:5:11" } ] } ] }, "evmVersion": "paris", "externalReferences": [ { "declaration": 1929, "isOffset": false, "isSlot": false, "src": "2313:5:11", "valueSize": 1 }, { "declaration": 1929, "isOffset": false, "isSlot": false, "src": "2369:5:11", "valueSize": 1 }, { "declaration": 1929, "isOffset": false, "isSlot": false, "src": "2384:5:11", "valueSize": 1 }, { "declaration": 1932, "isOffset": false, "isSlot": false, "src": "2348:5:11", "valueSize": 1 }, { "declaration": 1919, "isOffset": false, "isSlot": false, "src": "2283:1:11", "valueSize": 1 }, { "declaration": 1919, "isOffset": false, "isSlot": false, "src": "2326:1:11", "valueSize": 1 }, { "declaration": 1921, "isOffset": false, "isSlot": false, "src": "2286:1:11", "valueSize": 1 }, { "declaration": 1921, "isOffset": false, "isSlot": false, "src": "2329:1:11", "valueSize": 1 } ], "id": 1934, "nodeType": "InlineAssembly", "src": "2239:166:11" }, { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1937, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1935, "name": "prod1", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1932, "src": "2486:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "hexValue": "30", "id": 1936, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2495:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "2486:10:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 1943, "nodeType": "IfStatement", "src": "2482:368:11", "trueBody": { "id": 1942, "nodeType": "Block", "src": "2498:352:11", "statements": [ { "expression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1940, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1938, "name": "prod0", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1929, "src": "2816:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "id": 1939, "name": "denominator", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1923, "src": "2824:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "2816:19:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 1927, "id": 1941, "nodeType": "Return", "src": "2809:26:11" } ] } }, { "expression": { "arguments": [ { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1947, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1945, "name": "denominator", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1923, "src": "2960:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "id": 1946, "name": "prod1", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1932, "src": "2974:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "2960:19:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "hexValue": "4d6174683a206d756c446976206f766572666c6f77", "id": 1948, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "2981:23:11", "typeDescriptions": { "typeIdentifier": "t_stringliteral_d87093691d63b122ac2c14d1b11554b287e2431cf2b03550b3be7cffb0f86851", "typeString": "literal_string \"Math: mulDiv overflow\"" }, "value": "Math: mulDiv overflow" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_d87093691d63b122ac2c14d1b11554b287e2431cf2b03550b3be7cffb0f86851", "typeString": "literal_string \"Math: mulDiv overflow\"" } ], "id": 1944, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 4294967278, 4294967278 ], "referencedDeclaration": 4294967278, "src": "2952:7:11", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 1949, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "2952:53:11", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1950, "nodeType": "ExpressionStatement", "src": "2952:53:11" }, { "assignments": [ 1952 ], "declarations": [ { "constant": false, "id": 1952, "mutability": "mutable", "name": "remainder", "nameLocation": "3269:9:11", "nodeType": "VariableDeclaration", "scope": 2037, "src": "3261:17:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1951, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3261:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 1953, "nodeType": "VariableDeclarationStatement", "src": "3261:17:11" }, { "AST": { "nodeType": "YulBlock", "src": "3301:291:11", "statements": [ { "nodeType": "YulAssignment", "src": "3370:38:11", "value": { "arguments": [ { "name": "x", "nodeType": "YulIdentifier", "src": "3390:1:11" }, { "name": "y", "nodeType": "YulIdentifier", "src": "3393:1:11" }, { "name": "denominator", "nodeType": "YulIdentifier", "src": "3396:11:11" } ], "functionName": { "name": "mulmod", "nodeType": "YulIdentifier", "src": "3383:6:11" }, "nodeType": "YulFunctionCall", "src": "3383:25:11" }, "variableNames": [ { "name": "remainder", "nodeType": "YulIdentifier", "src": "3370:9:11" } ] }, { "nodeType": "YulAssignment", "src": "3490:41:11", "value": { "arguments": [ { "name": "prod1", "nodeType": "YulIdentifier", "src": "3503:5:11" }, { "arguments": [ { "name": "remainder", "nodeType": "YulIdentifier", "src": "3513:9:11" }, { "name": "prod0", "nodeType": "YulIdentifier", "src": "3524:5:11" } ], "functionName": { "name": "gt", "nodeType": "YulIdentifier", "src": "3510:2:11" }, "nodeType": "YulFunctionCall", "src": "3510:20:11" } ], "functionName": { "name": "sub", "nodeType": "YulIdentifier", "src": "3499:3:11" }, "nodeType": "YulFunctionCall", "src": "3499:32:11" }, "variableNames": [ { "name": "prod1", "nodeType": "YulIdentifier", "src": "3490:5:11" } ] }, { "nodeType": "YulAssignment", "src": "3548:30:11", "value": { "arguments": [ { "name": "prod0", "nodeType": "YulIdentifier", "src": "3561:5:11" }, { "name": "remainder", "nodeType": "YulIdentifier", "src": "3568:9:11" } ], "functionName": { "name": "sub", "nodeType": "YulIdentifier", "src": "3557:3:11" }, "nodeType": "YulFunctionCall", "src": "3557:21:11" }, "variableNames": [ { "name": "prod0", "nodeType": "YulIdentifier", "src": "3548:5:11" } ] } ] }, "evmVersion": "paris", "externalReferences": [ { "declaration": 1923, "isOffset": false, "isSlot": false, "src": "3396:11:11", "valueSize": 1 }, { "declaration": 1929, "isOffset": false, "isSlot": false, "src": "3524:5:11", "valueSize": 1 }, { "declaration": 1929, "isOffset": false, "isSlot": false, "src": "3548:5:11", "valueSize": 1 }, { "declaration": 1929, "isOffset": false, "isSlot": false, "src": "3561:5:11", "valueSize": 1 }, { "declaration": 1932, "isOffset": false, "isSlot": false, "src": "3490:5:11", "valueSize": 1 }, { "declaration": 1932, "isOffset": false, "isSlot": false, "src": "3503:5:11", "valueSize": 1 }, { "declaration": 1952, "isOffset": false, "isSlot": false, "src": "3370:9:11", "valueSize": 1 }, { "declaration": 1952, "isOffset": false, "isSlot": false, "src": "3513:9:11", "valueSize": 1 }, { "declaration": 1952, "isOffset": false, "isSlot": false, "src": "3568:9:11", "valueSize": 1 }, { "declaration": 1919, "isOffset": false, "isSlot": false, "src": "3390:1:11", "valueSize": 1 }, { "declaration": 1921, "isOffset": false, "isSlot": false, "src": "3393:1:11", "valueSize": 1 } ], "id": 1954, "nodeType": "InlineAssembly", "src": "3292:300:11" }, { "assignments": [ 1956 ], "declarations": [ { "constant": false, "id": 1956, "mutability": "mutable", "name": "twos", "nameLocation": "3907:4:11", "nodeType": "VariableDeclaration", "scope": 2037, "src": "3899:12:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1955, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3899:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 1964, "initialValue": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1963, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1957, "name": "denominator", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1923, "src": "3914:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "&", "rightExpression": { "components": [ { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1961, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1959, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "~", "prefix": true, "src": "3929:12:11", "subExpression": { "id": 1958, "name": "denominator", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1923, "src": "3930:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "hexValue": "31", "id": 1960, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "3944:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "3929:16:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "id": 1962, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "3928:18:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "3914:32:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "3899:47:11" }, { "AST": { "nodeType": "YulBlock", "src": "3969:362:11", "statements": [ { "nodeType": "YulAssignment", "src": "4034:37:11", "value": { "arguments": [ { "name": "denominator", "nodeType": "YulIdentifier", "src": "4053:11:11" }, { "name": "twos", "nodeType": "YulIdentifier", "src": "4066:4:11" } ], "functionName": { "name": "div", "nodeType": "YulIdentifier", "src": "4049:3:11" }, "nodeType": "YulFunctionCall", "src": "4049:22:11" }, "variableNames": [ { "name": "denominator", "nodeType": "YulIdentifier", "src": "4034:11:11" } ] }, { "nodeType": "YulAssignment", "src": "4138:25:11", "value": { "arguments": [ { "name": "prod0", "nodeType": "YulIdentifier", "src": "4151:5:11" }, { "name": "twos", "nodeType": "YulIdentifier", "src": "4158:4:11" } ], "functionName": { "name": "div", "nodeType": "YulIdentifier", "src": "4147:3:11" }, "nodeType": "YulFunctionCall", "src": "4147:16:11" }, "variableNames": [ { "name": "prod0", "nodeType": "YulIdentifier", "src": "4138:5:11" } ] }, { "nodeType": "YulAssignment", "src": "4278:39:11", "value": { "arguments": [ { "arguments": [ { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "4298:1:11", "type": "", "value": "0" }, { "name": "twos", "nodeType": "YulIdentifier", "src": "4301:4:11" } ], "functionName": { "name": "sub", "nodeType": "YulIdentifier", "src": "4294:3:11" }, "nodeType": "YulFunctionCall", "src": "4294:12:11" }, { "name": "twos", "nodeType": "YulIdentifier", "src": "4308:4:11" } ], "functionName": { "name": "div", "nodeType": "YulIdentifier", "src": "4290:3:11" }, "nodeType": "YulFunctionCall", "src": "4290:23:11" }, { "kind": "number", "nodeType": "YulLiteral", "src": "4315:1:11", "type": "", "value": "1" } ], "functionName": { "name": "add", "nodeType": "YulIdentifier", "src": "4286:3:11" }, "nodeType": "YulFunctionCall", "src": "4286:31:11" }, "variableNames": [ { "name": "twos", "nodeType": "YulIdentifier", "src": "4278:4:11" } ] } ] }, "evmVersion": "paris", "externalReferences": [ { "declaration": 1923, "isOffset": false, "isSlot": false, "src": "4034:11:11", "valueSize": 1 }, { "declaration": 1923, "isOffset": false, "isSlot": false, "src": "4053:11:11", "valueSize": 1 }, { "declaration": 1929, "isOffset": false, "isSlot": false, "src": "4138:5:11", "valueSize": 1 }, { "declaration": 1929, "isOffset": false, "isSlot": false, "src": "4151:5:11", "valueSize": 1 }, { "declaration": 1956, "isOffset": false, "isSlot": false, "src": "4066:4:11", "valueSize": 1 }, { "declaration": 1956, "isOffset": false, "isSlot": false, "src": "4158:4:11", "valueSize": 1 }, { "declaration": 1956, "isOffset": false, "isSlot": false, "src": "4278:4:11", "valueSize": 1 }, { "declaration": 1956, "isOffset": false, "isSlot": false, "src": "4301:4:11", "valueSize": 1 }, { "declaration": 1956, "isOffset": false, "isSlot": false, "src": "4308:4:11", "valueSize": 1 } ], "id": 1965, "nodeType": "InlineAssembly", "src": "3960:371:11" }, { "expression": { "id": 1970, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 1966, "name": "prod0", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1929, "src": "4397:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "|=", "rightHandSide": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1969, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1967, "name": "prod1", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1932, "src": "4406:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "id": 1968, "name": "twos", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1956, "src": "4414:4:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "4406:12:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "4397:21:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 1971, "nodeType": "ExpressionStatement", "src": "4397:21:11" }, { "assignments": [ 1973 ], "declarations": [ { "constant": false, "id": 1973, "mutability": "mutable", "name": "inverse", "nameLocation": "4744:7:11", "nodeType": "VariableDeclaration", "scope": 2037, "src": "4736:15:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1972, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "4736:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 1980, "initialValue": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1979, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "components": [ { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1976, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "hexValue": "33", "id": 1974, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "4755:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_3_by_1", "typeString": "int_const 3" }, "value": "3" }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "id": 1975, "name": "denominator", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1923, "src": "4759:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "4755:15:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "id": 1977, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "4754:17:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "^", "rightExpression": { "hexValue": "32", "id": 1978, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "4774:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2" }, "value": "2" }, "src": "4754:21:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "4736:39:11" }, { "expression": { "id": 1987, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 1981, "name": "inverse", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1973, "src": "4992:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "*=", "rightHandSide": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1986, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "hexValue": "32", "id": 1982, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "5003:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2" }, "value": "2" }, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1985, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1983, "name": "denominator", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1923, "src": "5007:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "id": 1984, "name": "inverse", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1973, "src": "5021:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "5007:21:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "5003:25:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "4992:36:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 1988, "nodeType": "ExpressionStatement", "src": "4992:36:11" }, { "expression": { "id": 1995, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 1989, "name": "inverse", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1973, "src": "5061:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "*=", "rightHandSide": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1994, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "hexValue": "32", "id": 1990, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "5072:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2" }, "value": "2" }, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1993, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1991, "name": "denominator", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1923, "src": "5076:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "id": 1992, "name": "inverse", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1973, "src": "5090:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "5076:21:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "5072:25:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "5061:36:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 1996, "nodeType": "ExpressionStatement", "src": "5061:36:11" }, { "expression": { "id": 2003, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 1997, "name": "inverse", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1973, "src": "5131:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "*=", "rightHandSide": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2002, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "hexValue": "32", "id": 1998, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "5142:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2" }, "value": "2" }, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2001, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1999, "name": "denominator", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1923, "src": "5146:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "id": 2000, "name": "inverse", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1973, "src": "5160:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "5146:21:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "5142:25:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "5131:36:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2004, "nodeType": "ExpressionStatement", "src": "5131:36:11" }, { "expression": { "id": 2011, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2005, "name": "inverse", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1973, "src": "5201:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "*=", "rightHandSide": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2010, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "hexValue": "32", "id": 2006, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "5212:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2" }, "value": "2" }, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2009, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2007, "name": "denominator", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1923, "src": "5216:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "id": 2008, "name": "inverse", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1973, "src": "5230:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "5216:21:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "5212:25:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "5201:36:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2012, "nodeType": "ExpressionStatement", "src": "5201:36:11" }, { "expression": { "id": 2019, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2013, "name": "inverse", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1973, "src": "5271:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "*=", "rightHandSide": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2018, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "hexValue": "32", "id": 2014, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "5282:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2" }, "value": "2" }, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2017, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2015, "name": "denominator", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1923, "src": "5286:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "id": 2016, "name": "inverse", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1973, "src": "5300:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "5286:21:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "5282:25:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "5271:36:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2020, "nodeType": "ExpressionStatement", "src": "5271:36:11" }, { "expression": { "id": 2027, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2021, "name": "inverse", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1973, "src": "5342:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "*=", "rightHandSide": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2026, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "hexValue": "32", "id": 2022, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "5353:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2" }, "value": "2" }, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2025, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2023, "name": "denominator", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1923, "src": "5357:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "id": 2024, "name": "inverse", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1973, "src": "5371:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "5357:21:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "5353:25:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "5342:36:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2028, "nodeType": "ExpressionStatement", "src": "5342:36:11" }, { "expression": { "id": 2033, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2029, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1926, "src": "5812:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2032, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2030, "name": "prod0", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1929, "src": "5821:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "id": 2031, "name": "inverse", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1973, "src": "5829:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "5821:15:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "5812:24:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2034, "nodeType": "ExpressionStatement", "src": "5812:24:11" }, { "expression": { "id": 2035, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1926, "src": "5857:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 1927, "id": 2036, "nodeType": "Return", "src": "5850:13:11" } ] } ] }, "documentation": { "id": 1917, "nodeType": "StructuredDocumentation", "src": "1357:305:11", "text": " @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n with further edits by Uniswap Labs also under MIT license." }, "id": 2039, "implemented": true, "kind": "function", "modifiers": [], "name": "mulDiv", "nameLocation": "1676:6:11", "nodeType": "FunctionDefinition", "parameters": { "id": 1924, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1919, "mutability": "mutable", "name": "x", "nameLocation": "1691:1:11", "nodeType": "VariableDeclaration", "scope": 2039, "src": "1683:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1918, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1683:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" }, { "constant": false, "id": 1921, "mutability": "mutable", "name": "y", "nameLocation": "1702:1:11", "nodeType": "VariableDeclaration", "scope": 2039, "src": "1694:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1920, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1694:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" }, { "constant": false, "id": 1923, "mutability": "mutable", "name": "denominator", "nameLocation": "1713:11:11", "nodeType": "VariableDeclaration", "scope": 2039, "src": "1705:19:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1922, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1705:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "1682:43:11" }, "returnParameters": { "id": 1927, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1926, "mutability": "mutable", "name": "result", "nameLocation": "1757:6:11", "nodeType": "VariableDeclaration", "scope": 2039, "src": "1749:14:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1925, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1749:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "1748:16:11" }, "scope": 2691, "src": "1667:4213:11", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 2082, "nodeType": "Block", "src": "6122:189:11", "statements": [ { "assignments": [ 2055 ], "declarations": [ { "constant": false, "id": 2055, "mutability": "mutable", "name": "result", "nameLocation": "6140:6:11", "nodeType": "VariableDeclaration", "scope": 2082, "src": "6132:14:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2054, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "6132:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 2061, "initialValue": { "arguments": [ { "id": 2057, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2042, "src": "6156:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "id": 2058, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2044, "src": "6159:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "id": 2059, "name": "denominator", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2046, "src": "6162:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 2056, "name": "mulDiv", "nodeType": "Identifier", "overloadedDeclarations": [ 2039, 2083 ], "referencedDeclaration": 2039, "src": "6149:6:11", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", "typeString": "function (uint256,uint256,uint256) pure returns (uint256)" } }, "id": 2060, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "6149:25:11", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "6132:42:11" }, { "condition": { "commonType": { "typeIdentifier": "t_bool", "typeString": "bool" }, "id": 2073, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "commonType": { "typeIdentifier": "t_enum$_Rounding_$1832", "typeString": "enum Math.Rounding" }, "id": 2065, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2062, "name": "rounding", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2049, "src": "6188:8:11", "typeDescriptions": { "typeIdentifier": "t_enum$_Rounding_$1832", "typeString": "enum Math.Rounding" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "expression": { "id": 2063, "name": "Rounding", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1832, "src": "6200:8:11", "typeDescriptions": { "typeIdentifier": "t_type$_t_enum$_Rounding_$1832_$", "typeString": "type(enum Math.Rounding)" } }, "id": 2064, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "memberLocation": "6209:2:11", "memberName": "Up", "nodeType": "MemberAccess", "referencedDeclaration": 1830, "src": "6200:11:11", "typeDescriptions": { "typeIdentifier": "t_enum$_Rounding_$1832", "typeString": "enum Math.Rounding" } }, "src": "6188:23:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "BinaryOperation", "operator": "&&", "rightExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2072, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "arguments": [ { "id": 2067, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2042, "src": "6222:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "id": 2068, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2044, "src": "6225:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "id": 2069, "name": "denominator", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2046, "src": "6228:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 2066, "name": "mulmod", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4294967280, "src": "6215:6:11", "typeDescriptions": { "typeIdentifier": "t_function_mulmod_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", "typeString": "function (uint256,uint256,uint256) pure returns (uint256)" } }, "id": 2070, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "6215:25:11", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "hexValue": "30", "id": 2071, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "6243:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "6215:29:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "src": "6188:56:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 2079, "nodeType": "IfStatement", "src": "6184:98:11", "trueBody": { "id": 2078, "nodeType": "Block", "src": "6246:36:11", "statements": [ { "expression": { "id": 2076, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2074, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2055, "src": "6260:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "+=", "rightHandSide": { "hexValue": "31", "id": 2075, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "6270:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "6260:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2077, "nodeType": "ExpressionStatement", "src": "6260:11:11" } ] } }, { "expression": { "id": 2080, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2055, "src": "6298:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 2053, "id": 2081, "nodeType": "Return", "src": "6291:13:11" } ] }, "documentation": { "id": 2040, "nodeType": "StructuredDocumentation", "src": "5886:121:11", "text": " @notice Calculates x * y / denominator with full precision, following the selected rounding direction." }, "id": 2083, "implemented": true, "kind": "function", "modifiers": [], "name": "mulDiv", "nameLocation": "6021:6:11", "nodeType": "FunctionDefinition", "parameters": { "id": 2050, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2042, "mutability": "mutable", "name": "x", "nameLocation": "6036:1:11", "nodeType": "VariableDeclaration", "scope": 2083, "src": "6028:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2041, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "6028:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" }, { "constant": false, "id": 2044, "mutability": "mutable", "name": "y", "nameLocation": "6047:1:11", "nodeType": "VariableDeclaration", "scope": 2083, "src": "6039:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2043, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "6039:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" }, { "constant": false, "id": 2046, "mutability": "mutable", "name": "denominator", "nameLocation": "6058:11:11", "nodeType": "VariableDeclaration", "scope": 2083, "src": "6050:19:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2045, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "6050:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" }, { "constant": false, "id": 2049, "mutability": "mutable", "name": "rounding", "nameLocation": "6080:8:11", "nodeType": "VariableDeclaration", "scope": 2083, "src": "6071:17:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_enum$_Rounding_$1832", "typeString": "enum Math.Rounding" }, "typeName": { "id": 2048, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 2047, "name": "Rounding", "nameLocations": [ "6071:8:11" ], "nodeType": "IdentifierPath", "referencedDeclaration": 1832, "src": "6071:8:11" }, "referencedDeclaration": 1832, "src": "6071:8:11", "typeDescriptions": { "typeIdentifier": "t_enum$_Rounding_$1832", "typeString": "enum Math.Rounding" } }, "visibility": "internal" } ], "src": "6027:62:11" }, "returnParameters": { "id": 2053, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2052, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 2083, "src": "6113:7:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2051, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "6113:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "6112:9:11" }, "scope": 2691, "src": "6012:299:11", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 2194, "nodeType": "Block", "src": "6587:1585:11", "statements": [ { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2093, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2091, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2086, "src": "6601:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "hexValue": "30", "id": 2092, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "6606:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "6601:6:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 2097, "nodeType": "IfStatement", "src": "6597:45:11", "trueBody": { "id": 2096, "nodeType": "Block", "src": "6609:33:11", "statements": [ { "expression": { "hexValue": "30", "id": 2094, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "6630:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "functionReturnParameters": 2090, "id": 2095, "nodeType": "Return", "src": "6623:8:11" } ] } }, { "assignments": [ 2099 ], "declarations": [ { "constant": false, "id": 2099, "mutability": "mutable", "name": "result", "nameLocation": "7329:6:11", "nodeType": "VariableDeclaration", "scope": 2194, "src": "7321:14:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2098, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "7321:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 2108, "initialValue": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2107, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "hexValue": "31", "id": 2100, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "7338:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "nodeType": "BinaryOperation", "operator": "<<", "rightExpression": { "components": [ { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2105, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "arguments": [ { "id": 2102, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2086, "src": "7349:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 2101, "name": "log2", "nodeType": "Identifier", "overloadedDeclarations": [ 2363, 2399 ], "referencedDeclaration": 2363, "src": "7344:4:11", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_uint256_$", "typeString": "function (uint256) pure returns (uint256)" } }, "id": 2103, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "7344:7:11", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">>", "rightExpression": { "hexValue": "31", "id": 2104, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "7355:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "7344:12:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "id": 2106, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "7343:14:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "7338:19:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "7321:36:11" }, { "id": 2193, "nodeType": "UncheckedBlock", "src": "7758:408:11", "statements": [ { "expression": { "id": 2118, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2109, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2099, "src": "7782:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2117, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "components": [ { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2114, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2110, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2099, "src": "7792:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2113, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2111, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2086, "src": "7801:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "id": 2112, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2099, "src": "7805:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "7801:10:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "7792:19:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "id": 2115, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "7791:21:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">>", "rightExpression": { "hexValue": "31", "id": 2116, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "7816:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "7791:26:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "7782:35:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2119, "nodeType": "ExpressionStatement", "src": "7782:35:11" }, { "expression": { "id": 2129, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2120, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2099, "src": "7831:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2128, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "components": [ { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2125, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2121, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2099, "src": "7841:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2124, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2122, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2086, "src": "7850:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "id": 2123, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2099, "src": "7854:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "7850:10:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "7841:19:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "id": 2126, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "7840:21:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">>", "rightExpression": { "hexValue": "31", "id": 2127, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "7865:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "7840:26:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "7831:35:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2130, "nodeType": "ExpressionStatement", "src": "7831:35:11" }, { "expression": { "id": 2140, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2131, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2099, "src": "7880:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2139, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "components": [ { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2136, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2132, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2099, "src": "7890:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2135, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2133, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2086, "src": "7899:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "id": 2134, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2099, "src": "7903:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "7899:10:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "7890:19:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "id": 2137, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "7889:21:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">>", "rightExpression": { "hexValue": "31", "id": 2138, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "7914:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "7889:26:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "7880:35:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2141, "nodeType": "ExpressionStatement", "src": "7880:35:11" }, { "expression": { "id": 2151, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2142, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2099, "src": "7929:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2150, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "components": [ { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2147, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2143, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2099, "src": "7939:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2146, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2144, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2086, "src": "7948:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "id": 2145, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2099, "src": "7952:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "7948:10:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "7939:19:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "id": 2148, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "7938:21:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">>", "rightExpression": { "hexValue": "31", "id": 2149, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "7963:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "7938:26:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "7929:35:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2152, "nodeType": "ExpressionStatement", "src": "7929:35:11" }, { "expression": { "id": 2162, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2153, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2099, "src": "7978:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2161, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "components": [ { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2158, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2154, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2099, "src": "7988:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2157, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2155, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2086, "src": "7997:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "id": 2156, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2099, "src": "8001:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "7997:10:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "7988:19:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "id": 2159, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "7987:21:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">>", "rightExpression": { "hexValue": "31", "id": 2160, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "8012:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "7987:26:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "7978:35:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2163, "nodeType": "ExpressionStatement", "src": "7978:35:11" }, { "expression": { "id": 2173, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2164, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2099, "src": "8027:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2172, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "components": [ { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2169, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2165, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2099, "src": "8037:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2168, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2166, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2086, "src": "8046:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "id": 2167, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2099, "src": "8050:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "8046:10:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "8037:19:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "id": 2170, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "8036:21:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">>", "rightExpression": { "hexValue": "31", "id": 2171, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "8061:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "8036:26:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "8027:35:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2174, "nodeType": "ExpressionStatement", "src": "8027:35:11" }, { "expression": { "id": 2184, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2175, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2099, "src": "8076:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2183, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "components": [ { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2180, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2176, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2099, "src": "8086:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2179, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2177, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2086, "src": "8095:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "id": 2178, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2099, "src": "8099:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "8095:10:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "8086:19:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "id": 2181, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "8085:21:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">>", "rightExpression": { "hexValue": "31", "id": 2182, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "8110:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "8085:26:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "8076:35:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2185, "nodeType": "ExpressionStatement", "src": "8076:35:11" }, { "expression": { "arguments": [ { "id": 2187, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2099, "src": "8136:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2190, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2188, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2086, "src": "8144:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "id": 2189, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2099, "src": "8148:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "8144:10:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 2186, "name": "min", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1868, "src": "8132:3:11", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", "typeString": "function (uint256,uint256) pure returns (uint256)" } }, "id": 2191, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "8132:23:11", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 2090, "id": 2192, "nodeType": "Return", "src": "8125:30:11" } ] } ] }, "documentation": { "id": 2084, "nodeType": "StructuredDocumentation", "src": "6317:208:11", "text": " @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11)." }, "id": 2195, "implemented": true, "kind": "function", "modifiers": [], "name": "sqrt", "nameLocation": "6539:4:11", "nodeType": "FunctionDefinition", "parameters": { "id": 2087, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2086, "mutability": "mutable", "name": "a", "nameLocation": "6552:1:11", "nodeType": "VariableDeclaration", "scope": 2195, "src": "6544:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2085, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "6544:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "6543:11:11" }, "returnParameters": { "id": 2090, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2089, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 2195, "src": "6578:7:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2088, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "6578:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "6577:9:11" }, "scope": 2691, "src": "6530:1642:11", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 2230, "nodeType": "Block", "src": "8348:161:11", "statements": [ { "id": 2229, "nodeType": "UncheckedBlock", "src": "8358:145:11", "statements": [ { "assignments": [ 2207 ], "declarations": [ { "constant": false, "id": 2207, "mutability": "mutable", "name": "result", "nameLocation": "8390:6:11", "nodeType": "VariableDeclaration", "scope": 2229, "src": "8382:14:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2206, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "8382:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 2211, "initialValue": { "arguments": [ { "id": 2209, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2198, "src": "8404:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 2208, "name": "sqrt", "nodeType": "Identifier", "overloadedDeclarations": [ 2195, 2231 ], "referencedDeclaration": 2195, "src": "8399:4:11", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_uint256_$", "typeString": "function (uint256) pure returns (uint256)" } }, "id": 2210, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "8399:7:11", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "8382:24:11" }, { "expression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2227, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2212, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2207, "src": "8427:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "components": [ { "condition": { "commonType": { "typeIdentifier": "t_bool", "typeString": "bool" }, "id": 2222, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "commonType": { "typeIdentifier": "t_enum$_Rounding_$1832", "typeString": "enum Math.Rounding" }, "id": 2216, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2213, "name": "rounding", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2201, "src": "8437:8:11", "typeDescriptions": { "typeIdentifier": "t_enum$_Rounding_$1832", "typeString": "enum Math.Rounding" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "expression": { "id": 2214, "name": "Rounding", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1832, "src": "8449:8:11", "typeDescriptions": { "typeIdentifier": "t_type$_t_enum$_Rounding_$1832_$", "typeString": "type(enum Math.Rounding)" } }, "id": 2215, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "memberLocation": "8458:2:11", "memberName": "Up", "nodeType": "MemberAccess", "referencedDeclaration": 1830, "src": "8449:11:11", "typeDescriptions": { "typeIdentifier": "t_enum$_Rounding_$1832", "typeString": "enum Math.Rounding" } }, "src": "8437:23:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "BinaryOperation", "operator": "&&", "rightExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2221, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2219, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2217, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2207, "src": "8464:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "id": 2218, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2207, "src": "8473:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "8464:15:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "<", "rightExpression": { "id": 2220, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2198, "src": "8482:1:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "8464:19:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "src": "8437:46:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseExpression": { "hexValue": "30", "id": 2224, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "8490:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "id": 2225, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "Conditional", "src": "8437:54:11", "trueExpression": { "hexValue": "31", "id": 2223, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "8486:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } } ], "id": 2226, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "8436:56:11", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "src": "8427:65:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 2205, "id": 2228, "nodeType": "Return", "src": "8420:72:11" } ] } ] }, "documentation": { "id": 2196, "nodeType": "StructuredDocumentation", "src": "8178:89:11", "text": " @notice Calculates sqrt(a), following the selected rounding direction." }, "id": 2231, "implemented": true, "kind": "function", "modifiers": [], "name": "sqrt", "nameLocation": "8281:4:11", "nodeType": "FunctionDefinition", "parameters": { "id": 2202, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2198, "mutability": "mutable", "name": "a", "nameLocation": "8294:1:11", "nodeType": "VariableDeclaration", "scope": 2231, "src": "8286:9:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2197, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "8286:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" }, { "constant": false, "id": 2201, "mutability": "mutable", "name": "rounding", "nameLocation": "8306:8:11", "nodeType": "VariableDeclaration", "scope": 2231, "src": "8297:17:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_enum$_Rounding_$1832", "typeString": "enum Math.Rounding" }, "typeName": { "id": 2200, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 2199, "name": "Rounding", "nameLocations": [ "8297:8:11" ], "nodeType": "IdentifierPath", "referencedDeclaration": 1832, "src": "8297:8:11" }, "referencedDeclaration": 1832, "src": "8297:8:11", "typeDescriptions": { "typeIdentifier": "t_enum$_Rounding_$1832", "typeString": "enum Math.Rounding" } }, "visibility": "internal" } ], "src": "8285:30:11" }, "returnParameters": { "id": 2205, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2204, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 2231, "src": "8339:7:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2203, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "8339:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "8338:9:11" }, "scope": 2691, "src": "8272:237:11", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 2362, "nodeType": "Block", "src": "8694:922:11", "statements": [ { "assignments": [ 2240 ], "declarations": [ { "constant": false, "id": 2240, "mutability": "mutable", "name": "result", "nameLocation": "8712:6:11", "nodeType": "VariableDeclaration", "scope": 2362, "src": "8704:14:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2239, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "8704:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 2242, "initialValue": { "hexValue": "30", "id": 2241, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "8721:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "nodeType": "VariableDeclarationStatement", "src": "8704:18:11" }, { "id": 2359, "nodeType": "UncheckedBlock", "src": "8732:855:11", "statements": [ { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2247, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2245, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2243, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2234, "src": "8760:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">>", "rightExpression": { "hexValue": "313238", "id": 2244, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "8769:3:11", "typeDescriptions": { "typeIdentifier": "t_rational_128_by_1", "typeString": "int_const 128" }, "value": "128" }, "src": "8760:12:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "hexValue": "30", "id": 2246, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "8775:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "8760:16:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 2257, "nodeType": "IfStatement", "src": "8756:99:11", "trueBody": { "id": 2256, "nodeType": "Block", "src": "8778:77:11", "statements": [ { "expression": { "id": 2250, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2248, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2234, "src": "8796:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": ">>=", "rightHandSide": { "hexValue": "313238", "id": 2249, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "8806:3:11", "typeDescriptions": { "typeIdentifier": "t_rational_128_by_1", "typeString": "int_const 128" }, "value": "128" }, "src": "8796:13:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2251, "nodeType": "ExpressionStatement", "src": "8796:13:11" }, { "expression": { "id": 2254, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2252, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2240, "src": "8827:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "+=", "rightHandSide": { "hexValue": "313238", "id": 2253, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "8837:3:11", "typeDescriptions": { "typeIdentifier": "t_rational_128_by_1", "typeString": "int_const 128" }, "value": "128" }, "src": "8827:13:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2255, "nodeType": "ExpressionStatement", "src": "8827:13:11" } ] } }, { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2262, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2260, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2258, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2234, "src": "8872:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">>", "rightExpression": { "hexValue": "3634", "id": 2259, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "8881:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_64_by_1", "typeString": "int_const 64" }, "value": "64" }, "src": "8872:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "hexValue": "30", "id": 2261, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "8886:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "8872:15:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 2272, "nodeType": "IfStatement", "src": "8868:96:11", "trueBody": { "id": 2271, "nodeType": "Block", "src": "8889:75:11", "statements": [ { "expression": { "id": 2265, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2263, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2234, "src": "8907:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": ">>=", "rightHandSide": { "hexValue": "3634", "id": 2264, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "8917:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_64_by_1", "typeString": "int_const 64" }, "value": "64" }, "src": "8907:12:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2266, "nodeType": "ExpressionStatement", "src": "8907:12:11" }, { "expression": { "id": 2269, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2267, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2240, "src": "8937:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "+=", "rightHandSide": { "hexValue": "3634", "id": 2268, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "8947:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_64_by_1", "typeString": "int_const 64" }, "value": "64" }, "src": "8937:12:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2270, "nodeType": "ExpressionStatement", "src": "8937:12:11" } ] } }, { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2277, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2275, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2273, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2234, "src": "8981:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">>", "rightExpression": { "hexValue": "3332", "id": 2274, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "8990:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_32_by_1", "typeString": "int_const 32" }, "value": "32" }, "src": "8981:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "hexValue": "30", "id": 2276, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "8995:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "8981:15:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 2287, "nodeType": "IfStatement", "src": "8977:96:11", "trueBody": { "id": 2286, "nodeType": "Block", "src": "8998:75:11", "statements": [ { "expression": { "id": 2280, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2278, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2234, "src": "9016:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": ">>=", "rightHandSide": { "hexValue": "3332", "id": 2279, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "9026:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_32_by_1", "typeString": "int_const 32" }, "value": "32" }, "src": "9016:12:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2281, "nodeType": "ExpressionStatement", "src": "9016:12:11" }, { "expression": { "id": 2284, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2282, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2240, "src": "9046:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "+=", "rightHandSide": { "hexValue": "3332", "id": 2283, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "9056:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_32_by_1", "typeString": "int_const 32" }, "value": "32" }, "src": "9046:12:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2285, "nodeType": "ExpressionStatement", "src": "9046:12:11" } ] } }, { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2292, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2290, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2288, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2234, "src": "9090:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">>", "rightExpression": { "hexValue": "3136", "id": 2289, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "9099:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_16_by_1", "typeString": "int_const 16" }, "value": "16" }, "src": "9090:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "hexValue": "30", "id": 2291, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "9104:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "9090:15:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 2302, "nodeType": "IfStatement", "src": "9086:96:11", "trueBody": { "id": 2301, "nodeType": "Block", "src": "9107:75:11", "statements": [ { "expression": { "id": 2295, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2293, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2234, "src": "9125:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": ">>=", "rightHandSide": { "hexValue": "3136", "id": 2294, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "9135:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_16_by_1", "typeString": "int_const 16" }, "value": "16" }, "src": "9125:12:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2296, "nodeType": "ExpressionStatement", "src": "9125:12:11" }, { "expression": { "id": 2299, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2297, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2240, "src": "9155:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "+=", "rightHandSide": { "hexValue": "3136", "id": 2298, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "9165:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_16_by_1", "typeString": "int_const 16" }, "value": "16" }, "src": "9155:12:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2300, "nodeType": "ExpressionStatement", "src": "9155:12:11" } ] } }, { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2307, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2305, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2303, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2234, "src": "9199:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">>", "rightExpression": { "hexValue": "38", "id": 2304, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "9208:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_8_by_1", "typeString": "int_const 8" }, "value": "8" }, "src": "9199:10:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "hexValue": "30", "id": 2306, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "9212:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "9199:14:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 2317, "nodeType": "IfStatement", "src": "9195:93:11", "trueBody": { "id": 2316, "nodeType": "Block", "src": "9215:73:11", "statements": [ { "expression": { "id": 2310, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2308, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2234, "src": "9233:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": ">>=", "rightHandSide": { "hexValue": "38", "id": 2309, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "9243:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_8_by_1", "typeString": "int_const 8" }, "value": "8" }, "src": "9233:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2311, "nodeType": "ExpressionStatement", "src": "9233:11:11" }, { "expression": { "id": 2314, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2312, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2240, "src": "9262:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "+=", "rightHandSide": { "hexValue": "38", "id": 2313, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "9272:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_8_by_1", "typeString": "int_const 8" }, "value": "8" }, "src": "9262:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2315, "nodeType": "ExpressionStatement", "src": "9262:11:11" } ] } }, { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2322, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2320, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2318, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2234, "src": "9305:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">>", "rightExpression": { "hexValue": "34", "id": 2319, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "9314:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_4_by_1", "typeString": "int_const 4" }, "value": "4" }, "src": "9305:10:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "hexValue": "30", "id": 2321, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "9318:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "9305:14:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 2332, "nodeType": "IfStatement", "src": "9301:93:11", "trueBody": { "id": 2331, "nodeType": "Block", "src": "9321:73:11", "statements": [ { "expression": { "id": 2325, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2323, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2234, "src": "9339:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": ">>=", "rightHandSide": { "hexValue": "34", "id": 2324, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "9349:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_4_by_1", "typeString": "int_const 4" }, "value": "4" }, "src": "9339:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2326, "nodeType": "ExpressionStatement", "src": "9339:11:11" }, { "expression": { "id": 2329, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2327, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2240, "src": "9368:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "+=", "rightHandSide": { "hexValue": "34", "id": 2328, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "9378:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_4_by_1", "typeString": "int_const 4" }, "value": "4" }, "src": "9368:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2330, "nodeType": "ExpressionStatement", "src": "9368:11:11" } ] } }, { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2337, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2335, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2333, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2234, "src": "9411:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">>", "rightExpression": { "hexValue": "32", "id": 2334, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "9420:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2" }, "value": "2" }, "src": "9411:10:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "hexValue": "30", "id": 2336, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "9424:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "9411:14:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 2347, "nodeType": "IfStatement", "src": "9407:93:11", "trueBody": { "id": 2346, "nodeType": "Block", "src": "9427:73:11", "statements": [ { "expression": { "id": 2340, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2338, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2234, "src": "9445:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": ">>=", "rightHandSide": { "hexValue": "32", "id": 2339, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "9455:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2" }, "value": "2" }, "src": "9445:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2341, "nodeType": "ExpressionStatement", "src": "9445:11:11" }, { "expression": { "id": 2344, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2342, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2240, "src": "9474:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "+=", "rightHandSide": { "hexValue": "32", "id": 2343, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "9484:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2" }, "value": "2" }, "src": "9474:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2345, "nodeType": "ExpressionStatement", "src": "9474:11:11" } ] } }, { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2352, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2350, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2348, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2234, "src": "9517:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">>", "rightExpression": { "hexValue": "31", "id": 2349, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "9526:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "9517:10:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "hexValue": "30", "id": 2351, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "9530:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "9517:14:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 2358, "nodeType": "IfStatement", "src": "9513:64:11", "trueBody": { "id": 2357, "nodeType": "Block", "src": "9533:44:11", "statements": [ { "expression": { "id": 2355, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2353, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2240, "src": "9551:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "+=", "rightHandSide": { "hexValue": "31", "id": 2354, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "9561:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "9551:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2356, "nodeType": "ExpressionStatement", "src": "9551:11:11" } ] } } ] }, { "expression": { "id": 2360, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2240, "src": "9603:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 2238, "id": 2361, "nodeType": "Return", "src": "9596:13:11" } ] }, "documentation": { "id": 2232, "nodeType": "StructuredDocumentation", "src": "8515:113:11", "text": " @dev Return the log in base 2, rounded down, of a positive value.\n Returns 0 if given 0." }, "id": 2363, "implemented": true, "kind": "function", "modifiers": [], "name": "log2", "nameLocation": "8642:4:11", "nodeType": "FunctionDefinition", "parameters": { "id": 2235, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2234, "mutability": "mutable", "name": "value", "nameLocation": "8655:5:11", "nodeType": "VariableDeclaration", "scope": 2363, "src": "8647:13:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2233, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "8647:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "8646:15:11" }, "returnParameters": { "id": 2238, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2237, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 2363, "src": "8685:7:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2236, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "8685:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "8684:9:11" }, "scope": 2691, "src": "8633:983:11", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 2398, "nodeType": "Block", "src": "9849:165:11", "statements": [ { "id": 2397, "nodeType": "UncheckedBlock", "src": "9859:149:11", "statements": [ { "assignments": [ 2375 ], "declarations": [ { "constant": false, "id": 2375, "mutability": "mutable", "name": "result", "nameLocation": "9891:6:11", "nodeType": "VariableDeclaration", "scope": 2397, "src": "9883:14:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2374, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "9883:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 2379, "initialValue": { "arguments": [ { "id": 2377, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2366, "src": "9905:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 2376, "name": "log2", "nodeType": "Identifier", "overloadedDeclarations": [ 2363, 2399 ], "referencedDeclaration": 2363, "src": "9900:4:11", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_uint256_$", "typeString": "function (uint256) pure returns (uint256)" } }, "id": 2378, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "9900:11:11", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "9883:28:11" }, { "expression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2395, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2380, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2375, "src": "9932:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "components": [ { "condition": { "commonType": { "typeIdentifier": "t_bool", "typeString": "bool" }, "id": 2390, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "commonType": { "typeIdentifier": "t_enum$_Rounding_$1832", "typeString": "enum Math.Rounding" }, "id": 2384, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2381, "name": "rounding", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2369, "src": "9942:8:11", "typeDescriptions": { "typeIdentifier": "t_enum$_Rounding_$1832", "typeString": "enum Math.Rounding" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "expression": { "id": 2382, "name": "Rounding", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1832, "src": "9954:8:11", "typeDescriptions": { "typeIdentifier": "t_type$_t_enum$_Rounding_$1832_$", "typeString": "type(enum Math.Rounding)" } }, "id": 2383, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "memberLocation": "9963:2:11", "memberName": "Up", "nodeType": "MemberAccess", "referencedDeclaration": 1830, "src": "9954:11:11", "typeDescriptions": { "typeIdentifier": "t_enum$_Rounding_$1832", "typeString": "enum Math.Rounding" } }, "src": "9942:23:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "BinaryOperation", "operator": "&&", "rightExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2389, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2387, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "hexValue": "31", "id": 2385, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "9969:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "nodeType": "BinaryOperation", "operator": "<<", "rightExpression": { "id": 2386, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2375, "src": "9974:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "9969:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "<", "rightExpression": { "id": 2388, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2366, "src": "9983:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "9969:19:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "src": "9942:46:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseExpression": { "hexValue": "30", "id": 2392, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "9995:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "id": 2393, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "Conditional", "src": "9942:54:11", "trueExpression": { "hexValue": "31", "id": 2391, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "9991:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } } ], "id": 2394, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "9941:56:11", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "src": "9932:65:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 2373, "id": 2396, "nodeType": "Return", "src": "9925:72:11" } ] } ] }, "documentation": { "id": 2364, "nodeType": "StructuredDocumentation", "src": "9622:142:11", "text": " @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n Returns 0 if given 0." }, "id": 2399, "implemented": true, "kind": "function", "modifiers": [], "name": "log2", "nameLocation": "9778:4:11", "nodeType": "FunctionDefinition", "parameters": { "id": 2370, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2366, "mutability": "mutable", "name": "value", "nameLocation": "9791:5:11", "nodeType": "VariableDeclaration", "scope": 2399, "src": "9783:13:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2365, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "9783:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" }, { "constant": false, "id": 2369, "mutability": "mutable", "name": "rounding", "nameLocation": "9807:8:11", "nodeType": "VariableDeclaration", "scope": 2399, "src": "9798:17:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_enum$_Rounding_$1832", "typeString": "enum Math.Rounding" }, "typeName": { "id": 2368, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 2367, "name": "Rounding", "nameLocations": [ "9798:8:11" ], "nodeType": "IdentifierPath", "referencedDeclaration": 1832, "src": "9798:8:11" }, "referencedDeclaration": 1832, "src": "9798:8:11", "typeDescriptions": { "typeIdentifier": "t_enum$_Rounding_$1832", "typeString": "enum Math.Rounding" } }, "visibility": "internal" } ], "src": "9782:34:11" }, "returnParameters": { "id": 2373, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2372, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 2399, "src": "9840:7:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2371, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "9840:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "9839:9:11" }, "scope": 2691, "src": "9769:245:11", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 2527, "nodeType": "Block", "src": "10201:854:11", "statements": [ { "assignments": [ 2408 ], "declarations": [ { "constant": false, "id": 2408, "mutability": "mutable", "name": "result", "nameLocation": "10219:6:11", "nodeType": "VariableDeclaration", "scope": 2527, "src": "10211:14:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2407, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "10211:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 2410, "initialValue": { "hexValue": "30", "id": 2409, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10228:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "nodeType": "VariableDeclarationStatement", "src": "10211:18:11" }, { "id": 2524, "nodeType": "UncheckedBlock", "src": "10239:787:11", "statements": [ { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2415, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2411, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2402, "src": "10267:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "commonType": { "typeIdentifier": "t_rational_10000000000000000000000000000000000000000000000000000000000000000_by_1", "typeString": "int_const 1000...(57 digits omitted)...0000" }, "id": 2414, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "leftExpression": { "hexValue": "3130", "id": 2412, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10276:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_10_by_1", "typeString": "int_const 10" }, "value": "10" }, "nodeType": "BinaryOperation", "operator": "**", "rightExpression": { "hexValue": "3634", "id": 2413, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10282:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_64_by_1", "typeString": "int_const 64" }, "value": "64" }, "src": "10276:8:11", "typeDescriptions": { "typeIdentifier": "t_rational_10000000000000000000000000000000000000000000000000000000000000000_by_1", "typeString": "int_const 1000...(57 digits omitted)...0000" } }, "src": "10267:17:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 2427, "nodeType": "IfStatement", "src": "10263:103:11", "trueBody": { "id": 2426, "nodeType": "Block", "src": "10286:80:11", "statements": [ { "expression": { "id": 2420, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2416, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2402, "src": "10304:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "/=", "rightHandSide": { "commonType": { "typeIdentifier": "t_rational_10000000000000000000000000000000000000000000000000000000000000000_by_1", "typeString": "int_const 1000...(57 digits omitted)...0000" }, "id": 2419, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "leftExpression": { "hexValue": "3130", "id": 2417, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10313:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_10_by_1", "typeString": "int_const 10" }, "value": "10" }, "nodeType": "BinaryOperation", "operator": "**", "rightExpression": { "hexValue": "3634", "id": 2418, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10319:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_64_by_1", "typeString": "int_const 64" }, "value": "64" }, "src": "10313:8:11", "typeDescriptions": { "typeIdentifier": "t_rational_10000000000000000000000000000000000000000000000000000000000000000_by_1", "typeString": "int_const 1000...(57 digits omitted)...0000" } }, "src": "10304:17:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2421, "nodeType": "ExpressionStatement", "src": "10304:17:11" }, { "expression": { "id": 2424, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2422, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2408, "src": "10339:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "+=", "rightHandSide": { "hexValue": "3634", "id": 2423, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10349:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_64_by_1", "typeString": "int_const 64" }, "value": "64" }, "src": "10339:12:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2425, "nodeType": "ExpressionStatement", "src": "10339:12:11" } ] } }, { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2432, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2428, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2402, "src": "10383:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "commonType": { "typeIdentifier": "t_rational_100000000000000000000000000000000_by_1", "typeString": "int_const 1000...(25 digits omitted)...0000" }, "id": 2431, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "leftExpression": { "hexValue": "3130", "id": 2429, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10392:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_10_by_1", "typeString": "int_const 10" }, "value": "10" }, "nodeType": "BinaryOperation", "operator": "**", "rightExpression": { "hexValue": "3332", "id": 2430, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10398:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_32_by_1", "typeString": "int_const 32" }, "value": "32" }, "src": "10392:8:11", "typeDescriptions": { "typeIdentifier": "t_rational_100000000000000000000000000000000_by_1", "typeString": "int_const 1000...(25 digits omitted)...0000" } }, "src": "10383:17:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 2444, "nodeType": "IfStatement", "src": "10379:103:11", "trueBody": { "id": 2443, "nodeType": "Block", "src": "10402:80:11", "statements": [ { "expression": { "id": 2437, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2433, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2402, "src": "10420:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "/=", "rightHandSide": { "commonType": { "typeIdentifier": "t_rational_100000000000000000000000000000000_by_1", "typeString": "int_const 1000...(25 digits omitted)...0000" }, "id": 2436, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "leftExpression": { "hexValue": "3130", "id": 2434, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10429:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_10_by_1", "typeString": "int_const 10" }, "value": "10" }, "nodeType": "BinaryOperation", "operator": "**", "rightExpression": { "hexValue": "3332", "id": 2435, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10435:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_32_by_1", "typeString": "int_const 32" }, "value": "32" }, "src": "10429:8:11", "typeDescriptions": { "typeIdentifier": "t_rational_100000000000000000000000000000000_by_1", "typeString": "int_const 1000...(25 digits omitted)...0000" } }, "src": "10420:17:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2438, "nodeType": "ExpressionStatement", "src": "10420:17:11" }, { "expression": { "id": 2441, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2439, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2408, "src": "10455:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "+=", "rightHandSide": { "hexValue": "3332", "id": 2440, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10465:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_32_by_1", "typeString": "int_const 32" }, "value": "32" }, "src": "10455:12:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2442, "nodeType": "ExpressionStatement", "src": "10455:12:11" } ] } }, { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2449, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2445, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2402, "src": "10499:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "commonType": { "typeIdentifier": "t_rational_10000000000000000_by_1", "typeString": "int_const 10000000000000000" }, "id": 2448, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "leftExpression": { "hexValue": "3130", "id": 2446, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10508:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_10_by_1", "typeString": "int_const 10" }, "value": "10" }, "nodeType": "BinaryOperation", "operator": "**", "rightExpression": { "hexValue": "3136", "id": 2447, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10514:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_16_by_1", "typeString": "int_const 16" }, "value": "16" }, "src": "10508:8:11", "typeDescriptions": { "typeIdentifier": "t_rational_10000000000000000_by_1", "typeString": "int_const 10000000000000000" } }, "src": "10499:17:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 2461, "nodeType": "IfStatement", "src": "10495:103:11", "trueBody": { "id": 2460, "nodeType": "Block", "src": "10518:80:11", "statements": [ { "expression": { "id": 2454, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2450, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2402, "src": "10536:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "/=", "rightHandSide": { "commonType": { "typeIdentifier": "t_rational_10000000000000000_by_1", "typeString": "int_const 10000000000000000" }, "id": 2453, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "leftExpression": { "hexValue": "3130", "id": 2451, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10545:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_10_by_1", "typeString": "int_const 10" }, "value": "10" }, "nodeType": "BinaryOperation", "operator": "**", "rightExpression": { "hexValue": "3136", "id": 2452, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10551:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_16_by_1", "typeString": "int_const 16" }, "value": "16" }, "src": "10545:8:11", "typeDescriptions": { "typeIdentifier": "t_rational_10000000000000000_by_1", "typeString": "int_const 10000000000000000" } }, "src": "10536:17:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2455, "nodeType": "ExpressionStatement", "src": "10536:17:11" }, { "expression": { "id": 2458, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2456, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2408, "src": "10571:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "+=", "rightHandSide": { "hexValue": "3136", "id": 2457, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10581:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_16_by_1", "typeString": "int_const 16" }, "value": "16" }, "src": "10571:12:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2459, "nodeType": "ExpressionStatement", "src": "10571:12:11" } ] } }, { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2466, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2462, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2402, "src": "10615:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "commonType": { "typeIdentifier": "t_rational_100000000_by_1", "typeString": "int_const 100000000" }, "id": 2465, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "leftExpression": { "hexValue": "3130", "id": 2463, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10624:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_10_by_1", "typeString": "int_const 10" }, "value": "10" }, "nodeType": "BinaryOperation", "operator": "**", "rightExpression": { "hexValue": "38", "id": 2464, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10630:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_8_by_1", "typeString": "int_const 8" }, "value": "8" }, "src": "10624:7:11", "typeDescriptions": { "typeIdentifier": "t_rational_100000000_by_1", "typeString": "int_const 100000000" } }, "src": "10615:16:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 2478, "nodeType": "IfStatement", "src": "10611:100:11", "trueBody": { "id": 2477, "nodeType": "Block", "src": "10633:78:11", "statements": [ { "expression": { "id": 2471, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2467, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2402, "src": "10651:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "/=", "rightHandSide": { "commonType": { "typeIdentifier": "t_rational_100000000_by_1", "typeString": "int_const 100000000" }, "id": 2470, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "leftExpression": { "hexValue": "3130", "id": 2468, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10660:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_10_by_1", "typeString": "int_const 10" }, "value": "10" }, "nodeType": "BinaryOperation", "operator": "**", "rightExpression": { "hexValue": "38", "id": 2469, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10666:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_8_by_1", "typeString": "int_const 8" }, "value": "8" }, "src": "10660:7:11", "typeDescriptions": { "typeIdentifier": "t_rational_100000000_by_1", "typeString": "int_const 100000000" } }, "src": "10651:16:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2472, "nodeType": "ExpressionStatement", "src": "10651:16:11" }, { "expression": { "id": 2475, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2473, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2408, "src": "10685:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "+=", "rightHandSide": { "hexValue": "38", "id": 2474, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10695:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_8_by_1", "typeString": "int_const 8" }, "value": "8" }, "src": "10685:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2476, "nodeType": "ExpressionStatement", "src": "10685:11:11" } ] } }, { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2483, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2479, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2402, "src": "10728:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "commonType": { "typeIdentifier": "t_rational_10000_by_1", "typeString": "int_const 10000" }, "id": 2482, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "leftExpression": { "hexValue": "3130", "id": 2480, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10737:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_10_by_1", "typeString": "int_const 10" }, "value": "10" }, "nodeType": "BinaryOperation", "operator": "**", "rightExpression": { "hexValue": "34", "id": 2481, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10743:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_4_by_1", "typeString": "int_const 4" }, "value": "4" }, "src": "10737:7:11", "typeDescriptions": { "typeIdentifier": "t_rational_10000_by_1", "typeString": "int_const 10000" } }, "src": "10728:16:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 2495, "nodeType": "IfStatement", "src": "10724:100:11", "trueBody": { "id": 2494, "nodeType": "Block", "src": "10746:78:11", "statements": [ { "expression": { "id": 2488, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2484, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2402, "src": "10764:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "/=", "rightHandSide": { "commonType": { "typeIdentifier": "t_rational_10000_by_1", "typeString": "int_const 10000" }, "id": 2487, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "leftExpression": { "hexValue": "3130", "id": 2485, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10773:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_10_by_1", "typeString": "int_const 10" }, "value": "10" }, "nodeType": "BinaryOperation", "operator": "**", "rightExpression": { "hexValue": "34", "id": 2486, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10779:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_4_by_1", "typeString": "int_const 4" }, "value": "4" }, "src": "10773:7:11", "typeDescriptions": { "typeIdentifier": "t_rational_10000_by_1", "typeString": "int_const 10000" } }, "src": "10764:16:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2489, "nodeType": "ExpressionStatement", "src": "10764:16:11" }, { "expression": { "id": 2492, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2490, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2408, "src": "10798:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "+=", "rightHandSide": { "hexValue": "34", "id": 2491, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10808:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_4_by_1", "typeString": "int_const 4" }, "value": "4" }, "src": "10798:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2493, "nodeType": "ExpressionStatement", "src": "10798:11:11" } ] } }, { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2500, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2496, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2402, "src": "10841:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "commonType": { "typeIdentifier": "t_rational_100_by_1", "typeString": "int_const 100" }, "id": 2499, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "leftExpression": { "hexValue": "3130", "id": 2497, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10850:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_10_by_1", "typeString": "int_const 10" }, "value": "10" }, "nodeType": "BinaryOperation", "operator": "**", "rightExpression": { "hexValue": "32", "id": 2498, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10856:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2" }, "value": "2" }, "src": "10850:7:11", "typeDescriptions": { "typeIdentifier": "t_rational_100_by_1", "typeString": "int_const 100" } }, "src": "10841:16:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 2512, "nodeType": "IfStatement", "src": "10837:100:11", "trueBody": { "id": 2511, "nodeType": "Block", "src": "10859:78:11", "statements": [ { "expression": { "id": 2505, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2501, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2402, "src": "10877:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "/=", "rightHandSide": { "commonType": { "typeIdentifier": "t_rational_100_by_1", "typeString": "int_const 100" }, "id": 2504, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "leftExpression": { "hexValue": "3130", "id": 2502, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10886:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_10_by_1", "typeString": "int_const 10" }, "value": "10" }, "nodeType": "BinaryOperation", "operator": "**", "rightExpression": { "hexValue": "32", "id": 2503, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10892:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2" }, "value": "2" }, "src": "10886:7:11", "typeDescriptions": { "typeIdentifier": "t_rational_100_by_1", "typeString": "int_const 100" } }, "src": "10877:16:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2506, "nodeType": "ExpressionStatement", "src": "10877:16:11" }, { "expression": { "id": 2509, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2507, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2408, "src": "10911:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "+=", "rightHandSide": { "hexValue": "32", "id": 2508, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10921:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2" }, "value": "2" }, "src": "10911:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2510, "nodeType": "ExpressionStatement", "src": "10911:11:11" } ] } }, { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2517, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2513, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2402, "src": "10954:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "commonType": { "typeIdentifier": "t_rational_10_by_1", "typeString": "int_const 10" }, "id": 2516, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "leftExpression": { "hexValue": "3130", "id": 2514, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10963:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_10_by_1", "typeString": "int_const 10" }, "value": "10" }, "nodeType": "BinaryOperation", "operator": "**", "rightExpression": { "hexValue": "31", "id": 2515, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "10969:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "10963:7:11", "typeDescriptions": { "typeIdentifier": "t_rational_10_by_1", "typeString": "int_const 10" } }, "src": "10954:16:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 2523, "nodeType": "IfStatement", "src": "10950:66:11", "trueBody": { "id": 2522, "nodeType": "Block", "src": "10972:44:11", "statements": [ { "expression": { "id": 2520, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2518, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2408, "src": "10990:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "+=", "rightHandSide": { "hexValue": "31", "id": 2519, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "11000:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "10990:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2521, "nodeType": "ExpressionStatement", "src": "10990:11:11" } ] } } ] }, { "expression": { "id": 2525, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2408, "src": "11042:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 2406, "id": 2526, "nodeType": "Return", "src": "11035:13:11" } ] }, "documentation": { "id": 2400, "nodeType": "StructuredDocumentation", "src": "10020:114:11", "text": " @dev Return the log in base 10, rounded down, of a positive value.\n Returns 0 if given 0." }, "id": 2528, "implemented": true, "kind": "function", "modifiers": [], "name": "log10", "nameLocation": "10148:5:11", "nodeType": "FunctionDefinition", "parameters": { "id": 2403, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2402, "mutability": "mutable", "name": "value", "nameLocation": "10162:5:11", "nodeType": "VariableDeclaration", "scope": 2528, "src": "10154:13:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2401, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "10154:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "10153:15:11" }, "returnParameters": { "id": 2406, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2405, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 2528, "src": "10192:7:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2404, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "10192:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "10191:9:11" }, "scope": 2691, "src": "10139:916:11", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 2563, "nodeType": "Block", "src": "11290:167:11", "statements": [ { "id": 2562, "nodeType": "UncheckedBlock", "src": "11300:151:11", "statements": [ { "assignments": [ 2540 ], "declarations": [ { "constant": false, "id": 2540, "mutability": "mutable", "name": "result", "nameLocation": "11332:6:11", "nodeType": "VariableDeclaration", "scope": 2562, "src": "11324:14:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2539, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "11324:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 2544, "initialValue": { "arguments": [ { "id": 2542, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2531, "src": "11347:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 2541, "name": "log10", "nodeType": "Identifier", "overloadedDeclarations": [ 2528, 2564 ], "referencedDeclaration": 2528, "src": "11341:5:11", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_uint256_$", "typeString": "function (uint256) pure returns (uint256)" } }, "id": 2543, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "11341:12:11", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "11324:29:11" }, { "expression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2560, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2545, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2540, "src": "11374:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "components": [ { "condition": { "commonType": { "typeIdentifier": "t_bool", "typeString": "bool" }, "id": 2555, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "commonType": { "typeIdentifier": "t_enum$_Rounding_$1832", "typeString": "enum Math.Rounding" }, "id": 2549, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2546, "name": "rounding", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2534, "src": "11384:8:11", "typeDescriptions": { "typeIdentifier": "t_enum$_Rounding_$1832", "typeString": "enum Math.Rounding" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "expression": { "id": 2547, "name": "Rounding", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1832, "src": "11396:8:11", "typeDescriptions": { "typeIdentifier": "t_type$_t_enum$_Rounding_$1832_$", "typeString": "type(enum Math.Rounding)" } }, "id": 2548, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "memberLocation": "11405:2:11", "memberName": "Up", "nodeType": "MemberAccess", "referencedDeclaration": 1830, "src": "11396:11:11", "typeDescriptions": { "typeIdentifier": "t_enum$_Rounding_$1832", "typeString": "enum Math.Rounding" } }, "src": "11384:23:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "BinaryOperation", "operator": "&&", "rightExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2554, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2552, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "hexValue": "3130", "id": 2550, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "11411:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_10_by_1", "typeString": "int_const 10" }, "value": "10" }, "nodeType": "BinaryOperation", "operator": "**", "rightExpression": { "id": 2551, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2540, "src": "11417:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "11411:12:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "<", "rightExpression": { "id": 2553, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2531, "src": "11426:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "11411:20:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "src": "11384:47:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseExpression": { "hexValue": "30", "id": 2557, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "11438:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "id": 2558, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "Conditional", "src": "11384:55:11", "trueExpression": { "hexValue": "31", "id": 2556, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "11434:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } } ], "id": 2559, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "11383:57:11", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "src": "11374:66:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 2538, "id": 2561, "nodeType": "Return", "src": "11367:73:11" } ] } ] }, "documentation": { "id": 2529, "nodeType": "StructuredDocumentation", "src": "11061:143:11", "text": " @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n Returns 0 if given 0." }, "id": 2564, "implemented": true, "kind": "function", "modifiers": [], "name": "log10", "nameLocation": "11218:5:11", "nodeType": "FunctionDefinition", "parameters": { "id": 2535, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2531, "mutability": "mutable", "name": "value", "nameLocation": "11232:5:11", "nodeType": "VariableDeclaration", "scope": 2564, "src": "11224:13:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2530, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "11224:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" }, { "constant": false, "id": 2534, "mutability": "mutable", "name": "rounding", "nameLocation": "11248:8:11", "nodeType": "VariableDeclaration", "scope": 2564, "src": "11239:17:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_enum$_Rounding_$1832", "typeString": "enum Math.Rounding" }, "typeName": { "id": 2533, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 2532, "name": "Rounding", "nameLocations": [ "11239:8:11" ], "nodeType": "IdentifierPath", "referencedDeclaration": 1832, "src": "11239:8:11" }, "referencedDeclaration": 1832, "src": "11239:8:11", "typeDescriptions": { "typeIdentifier": "t_enum$_Rounding_$1832", "typeString": "enum Math.Rounding" } }, "visibility": "internal" } ], "src": "11223:34:11" }, "returnParameters": { "id": 2538, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2537, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 2564, "src": "11281:7:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2536, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "11281:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "11280:9:11" }, "scope": 2691, "src": "11209:248:11", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 2650, "nodeType": "Block", "src": "11771:600:11", "statements": [ { "assignments": [ 2573 ], "declarations": [ { "constant": false, "id": 2573, "mutability": "mutable", "name": "result", "nameLocation": "11789:6:11", "nodeType": "VariableDeclaration", "scope": 2650, "src": "11781:14:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2572, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "11781:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 2575, "initialValue": { "hexValue": "30", "id": 2574, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "11798:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "nodeType": "VariableDeclarationStatement", "src": "11781:18:11" }, { "id": 2647, "nodeType": "UncheckedBlock", "src": "11809:533:11", "statements": [ { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2580, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2578, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2576, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2567, "src": "11837:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">>", "rightExpression": { "hexValue": "313238", "id": 2577, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "11846:3:11", "typeDescriptions": { "typeIdentifier": "t_rational_128_by_1", "typeString": "int_const 128" }, "value": "128" }, "src": "11837:12:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "hexValue": "30", "id": 2579, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "11852:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "11837:16:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 2590, "nodeType": "IfStatement", "src": "11833:98:11", "trueBody": { "id": 2589, "nodeType": "Block", "src": "11855:76:11", "statements": [ { "expression": { "id": 2583, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2581, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2567, "src": "11873:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": ">>=", "rightHandSide": { "hexValue": "313238", "id": 2582, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "11883:3:11", "typeDescriptions": { "typeIdentifier": "t_rational_128_by_1", "typeString": "int_const 128" }, "value": "128" }, "src": "11873:13:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2584, "nodeType": "ExpressionStatement", "src": "11873:13:11" }, { "expression": { "id": 2587, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2585, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2573, "src": "11904:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "+=", "rightHandSide": { "hexValue": "3136", "id": 2586, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "11914:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_16_by_1", "typeString": "int_const 16" }, "value": "16" }, "src": "11904:12:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2588, "nodeType": "ExpressionStatement", "src": "11904:12:11" } ] } }, { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2595, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2593, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2591, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2567, "src": "11948:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">>", "rightExpression": { "hexValue": "3634", "id": 2592, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "11957:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_64_by_1", "typeString": "int_const 64" }, "value": "64" }, "src": "11948:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "hexValue": "30", "id": 2594, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "11962:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "11948:15:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 2605, "nodeType": "IfStatement", "src": "11944:95:11", "trueBody": { "id": 2604, "nodeType": "Block", "src": "11965:74:11", "statements": [ { "expression": { "id": 2598, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2596, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2567, "src": "11983:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": ">>=", "rightHandSide": { "hexValue": "3634", "id": 2597, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "11993:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_64_by_1", "typeString": "int_const 64" }, "value": "64" }, "src": "11983:12:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2599, "nodeType": "ExpressionStatement", "src": "11983:12:11" }, { "expression": { "id": 2602, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2600, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2573, "src": "12013:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "+=", "rightHandSide": { "hexValue": "38", "id": 2601, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "12023:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_8_by_1", "typeString": "int_const 8" }, "value": "8" }, "src": "12013:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2603, "nodeType": "ExpressionStatement", "src": "12013:11:11" } ] } }, { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2610, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2608, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2606, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2567, "src": "12056:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">>", "rightExpression": { "hexValue": "3332", "id": 2607, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "12065:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_32_by_1", "typeString": "int_const 32" }, "value": "32" }, "src": "12056:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "hexValue": "30", "id": 2609, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "12070:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "12056:15:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 2620, "nodeType": "IfStatement", "src": "12052:95:11", "trueBody": { "id": 2619, "nodeType": "Block", "src": "12073:74:11", "statements": [ { "expression": { "id": 2613, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2611, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2567, "src": "12091:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": ">>=", "rightHandSide": { "hexValue": "3332", "id": 2612, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "12101:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_32_by_1", "typeString": "int_const 32" }, "value": "32" }, "src": "12091:12:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2614, "nodeType": "ExpressionStatement", "src": "12091:12:11" }, { "expression": { "id": 2617, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2615, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2573, "src": "12121:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "+=", "rightHandSide": { "hexValue": "34", "id": 2616, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "12131:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_4_by_1", "typeString": "int_const 4" }, "value": "4" }, "src": "12121:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2618, "nodeType": "ExpressionStatement", "src": "12121:11:11" } ] } }, { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2625, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2623, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2621, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2567, "src": "12164:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">>", "rightExpression": { "hexValue": "3136", "id": 2622, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "12173:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_16_by_1", "typeString": "int_const 16" }, "value": "16" }, "src": "12164:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "hexValue": "30", "id": 2624, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "12178:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "12164:15:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 2635, "nodeType": "IfStatement", "src": "12160:95:11", "trueBody": { "id": 2634, "nodeType": "Block", "src": "12181:74:11", "statements": [ { "expression": { "id": 2628, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2626, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2567, "src": "12199:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": ">>=", "rightHandSide": { "hexValue": "3136", "id": 2627, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "12209:2:11", "typeDescriptions": { "typeIdentifier": "t_rational_16_by_1", "typeString": "int_const 16" }, "value": "16" }, "src": "12199:12:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2629, "nodeType": "ExpressionStatement", "src": "12199:12:11" }, { "expression": { "id": 2632, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2630, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2573, "src": "12229:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "+=", "rightHandSide": { "hexValue": "32", "id": 2631, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "12239:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2" }, "value": "2" }, "src": "12229:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2633, "nodeType": "ExpressionStatement", "src": "12229:11:11" } ] } }, { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2640, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2638, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2636, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2567, "src": "12272:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">>", "rightExpression": { "hexValue": "38", "id": 2637, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "12281:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_8_by_1", "typeString": "int_const 8" }, "value": "8" }, "src": "12272:10:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "hexValue": "30", "id": 2639, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "12285:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "12272:14:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 2646, "nodeType": "IfStatement", "src": "12268:64:11", "trueBody": { "id": 2645, "nodeType": "Block", "src": "12288:44:11", "statements": [ { "expression": { "id": 2643, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 2641, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2573, "src": "12306:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "+=", "rightHandSide": { "hexValue": "31", "id": 2642, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "12316:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "12306:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2644, "nodeType": "ExpressionStatement", "src": "12306:11:11" } ] } } ] }, { "expression": { "id": 2648, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2573, "src": "12358:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 2571, "id": 2649, "nodeType": "Return", "src": "12351:13:11" } ] }, "documentation": { "id": 2565, "nodeType": "StructuredDocumentation", "src": "11463:240:11", "text": " @dev Return the log in base 256, rounded down, of a positive value.\n Returns 0 if given 0.\n Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string." }, "id": 2651, "implemented": true, "kind": "function", "modifiers": [], "name": "log256", "nameLocation": "11717:6:11", "nodeType": "FunctionDefinition", "parameters": { "id": 2568, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2567, "mutability": "mutable", "name": "value", "nameLocation": "11732:5:11", "nodeType": "VariableDeclaration", "scope": 2651, "src": "11724:13:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2566, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "11724:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "11723:15:11" }, "returnParameters": { "id": 2571, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2570, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 2651, "src": "11762:7:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2569, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "11762:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "11761:9:11" }, "scope": 2691, "src": "11708:663:11", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 2689, "nodeType": "Block", "src": "12608:174:11", "statements": [ { "id": 2688, "nodeType": "UncheckedBlock", "src": "12618:158:11", "statements": [ { "assignments": [ 2663 ], "declarations": [ { "constant": false, "id": 2663, "mutability": "mutable", "name": "result", "nameLocation": "12650:6:11", "nodeType": "VariableDeclaration", "scope": 2688, "src": "12642:14:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2662, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "12642:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 2667, "initialValue": { "arguments": [ { "id": 2665, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2654, "src": "12666:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 2664, "name": "log256", "nodeType": "Identifier", "overloadedDeclarations": [ 2651, 2690 ], "referencedDeclaration": 2651, "src": "12659:6:11", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_uint256_$", "typeString": "function (uint256) pure returns (uint256)" } }, "id": 2666, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "12659:13:11", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "12642:30:11" }, { "expression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2686, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2668, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2663, "src": "12693:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "components": [ { "condition": { "commonType": { "typeIdentifier": "t_bool", "typeString": "bool" }, "id": 2681, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "commonType": { "typeIdentifier": "t_enum$_Rounding_$1832", "typeString": "enum Math.Rounding" }, "id": 2672, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2669, "name": "rounding", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2657, "src": "12703:8:11", "typeDescriptions": { "typeIdentifier": "t_enum$_Rounding_$1832", "typeString": "enum Math.Rounding" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "expression": { "id": 2670, "name": "Rounding", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1832, "src": "12715:8:11", "typeDescriptions": { "typeIdentifier": "t_type$_t_enum$_Rounding_$1832_$", "typeString": "type(enum Math.Rounding)" } }, "id": 2671, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "memberLocation": "12724:2:11", "memberName": "Up", "nodeType": "MemberAccess", "referencedDeclaration": 1830, "src": "12715:11:11", "typeDescriptions": { "typeIdentifier": "t_enum$_Rounding_$1832", "typeString": "enum Math.Rounding" } }, "src": "12703:23:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "BinaryOperation", "operator": "&&", "rightExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2680, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2678, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "hexValue": "31", "id": 2673, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "12730:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "nodeType": "BinaryOperation", "operator": "<<", "rightExpression": { "components": [ { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2676, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 2674, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2663, "src": "12736:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "<<", "rightExpression": { "hexValue": "33", "id": 2675, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "12746:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_3_by_1", "typeString": "int_const 3" }, "value": "3" }, "src": "12736:11:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "id": 2677, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "12735:13:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "12730:18:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "<", "rightExpression": { "id": 2679, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2654, "src": "12751:5:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "12730:26:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "src": "12703:53:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseExpression": { "hexValue": "30", "id": 2683, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "12763:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "id": 2684, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "Conditional", "src": "12703:61:11", "trueExpression": { "hexValue": "31", "id": 2682, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "12759:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } } ], "id": 2685, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "12702:63:11", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "src": "12693:72:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 2661, "id": 2687, "nodeType": "Return", "src": "12686:79:11" } ] } ] }, "documentation": { "id": 2652, "nodeType": "StructuredDocumentation", "src": "12377:144:11", "text": " @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n Returns 0 if given 0." }, "id": 2690, "implemented": true, "kind": "function", "modifiers": [], "name": "log256", "nameLocation": "12535:6:11", "nodeType": "FunctionDefinition", "parameters": { "id": 2658, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2654, "mutability": "mutable", "name": "value", "nameLocation": "12550:5:11", "nodeType": "VariableDeclaration", "scope": 2690, "src": "12542:13:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2653, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "12542:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" }, { "constant": false, "id": 2657, "mutability": "mutable", "name": "rounding", "nameLocation": "12566:8:11", "nodeType": "VariableDeclaration", "scope": 2690, "src": "12557:17:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_enum$_Rounding_$1832", "typeString": "enum Math.Rounding" }, "typeName": { "id": 2656, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 2655, "name": "Rounding", "nameLocations": [ "12557:8:11" ], "nodeType": "IdentifierPath", "referencedDeclaration": 1832, "src": "12557:8:11" }, "referencedDeclaration": 1832, "src": "12557:8:11", "typeDescriptions": { "typeIdentifier": "t_enum$_Rounding_$1832", "typeString": "enum Math.Rounding" } }, "visibility": "internal" } ], "src": "12541:34:11" }, "returnParameters": { "id": 2661, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2660, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 2690, "src": "12599:7:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2659, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "12599:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "12598:9:11" }, "scope": 2691, "src": "12526:256:11", "stateMutability": "pure", "virtual": false, "visibility": "internal" } ], "scope": 2692, "src": "202:12582:11", "usedErrors": [] } ], "src": "103:12682:11" }, "compiler": { "name": "solc", "version": "0.8.19+commit.7dd6d404.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.4.13", "updatedAt": "2023-06-04T09:28:33.987Z", "devdoc": { "details": "Standard math utilities missing in the Solidity language.", "kind": "dev", "methods": {}, "version": 1 }, "userdoc": { "kind": "user", "methods": {}, "version": 1 } }