{ "contractName": "Strings", "abi": [], "metadata": "{\"compiler\":{\"version\":\"0.8.11+commit.d7f03943\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"details\":\"String operations.\",\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/utils/Strings.sol\":\"Strings\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/Strings.sol\":{\"keccak256\":\"0x32c202bd28995dd20c4347b7c6467a6d3241c74c8ad3edcbb610cd9205916c45\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8179c356adb19e70d6b31a1eedc8c5c7f0c00e669e2540f4099e3844c6074d30\",\"dweb:/ipfs/QmWFbivarEobbqhS1go64ootVuHfVohBseerYy9FTEd1W2\"]}},\"version\":1}", "bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220b963d1eeac13be6eb13274bc7c24aaef659bce068306f3218f2ec8001937574464736f6c634300080b0033", "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220b963d1eeac13be6eb13274bc7c24aaef659bce068306f3218f2ec8001937574464736f6c634300080b0033", "immutableReferences": {}, "generatedSources": [], "deployedGeneratedSources": [], "sourceMap": "146:1885:9:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;146:1885:9;;;;;;;;;;;;;;;;;", "deployedSourceMap": "146:1885:9:-:0;;;;;;;;", "source": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _HEX_SYMBOLS = \"0123456789abcdef\";\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n // Inspired by OraclizeAPI's implementation - MIT licence\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\n\n if (value == 0) {\n return \"0\";\n }\n uint256 temp = value;\n uint256 digits;\n while (temp != 0) {\n digits++;\n temp /= 10;\n }\n bytes memory buffer = new bytes(digits);\n while (value != 0) {\n digits -= 1;\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\n value /= 10;\n }\n return string(buffer);\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n if (value == 0) {\n return \"0x00\";\n }\n uint256 temp = value;\n uint256 length = 0;\n while (temp != 0) {\n length++;\n temp >>= 8;\n }\n return toHexString(value, length);\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n}\n", "sourcePath": "@openzeppelin/contracts/utils/Strings.sol", "ast": { "absolutePath": "@openzeppelin/contracts/utils/Strings.sol", "exportedSymbols": { "Strings": [ 1820 ] }, "id": 1821, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 1619, "literals": [ "solidity", "^", "0.8", ".0" ], "nodeType": "PragmaDirective", "src": "86:23:9" }, { "abstract": false, "baseContracts": [], "canonicalName": "Strings", "contractDependencies": [], "contractKind": "library", "documentation": { "id": 1620, "nodeType": "StructuredDocumentation", "src": "111:34:9", "text": " @dev String operations." }, "fullyImplemented": true, "id": 1820, "linearizedBaseContracts": [ 1820 ], "name": "Strings", "nameLocation": "154:7:9", "nodeType": "ContractDefinition", "nodes": [ { "constant": true, "id": 1623, "mutability": "constant", "name": "_HEX_SYMBOLS", "nameLocation": "193:12:9", "nodeType": "VariableDeclaration", "scope": 1820, "src": "168:58:9", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" }, "typeName": { "id": 1621, "name": "bytes16", "nodeType": "ElementaryTypeName", "src": "168:7:9", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" } }, "value": { "hexValue": "30313233343536373839616263646566", "id": 1622, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "208:18:9", "typeDescriptions": { "typeIdentifier": "t_stringliteral_cb29997ed99ead0db59ce4d12b7d3723198c827273e5796737c926d78019c39f", "typeString": "literal_string \"0123456789abcdef\"" }, "value": "0123456789abcdef" }, "visibility": "private" }, { "body": { "id": 1701, "nodeType": "Block", "src": "399:632:9", "statements": [ { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1633, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1631, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1626, "src": "601:5:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "hexValue": "30", "id": 1632, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "610:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "601:10:9", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 1637, "nodeType": "IfStatement", "src": "597:51:9", "trueBody": { "id": 1636, "nodeType": "Block", "src": "613:35:9", "statements": [ { "expression": { "hexValue": "30", "id": 1634, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "634:3:9", "typeDescriptions": { "typeIdentifier": "t_stringliteral_044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d", "typeString": "literal_string \"0\"" }, "value": "0" }, "functionReturnParameters": 1630, "id": 1635, "nodeType": "Return", "src": "627:10:9" } ] } }, { "assignments": [ 1639 ], "declarations": [ { "constant": false, "id": 1639, "mutability": "mutable", "name": "temp", "nameLocation": "665:4:9", "nodeType": "VariableDeclaration", "scope": 1701, "src": "657:12:9", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1638, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "657:7:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 1641, "initialValue": { "id": 1640, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1626, "src": "672:5:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "657:20:9" }, { "assignments": [ 1643 ], "declarations": [ { "constant": false, "id": 1643, "mutability": "mutable", "name": "digits", "nameLocation": "695:6:9", "nodeType": "VariableDeclaration", "scope": 1701, "src": "687:14:9", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1642, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "687:7:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 1644, "nodeType": "VariableDeclarationStatement", "src": "687:14:9" }, { "body": { "id": 1655, "nodeType": "Block", "src": "729:57:9", "statements": [ { "expression": { "id": 1649, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "++", "prefix": false, "src": "743:8:9", "subExpression": { "id": 1648, "name": "digits", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1643, "src": "743:6:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 1650, "nodeType": "ExpressionStatement", "src": "743:8:9" }, { "expression": { "id": 1653, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 1651, "name": "temp", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1639, "src": "765:4:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "/=", "rightHandSide": { "hexValue": "3130", "id": 1652, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "773:2:9", "typeDescriptions": { "typeIdentifier": "t_rational_10_by_1", "typeString": "int_const 10" }, "value": "10" }, "src": "765:10:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 1654, "nodeType": "ExpressionStatement", "src": "765:10:9" } ] }, "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1647, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1645, "name": "temp", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1639, "src": "718:4:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "hexValue": "30", "id": 1646, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "726:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "718:9:9", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 1656, "nodeType": "WhileStatement", "src": "711:75:9" }, { "assignments": [ 1658 ], "declarations": [ { "constant": false, "id": 1658, "mutability": "mutable", "name": "buffer", "nameLocation": "808:6:9", "nodeType": "VariableDeclaration", "scope": 1701, "src": "795:19:9", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 1657, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "795:5:9", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "visibility": "internal" } ], "id": 1663, "initialValue": { "arguments": [ { "id": 1661, "name": "digits", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1643, "src": "827:6:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 1660, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "NewExpression", "src": "817:9:9", "typeDescriptions": { "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_bytes_memory_ptr_$", "typeString": "function (uint256) pure returns (bytes memory)" }, "typeName": { "id": 1659, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "821:5:9", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } } }, "id": 1662, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "817:17:9", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, "nodeType": "VariableDeclarationStatement", "src": "795:39:9" }, { "body": { "id": 1694, "nodeType": "Block", "src": "863:131:9", "statements": [ { "expression": { "id": 1669, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 1667, "name": "digits", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1643, "src": "877:6:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "-=", "rightHandSide": { "hexValue": "31", "id": 1668, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "887:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "877:11:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 1670, "nodeType": "ExpressionStatement", "src": "877:11:9" }, { "expression": { "id": 1688, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "baseExpression": { "id": 1671, "name": "buffer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1658, "src": "902:6:9", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, "id": 1673, "indexExpression": { "id": 1672, "name": "digits", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1643, "src": "909:6:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", "src": "902:14:9", "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "arguments": [ { "arguments": [ { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1685, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "hexValue": "3438", "id": 1678, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "932:2:9", "typeDescriptions": { "typeIdentifier": "t_rational_48_by_1", "typeString": "int_const 48" }, "value": "48" }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "arguments": [ { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1683, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1681, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1626, "src": "945:5:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "%", "rightExpression": { "hexValue": "3130", "id": 1682, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "953:2:9", "typeDescriptions": { "typeIdentifier": "t_rational_10_by_1", "typeString": "int_const 10" }, "value": "10" }, "src": "945:10:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 1680, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "937:7:9", "typeDescriptions": { "typeIdentifier": "t_type$_t_uint256_$", "typeString": "type(uint256)" }, "typeName": { "id": 1679, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "937:7:9", "typeDescriptions": {} } }, "id": 1684, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "937:19:9", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "932:24:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 1677, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "926:5:9", "typeDescriptions": { "typeIdentifier": "t_type$_t_uint8_$", "typeString": "type(uint8)" }, "typeName": { "id": 1676, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "926:5:9", "typeDescriptions": {} } }, "id": 1686, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "926:31:9", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint8", "typeString": "uint8" } ], "id": 1675, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "919:6:9", "typeDescriptions": { "typeIdentifier": "t_type$_t_bytes1_$", "typeString": "type(bytes1)" }, "typeName": { "id": 1674, "name": "bytes1", "nodeType": "ElementaryTypeName", "src": "919:6:9", "typeDescriptions": {} } }, "id": 1687, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "919:39:9", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" } }, "src": "902:56:9", "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" } }, "id": 1689, "nodeType": "ExpressionStatement", "src": "902:56:9" }, { "expression": { "id": 1692, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 1690, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1626, "src": "972:5:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "/=", "rightHandSide": { "hexValue": "3130", "id": 1691, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "981:2:9", "typeDescriptions": { "typeIdentifier": "t_rational_10_by_1", "typeString": "int_const 10" }, "value": "10" }, "src": "972:11:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 1693, "nodeType": "ExpressionStatement", "src": "972:11:9" } ] }, "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1666, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1664, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1626, "src": "851:5:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "hexValue": "30", "id": 1665, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "860:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "851:10:9", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 1695, "nodeType": "WhileStatement", "src": "844:150:9" }, { "expression": { "arguments": [ { "id": 1698, "name": "buffer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1658, "src": "1017:6:9", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } ], "id": 1697, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "1010:6:9", "typeDescriptions": { "typeIdentifier": "t_type$_t_string_storage_ptr_$", "typeString": "type(string storage pointer)" }, "typeName": { "id": 1696, "name": "string", "nodeType": "ElementaryTypeName", "src": "1010:6:9", "typeDescriptions": {} } }, "id": 1699, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1010:14:9", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } }, "functionReturnParameters": 1630, "id": 1700, "nodeType": "Return", "src": "1003:21:9" } ] }, "documentation": { "id": 1624, "nodeType": "StructuredDocumentation", "src": "233:90:9", "text": " @dev Converts a `uint256` to its ASCII `string` decimal representation." }, "id": 1702, "implemented": true, "kind": "function", "modifiers": [], "name": "toString", "nameLocation": "337:8:9", "nodeType": "FunctionDefinition", "parameters": { "id": 1627, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1626, "mutability": "mutable", "name": "value", "nameLocation": "354:5:9", "nodeType": "VariableDeclaration", "scope": 1702, "src": "346:13:9", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1625, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "346:7:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "345:15:9" }, "returnParameters": { "id": 1630, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1629, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 1702, "src": "384:13:9", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 1628, "name": "string", "nodeType": "ElementaryTypeName", "src": "384:6:9", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "visibility": "internal" } ], "src": "383:15:9" }, "scope": 1820, "src": "328:703:9", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 1742, "nodeType": "Block", "src": "1210:255:9", "statements": [ { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1712, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1710, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1705, "src": "1224:5:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "hexValue": "30", "id": 1711, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1233:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "1224:10:9", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 1716, "nodeType": "IfStatement", "src": "1220:54:9", "trueBody": { "id": 1715, "nodeType": "Block", "src": "1236:38:9", "statements": [ { "expression": { "hexValue": "30783030", "id": 1713, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1257:6:9", "typeDescriptions": { "typeIdentifier": "t_stringliteral_27489e20a0060b723a1748bdff5e44570ee9fae64141728105692eac6031e8a4", "typeString": "literal_string \"0x00\"" }, "value": "0x00" }, "functionReturnParameters": 1709, "id": 1714, "nodeType": "Return", "src": "1250:13:9" } ] } }, { "assignments": [ 1718 ], "declarations": [ { "constant": false, "id": 1718, "mutability": "mutable", "name": "temp", "nameLocation": "1291:4:9", "nodeType": "VariableDeclaration", "scope": 1742, "src": "1283:12:9", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1717, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1283:7:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 1720, "initialValue": { "id": 1719, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1705, "src": "1298:5:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "1283:20:9" }, { "assignments": [ 1722 ], "declarations": [ { "constant": false, "id": 1722, "mutability": "mutable", "name": "length", "nameLocation": "1321:6:9", "nodeType": "VariableDeclaration", "scope": 1742, "src": "1313:14:9", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1721, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1313:7:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 1724, "initialValue": { "hexValue": "30", "id": 1723, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1330:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "nodeType": "VariableDeclarationStatement", "src": "1313:18:9" }, { "body": { "id": 1735, "nodeType": "Block", "src": "1359:57:9", "statements": [ { "expression": { "id": 1729, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "++", "prefix": false, "src": "1373:8:9", "subExpression": { "id": 1728, "name": "length", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1722, "src": "1373:6:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 1730, "nodeType": "ExpressionStatement", "src": "1373:8:9" }, { "expression": { "id": 1733, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 1731, "name": "temp", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1718, "src": "1395:4:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": ">>=", "rightHandSide": { "hexValue": "38", "id": 1732, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1404:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_8_by_1", "typeString": "int_const 8" }, "value": "8" }, "src": "1395:10:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 1734, "nodeType": "ExpressionStatement", "src": "1395:10:9" } ] }, "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1727, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1725, "name": "temp", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1718, "src": "1348:4:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "hexValue": "30", "id": 1726, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1356:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "1348:9:9", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 1736, "nodeType": "WhileStatement", "src": "1341:75:9" }, { "expression": { "arguments": [ { "id": 1738, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1705, "src": "1444:5:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "id": 1739, "name": "length", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1722, "src": "1451:6:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 1737, "name": "toHexString", "nodeType": "Identifier", "overloadedDeclarations": [ 1743, 1819 ], "referencedDeclaration": 1819, "src": "1432:11:9", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_string_memory_ptr_$", "typeString": "function (uint256,uint256) pure returns (string memory)" } }, "id": 1740, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1432:26:9", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } }, "functionReturnParameters": 1709, "id": 1741, "nodeType": "Return", "src": "1425:33:9" } ] }, "documentation": { "id": 1703, "nodeType": "StructuredDocumentation", "src": "1037:94:9", "text": " @dev Converts a `uint256` to its ASCII `string` hexadecimal representation." }, "id": 1743, "implemented": true, "kind": "function", "modifiers": [], "name": "toHexString", "nameLocation": "1145:11:9", "nodeType": "FunctionDefinition", "parameters": { "id": 1706, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1705, "mutability": "mutable", "name": "value", "nameLocation": "1165:5:9", "nodeType": "VariableDeclaration", "scope": 1743, "src": "1157:13:9", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1704, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1157:7:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "1156:15:9" }, "returnParameters": { "id": 1709, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1708, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 1743, "src": "1195:13:9", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 1707, "name": "string", "nodeType": "ElementaryTypeName", "src": "1195:6:9", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "visibility": "internal" } ], "src": "1194:15:9" }, "scope": 1820, "src": "1136:329:9", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 1818, "nodeType": "Block", "src": "1678:351:9", "statements": [ { "assignments": [ 1754 ], "declarations": [ { "constant": false, "id": 1754, "mutability": "mutable", "name": "buffer", "nameLocation": "1701:6:9", "nodeType": "VariableDeclaration", "scope": 1818, "src": "1688:19:9", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 1753, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "1688:5:9", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "visibility": "internal" } ], "id": 1763, "initialValue": { "arguments": [ { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1761, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1759, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "hexValue": "32", "id": 1757, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1720:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2" }, "value": "2" }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "id": 1758, "name": "length", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1748, "src": "1724:6:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1720:10:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "hexValue": "32", "id": 1760, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1733:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2" }, "value": "2" }, "src": "1720:14:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 1756, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "NewExpression", "src": "1710:9:9", "typeDescriptions": { "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_bytes_memory_ptr_$", "typeString": "function (uint256) pure returns (bytes memory)" }, "typeName": { "id": 1755, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "1714:5:9", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } } }, "id": 1762, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1710:25:9", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, "nodeType": "VariableDeclarationStatement", "src": "1688:47:9" }, { "expression": { "id": 1768, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "baseExpression": { "id": 1764, "name": "buffer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1754, "src": "1745:6:9", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, "id": 1766, "indexExpression": { "hexValue": "30", "id": 1765, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1752:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", "src": "1745:9:9", "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "hexValue": "30", "id": 1767, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1757:3:9", "typeDescriptions": { "typeIdentifier": "t_stringliteral_044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d", "typeString": "literal_string \"0\"" }, "value": "0" }, "src": "1745:15:9", "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" } }, "id": 1769, "nodeType": "ExpressionStatement", "src": "1745:15:9" }, { "expression": { "id": 1774, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "baseExpression": { "id": 1770, "name": "buffer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1754, "src": "1770:6:9", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, "id": 1772, "indexExpression": { "hexValue": "31", "id": 1771, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1777:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", "src": "1770:9:9", "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "hexValue": "78", "id": 1773, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1782:3:9", "typeDescriptions": { "typeIdentifier": "t_stringliteral_7521d1cadbcfa91eec65aa16715b94ffc1c9654ba57ea2ef1a2127bca1127a83", "typeString": "literal_string \"x\"" }, "value": "x" }, "src": "1770:15:9", "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" } }, "id": 1775, "nodeType": "ExpressionStatement", "src": "1770:15:9" }, { "body": { "id": 1804, "nodeType": "Block", "src": "1840:87:9", "statements": [ { "expression": { "id": 1798, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "baseExpression": { "id": 1790, "name": "buffer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1754, "src": "1854:6:9", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, "id": 1792, "indexExpression": { "id": 1791, "name": "i", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1777, "src": "1861:1:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", "src": "1854:9:9", "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "baseExpression": { "id": 1793, "name": "_HEX_SYMBOLS", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1623, "src": "1866:12:9", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" } }, "id": 1797, "indexExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1796, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1794, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1746, "src": "1879:5:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "&", "rightExpression": { "hexValue": "307866", "id": 1795, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1887:3:9", "typeDescriptions": { "typeIdentifier": "t_rational_15_by_1", "typeString": "int_const 15" }, "value": "0xf" }, "src": "1879:11:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", "src": "1866:25:9", "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" } }, "src": "1854:37:9", "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" } }, "id": 1799, "nodeType": "ExpressionStatement", "src": "1854:37:9" }, { "expression": { "id": 1802, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 1800, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1746, "src": "1905:5:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": ">>=", "rightHandSide": { "hexValue": "34", "id": 1801, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1915:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_4_by_1", "typeString": "int_const 4" }, "value": "4" }, "src": "1905:11:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 1803, "nodeType": "ExpressionStatement", "src": "1905:11:9" } ] }, "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1786, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1784, "name": "i", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1777, "src": "1828:1:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "hexValue": "31", "id": 1785, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1832:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "1828:5:9", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 1805, "initializationExpression": { "assignments": [ 1777 ], "declarations": [ { "constant": false, "id": 1777, "mutability": "mutable", "name": "i", "nameLocation": "1808:1:9", "nodeType": "VariableDeclaration", "scope": 1805, "src": "1800:9:9", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1776, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1800:7:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 1783, "initialValue": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1782, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1780, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "hexValue": "32", "id": 1778, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1812:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2" }, "value": "2" }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "id": 1779, "name": "length", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1748, "src": "1816:6:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1812:10:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "hexValue": "31", "id": 1781, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1825:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "1812:14:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "1800:26:9" }, "loopExpression": { "expression": { "id": 1788, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "--", "prefix": true, "src": "1835:3:9", "subExpression": { "id": 1787, "name": "i", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1777, "src": "1837:1:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 1789, "nodeType": "ExpressionStatement", "src": "1835:3:9" }, "nodeType": "ForStatement", "src": "1795:132:9" }, { "expression": { "arguments": [ { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1809, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1807, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1746, "src": "1944:5:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "hexValue": "30", "id": 1808, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1953:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "1944:10:9", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "hexValue": "537472696e67733a20686578206c656e67746820696e73756666696369656e74", "id": 1810, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1956:34:9", "typeDescriptions": { "typeIdentifier": "t_stringliteral_04fc88320d7c9f639317c75102c103ff0044d3075a5c627e24e76e5bbb2733c2", "typeString": "literal_string \"Strings: hex length insufficient\"" }, "value": "Strings: hex length insufficient" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_04fc88320d7c9f639317c75102c103ff0044d3075a5c627e24e76e5bbb2733c2", "typeString": "literal_string \"Strings: hex length insufficient\"" } ], "id": 1806, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 4294967278, 4294967278 ], "referencedDeclaration": 4294967278, "src": "1936:7:9", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 1811, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1936:55:9", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1812, "nodeType": "ExpressionStatement", "src": "1936:55:9" }, { "expression": { "arguments": [ { "id": 1815, "name": "buffer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1754, "src": "2015:6:9", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } ], "id": 1814, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "2008:6:9", "typeDescriptions": { "typeIdentifier": "t_type$_t_string_storage_ptr_$", "typeString": "type(string storage pointer)" }, "typeName": { "id": 1813, "name": "string", "nodeType": "ElementaryTypeName", "src": "2008:6:9", "typeDescriptions": {} } }, "id": 1816, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2008:14:9", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } }, "functionReturnParameters": 1752, "id": 1817, "nodeType": "Return", "src": "2001:21:9" } ] }, "documentation": { "id": 1744, "nodeType": "StructuredDocumentation", "src": "1471:112:9", "text": " @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length." }, "id": 1819, "implemented": true, "kind": "function", "modifiers": [], "name": "toHexString", "nameLocation": "1597:11:9", "nodeType": "FunctionDefinition", "parameters": { "id": 1749, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1746, "mutability": "mutable", "name": "value", "nameLocation": "1617:5:9", "nodeType": "VariableDeclaration", "scope": 1819, "src": "1609:13:9", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1745, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1609:7:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" }, { "constant": false, "id": 1748, "mutability": "mutable", "name": "length", "nameLocation": "1632:6:9", "nodeType": "VariableDeclaration", "scope": 1819, "src": "1624:14:9", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1747, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1624:7:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "1608:31:9" }, "returnParameters": { "id": 1752, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1751, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 1819, "src": "1663:13:9", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 1750, "name": "string", "nodeType": "ElementaryTypeName", "src": "1663:6:9", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "visibility": "internal" } ], "src": "1662:15:9" }, "scope": 1820, "src": "1588:441:9", "stateMutability": "pure", "virtual": false, "visibility": "internal" } ], "scope": 1821, "src": "146:1885:9", "usedErrors": [] } ], "src": "86:1946:9" }, "legacyAST": { "absolutePath": "@openzeppelin/contracts/utils/Strings.sol", "exportedSymbols": { "Strings": [ 1820 ] }, "id": 1821, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 1619, "literals": [ "solidity", "^", "0.8", ".0" ], "nodeType": "PragmaDirective", "src": "86:23:9" }, { "abstract": false, "baseContracts": [], "canonicalName": "Strings", "contractDependencies": [], "contractKind": "library", "documentation": { "id": 1620, "nodeType": "StructuredDocumentation", "src": "111:34:9", "text": " @dev String operations." }, "fullyImplemented": true, "id": 1820, "linearizedBaseContracts": [ 1820 ], "name": "Strings", "nameLocation": "154:7:9", "nodeType": "ContractDefinition", "nodes": [ { "constant": true, "id": 1623, "mutability": "constant", "name": "_HEX_SYMBOLS", "nameLocation": "193:12:9", "nodeType": "VariableDeclaration", "scope": 1820, "src": "168:58:9", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" }, "typeName": { "id": 1621, "name": "bytes16", "nodeType": "ElementaryTypeName", "src": "168:7:9", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" } }, "value": { "hexValue": "30313233343536373839616263646566", "id": 1622, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "208:18:9", "typeDescriptions": { "typeIdentifier": "t_stringliteral_cb29997ed99ead0db59ce4d12b7d3723198c827273e5796737c926d78019c39f", "typeString": "literal_string \"0123456789abcdef\"" }, "value": "0123456789abcdef" }, "visibility": "private" }, { "body": { "id": 1701, "nodeType": "Block", "src": "399:632:9", "statements": [ { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1633, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1631, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1626, "src": "601:5:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "hexValue": "30", "id": 1632, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "610:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "601:10:9", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 1637, "nodeType": "IfStatement", "src": "597:51:9", "trueBody": { "id": 1636, "nodeType": "Block", "src": "613:35:9", "statements": [ { "expression": { "hexValue": "30", "id": 1634, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "634:3:9", "typeDescriptions": { "typeIdentifier": "t_stringliteral_044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d", "typeString": "literal_string \"0\"" }, "value": "0" }, "functionReturnParameters": 1630, "id": 1635, "nodeType": "Return", "src": "627:10:9" } ] } }, { "assignments": [ 1639 ], "declarations": [ { "constant": false, "id": 1639, "mutability": "mutable", "name": "temp", "nameLocation": "665:4:9", "nodeType": "VariableDeclaration", "scope": 1701, "src": "657:12:9", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1638, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "657:7:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 1641, "initialValue": { "id": 1640, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1626, "src": "672:5:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "657:20:9" }, { "assignments": [ 1643 ], "declarations": [ { "constant": false, "id": 1643, "mutability": "mutable", "name": "digits", "nameLocation": "695:6:9", "nodeType": "VariableDeclaration", "scope": 1701, "src": "687:14:9", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1642, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "687:7:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 1644, "nodeType": "VariableDeclarationStatement", "src": "687:14:9" }, { "body": { "id": 1655, "nodeType": "Block", "src": "729:57:9", "statements": [ { "expression": { "id": 1649, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "++", "prefix": false, "src": "743:8:9", "subExpression": { "id": 1648, "name": "digits", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1643, "src": "743:6:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 1650, "nodeType": "ExpressionStatement", "src": "743:8:9" }, { "expression": { "id": 1653, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 1651, "name": "temp", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1639, "src": "765:4:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "/=", "rightHandSide": { "hexValue": "3130", "id": 1652, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "773:2:9", "typeDescriptions": { "typeIdentifier": "t_rational_10_by_1", "typeString": "int_const 10" }, "value": "10" }, "src": "765:10:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 1654, "nodeType": "ExpressionStatement", "src": "765:10:9" } ] }, "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1647, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1645, "name": "temp", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1639, "src": "718:4:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "hexValue": "30", "id": 1646, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "726:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "718:9:9", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 1656, "nodeType": "WhileStatement", "src": "711:75:9" }, { "assignments": [ 1658 ], "declarations": [ { "constant": false, "id": 1658, "mutability": "mutable", "name": "buffer", "nameLocation": "808:6:9", "nodeType": "VariableDeclaration", "scope": 1701, "src": "795:19:9", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 1657, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "795:5:9", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "visibility": "internal" } ], "id": 1663, "initialValue": { "arguments": [ { "id": 1661, "name": "digits", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1643, "src": "827:6:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 1660, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "NewExpression", "src": "817:9:9", "typeDescriptions": { "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_bytes_memory_ptr_$", "typeString": "function (uint256) pure returns (bytes memory)" }, "typeName": { "id": 1659, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "821:5:9", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } } }, "id": 1662, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "817:17:9", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, "nodeType": "VariableDeclarationStatement", "src": "795:39:9" }, { "body": { "id": 1694, "nodeType": "Block", "src": "863:131:9", "statements": [ { "expression": { "id": 1669, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 1667, "name": "digits", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1643, "src": "877:6:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "-=", "rightHandSide": { "hexValue": "31", "id": 1668, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "887:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "877:11:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 1670, "nodeType": "ExpressionStatement", "src": "877:11:9" }, { "expression": { "id": 1688, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "baseExpression": { "id": 1671, "name": "buffer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1658, "src": "902:6:9", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, "id": 1673, "indexExpression": { "id": 1672, "name": "digits", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1643, "src": "909:6:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", "src": "902:14:9", "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "arguments": [ { "arguments": [ { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1685, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "hexValue": "3438", "id": 1678, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "932:2:9", "typeDescriptions": { "typeIdentifier": "t_rational_48_by_1", "typeString": "int_const 48" }, "value": "48" }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "arguments": [ { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1683, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1681, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1626, "src": "945:5:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "%", "rightExpression": { "hexValue": "3130", "id": 1682, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "953:2:9", "typeDescriptions": { "typeIdentifier": "t_rational_10_by_1", "typeString": "int_const 10" }, "value": "10" }, "src": "945:10:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 1680, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "937:7:9", "typeDescriptions": { "typeIdentifier": "t_type$_t_uint256_$", "typeString": "type(uint256)" }, "typeName": { "id": 1679, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "937:7:9", "typeDescriptions": {} } }, "id": 1684, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "937:19:9", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "932:24:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 1677, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "926:5:9", "typeDescriptions": { "typeIdentifier": "t_type$_t_uint8_$", "typeString": "type(uint8)" }, "typeName": { "id": 1676, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "926:5:9", "typeDescriptions": {} } }, "id": 1686, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "926:31:9", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint8", "typeString": "uint8" } ], "id": 1675, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "919:6:9", "typeDescriptions": { "typeIdentifier": "t_type$_t_bytes1_$", "typeString": "type(bytes1)" }, "typeName": { "id": 1674, "name": "bytes1", "nodeType": "ElementaryTypeName", "src": "919:6:9", "typeDescriptions": {} } }, "id": 1687, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "919:39:9", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" } }, "src": "902:56:9", "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" } }, "id": 1689, "nodeType": "ExpressionStatement", "src": "902:56:9" }, { "expression": { "id": 1692, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 1690, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1626, "src": "972:5:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "/=", "rightHandSide": { "hexValue": "3130", "id": 1691, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "981:2:9", "typeDescriptions": { "typeIdentifier": "t_rational_10_by_1", "typeString": "int_const 10" }, "value": "10" }, "src": "972:11:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 1693, "nodeType": "ExpressionStatement", "src": "972:11:9" } ] }, "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1666, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1664, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1626, "src": "851:5:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "hexValue": "30", "id": 1665, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "860:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "851:10:9", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 1695, "nodeType": "WhileStatement", "src": "844:150:9" }, { "expression": { "arguments": [ { "id": 1698, "name": "buffer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1658, "src": "1017:6:9", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } ], "id": 1697, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "1010:6:9", "typeDescriptions": { "typeIdentifier": "t_type$_t_string_storage_ptr_$", "typeString": "type(string storage pointer)" }, "typeName": { "id": 1696, "name": "string", "nodeType": "ElementaryTypeName", "src": "1010:6:9", "typeDescriptions": {} } }, "id": 1699, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1010:14:9", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } }, "functionReturnParameters": 1630, "id": 1700, "nodeType": "Return", "src": "1003:21:9" } ] }, "documentation": { "id": 1624, "nodeType": "StructuredDocumentation", "src": "233:90:9", "text": " @dev Converts a `uint256` to its ASCII `string` decimal representation." }, "id": 1702, "implemented": true, "kind": "function", "modifiers": [], "name": "toString", "nameLocation": "337:8:9", "nodeType": "FunctionDefinition", "parameters": { "id": 1627, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1626, "mutability": "mutable", "name": "value", "nameLocation": "354:5:9", "nodeType": "VariableDeclaration", "scope": 1702, "src": "346:13:9", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1625, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "346:7:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "345:15:9" }, "returnParameters": { "id": 1630, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1629, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 1702, "src": "384:13:9", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 1628, "name": "string", "nodeType": "ElementaryTypeName", "src": "384:6:9", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "visibility": "internal" } ], "src": "383:15:9" }, "scope": 1820, "src": "328:703:9", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 1742, "nodeType": "Block", "src": "1210:255:9", "statements": [ { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1712, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1710, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1705, "src": "1224:5:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "hexValue": "30", "id": 1711, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1233:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "1224:10:9", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 1716, "nodeType": "IfStatement", "src": "1220:54:9", "trueBody": { "id": 1715, "nodeType": "Block", "src": "1236:38:9", "statements": [ { "expression": { "hexValue": "30783030", "id": 1713, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1257:6:9", "typeDescriptions": { "typeIdentifier": "t_stringliteral_27489e20a0060b723a1748bdff5e44570ee9fae64141728105692eac6031e8a4", "typeString": "literal_string \"0x00\"" }, "value": "0x00" }, "functionReturnParameters": 1709, "id": 1714, "nodeType": "Return", "src": "1250:13:9" } ] } }, { "assignments": [ 1718 ], "declarations": [ { "constant": false, "id": 1718, "mutability": "mutable", "name": "temp", "nameLocation": "1291:4:9", "nodeType": "VariableDeclaration", "scope": 1742, "src": "1283:12:9", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1717, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1283:7:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 1720, "initialValue": { "id": 1719, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1705, "src": "1298:5:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "1283:20:9" }, { "assignments": [ 1722 ], "declarations": [ { "constant": false, "id": 1722, "mutability": "mutable", "name": "length", "nameLocation": "1321:6:9", "nodeType": "VariableDeclaration", "scope": 1742, "src": "1313:14:9", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1721, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1313:7:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 1724, "initialValue": { "hexValue": "30", "id": 1723, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1330:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "nodeType": "VariableDeclarationStatement", "src": "1313:18:9" }, { "body": { "id": 1735, "nodeType": "Block", "src": "1359:57:9", "statements": [ { "expression": { "id": 1729, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "++", "prefix": false, "src": "1373:8:9", "subExpression": { "id": 1728, "name": "length", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1722, "src": "1373:6:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 1730, "nodeType": "ExpressionStatement", "src": "1373:8:9" }, { "expression": { "id": 1733, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 1731, "name": "temp", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1718, "src": "1395:4:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": ">>=", "rightHandSide": { "hexValue": "38", "id": 1732, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1404:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_8_by_1", "typeString": "int_const 8" }, "value": "8" }, "src": "1395:10:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 1734, "nodeType": "ExpressionStatement", "src": "1395:10:9" } ] }, "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1727, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1725, "name": "temp", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1718, "src": "1348:4:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "hexValue": "30", "id": 1726, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1356:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "1348:9:9", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 1736, "nodeType": "WhileStatement", "src": "1341:75:9" }, { "expression": { "arguments": [ { "id": 1738, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1705, "src": "1444:5:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "id": 1739, "name": "length", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1722, "src": "1451:6:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 1737, "name": "toHexString", "nodeType": "Identifier", "overloadedDeclarations": [ 1743, 1819 ], "referencedDeclaration": 1819, "src": "1432:11:9", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_string_memory_ptr_$", "typeString": "function (uint256,uint256) pure returns (string memory)" } }, "id": 1740, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1432:26:9", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } }, "functionReturnParameters": 1709, "id": 1741, "nodeType": "Return", "src": "1425:33:9" } ] }, "documentation": { "id": 1703, "nodeType": "StructuredDocumentation", "src": "1037:94:9", "text": " @dev Converts a `uint256` to its ASCII `string` hexadecimal representation." }, "id": 1743, "implemented": true, "kind": "function", "modifiers": [], "name": "toHexString", "nameLocation": "1145:11:9", "nodeType": "FunctionDefinition", "parameters": { "id": 1706, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1705, "mutability": "mutable", "name": "value", "nameLocation": "1165:5:9", "nodeType": "VariableDeclaration", "scope": 1743, "src": "1157:13:9", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1704, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1157:7:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "1156:15:9" }, "returnParameters": { "id": 1709, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1708, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 1743, "src": "1195:13:9", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 1707, "name": "string", "nodeType": "ElementaryTypeName", "src": "1195:6:9", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "visibility": "internal" } ], "src": "1194:15:9" }, "scope": 1820, "src": "1136:329:9", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 1818, "nodeType": "Block", "src": "1678:351:9", "statements": [ { "assignments": [ 1754 ], "declarations": [ { "constant": false, "id": 1754, "mutability": "mutable", "name": "buffer", "nameLocation": "1701:6:9", "nodeType": "VariableDeclaration", "scope": 1818, "src": "1688:19:9", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 1753, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "1688:5:9", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "visibility": "internal" } ], "id": 1763, "initialValue": { "arguments": [ { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1761, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1759, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "hexValue": "32", "id": 1757, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1720:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2" }, "value": "2" }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "id": 1758, "name": "length", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1748, "src": "1724:6:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1720:10:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "hexValue": "32", "id": 1760, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1733:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2" }, "value": "2" }, "src": "1720:14:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 1756, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "NewExpression", "src": "1710:9:9", "typeDescriptions": { "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_bytes_memory_ptr_$", "typeString": "function (uint256) pure returns (bytes memory)" }, "typeName": { "id": 1755, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "1714:5:9", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } } }, "id": 1762, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1710:25:9", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, "nodeType": "VariableDeclarationStatement", "src": "1688:47:9" }, { "expression": { "id": 1768, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "baseExpression": { "id": 1764, "name": "buffer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1754, "src": "1745:6:9", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, "id": 1766, "indexExpression": { "hexValue": "30", "id": 1765, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1752:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", "src": "1745:9:9", "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "hexValue": "30", "id": 1767, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1757:3:9", "typeDescriptions": { "typeIdentifier": "t_stringliteral_044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d", "typeString": "literal_string \"0\"" }, "value": "0" }, "src": "1745:15:9", "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" } }, "id": 1769, "nodeType": "ExpressionStatement", "src": "1745:15:9" }, { "expression": { "id": 1774, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "baseExpression": { "id": 1770, "name": "buffer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1754, "src": "1770:6:9", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, "id": 1772, "indexExpression": { "hexValue": "31", "id": 1771, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1777:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", "src": "1770:9:9", "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "hexValue": "78", "id": 1773, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1782:3:9", "typeDescriptions": { "typeIdentifier": "t_stringliteral_7521d1cadbcfa91eec65aa16715b94ffc1c9654ba57ea2ef1a2127bca1127a83", "typeString": "literal_string \"x\"" }, "value": "x" }, "src": "1770:15:9", "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" } }, "id": 1775, "nodeType": "ExpressionStatement", "src": "1770:15:9" }, { "body": { "id": 1804, "nodeType": "Block", "src": "1840:87:9", "statements": [ { "expression": { "id": 1798, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "baseExpression": { "id": 1790, "name": "buffer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1754, "src": "1854:6:9", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, "id": 1792, "indexExpression": { "id": 1791, "name": "i", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1777, "src": "1861:1:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", "src": "1854:9:9", "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "baseExpression": { "id": 1793, "name": "_HEX_SYMBOLS", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1623, "src": "1866:12:9", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" } }, "id": 1797, "indexExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1796, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1794, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1746, "src": "1879:5:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "&", "rightExpression": { "hexValue": "307866", "id": 1795, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1887:3:9", "typeDescriptions": { "typeIdentifier": "t_rational_15_by_1", "typeString": "int_const 15" }, "value": "0xf" }, "src": "1879:11:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", "src": "1866:25:9", "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" } }, "src": "1854:37:9", "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" } }, "id": 1799, "nodeType": "ExpressionStatement", "src": "1854:37:9" }, { "expression": { "id": 1802, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 1800, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1746, "src": "1905:5:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": ">>=", "rightHandSide": { "hexValue": "34", "id": 1801, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1915:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_4_by_1", "typeString": "int_const 4" }, "value": "4" }, "src": "1905:11:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 1803, "nodeType": "ExpressionStatement", "src": "1905:11:9" } ] }, "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1786, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1784, "name": "i", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1777, "src": "1828:1:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "hexValue": "31", "id": 1785, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1832:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "1828:5:9", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 1805, "initializationExpression": { "assignments": [ 1777 ], "declarations": [ { "constant": false, "id": 1777, "mutability": "mutable", "name": "i", "nameLocation": "1808:1:9", "nodeType": "VariableDeclaration", "scope": 1805, "src": "1800:9:9", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1776, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1800:7:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 1783, "initialValue": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1782, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1780, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "hexValue": "32", "id": 1778, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1812:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2" }, "value": "2" }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "id": 1779, "name": "length", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1748, "src": "1816:6:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1812:10:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "hexValue": "31", "id": 1781, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1825:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "1812:14:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "1800:26:9" }, "loopExpression": { "expression": { "id": 1788, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "--", "prefix": true, "src": "1835:3:9", "subExpression": { "id": 1787, "name": "i", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1777, "src": "1837:1:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 1789, "nodeType": "ExpressionStatement", "src": "1835:3:9" }, "nodeType": "ForStatement", "src": "1795:132:9" }, { "expression": { "arguments": [ { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1809, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 1807, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1746, "src": "1944:5:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "hexValue": "30", "id": 1808, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1953:1:9", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "1944:10:9", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "hexValue": "537472696e67733a20686578206c656e67746820696e73756666696369656e74", "id": 1810, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1956:34:9", "typeDescriptions": { "typeIdentifier": "t_stringliteral_04fc88320d7c9f639317c75102c103ff0044d3075a5c627e24e76e5bbb2733c2", "typeString": "literal_string \"Strings: hex length insufficient\"" }, "value": "Strings: hex length insufficient" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_04fc88320d7c9f639317c75102c103ff0044d3075a5c627e24e76e5bbb2733c2", "typeString": "literal_string \"Strings: hex length insufficient\"" } ], "id": 1806, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 4294967278, 4294967278 ], "referencedDeclaration": 4294967278, "src": "1936:7:9", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 1811, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1936:55:9", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1812, "nodeType": "ExpressionStatement", "src": "1936:55:9" }, { "expression": { "arguments": [ { "id": 1815, "name": "buffer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1754, "src": "2015:6:9", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } ], "id": 1814, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "2008:6:9", "typeDescriptions": { "typeIdentifier": "t_type$_t_string_storage_ptr_$", "typeString": "type(string storage pointer)" }, "typeName": { "id": 1813, "name": "string", "nodeType": "ElementaryTypeName", "src": "2008:6:9", "typeDescriptions": {} } }, "id": 1816, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2008:14:9", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } }, "functionReturnParameters": 1752, "id": 1817, "nodeType": "Return", "src": "2001:21:9" } ] }, "documentation": { "id": 1744, "nodeType": "StructuredDocumentation", "src": "1471:112:9", "text": " @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length." }, "id": 1819, "implemented": true, "kind": "function", "modifiers": [], "name": "toHexString", "nameLocation": "1597:11:9", "nodeType": "FunctionDefinition", "parameters": { "id": 1749, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1746, "mutability": "mutable", "name": "value", "nameLocation": "1617:5:9", "nodeType": "VariableDeclaration", "scope": 1819, "src": "1609:13:9", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1745, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1609:7:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" }, { "constant": false, "id": 1748, "mutability": "mutable", "name": "length", "nameLocation": "1632:6:9", "nodeType": "VariableDeclaration", "scope": 1819, "src": "1624:14:9", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1747, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1624:7:9", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "1608:31:9" }, "returnParameters": { "id": 1752, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1751, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 1819, "src": "1663:13:9", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 1750, "name": "string", "nodeType": "ElementaryTypeName", "src": "1663:6:9", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "visibility": "internal" } ], "src": "1662:15:9" }, "scope": 1820, "src": "1588:441:9", "stateMutability": "pure", "virtual": false, "visibility": "internal" } ], "scope": 1821, "src": "146:1885:9", "usedErrors": [] } ], "src": "86:1946:9" }, "compiler": { "name": "solc", "version": "0.8.11+commit.d7f03943.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.4.4", "updatedAt": "2021-12-29T22:14:28.600Z", "devdoc": { "details": "String operations.", "kind": "dev", "methods": {}, "version": 1 }, "userdoc": { "kind": "user", "methods": {}, "version": 1 } }