secure-transac-contracts 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/build/contracts/AccessControl.json +4579 -0
  2. package/build/contracts/Context.json +356 -0
  3. package/build/contracts/CreditSystem.json +6037 -0
  4. package/build/contracts/ECDSA.json +4734 -0
  5. package/build/contracts/EIP712.json +3021 -0
  6. package/build/contracts/ERC165.json +352 -0
  7. package/build/contracts/ERC20.json +6816 -0
  8. package/build/contracts/ERC20Permit.json +2658 -0
  9. package/build/contracts/ERC721.json +12779 -0
  10. package/build/contracts/ERC721Utils.json +1058 -0
  11. package/build/contracts/Groth16Verifier.json +6298 -0
  12. package/build/contracts/Guardian.json +1116 -0
  13. package/build/contracts/IERC1155Errors.json +1687 -0
  14. package/build/contracts/IERC165.json +197 -0
  15. package/build/contracts/IERC20.json +1162 -0
  16. package/build/contracts/IERC20Errors.json +1662 -0
  17. package/build/contracts/IERC20Metadata.json +574 -0
  18. package/build/contracts/IERC20Permit.json +546 -0
  19. package/build/contracts/IERC5267.json +392 -0
  20. package/build/contracts/IERC721.json +1729 -0
  21. package/build/contracts/IERC721Errors.json +1694 -0
  22. package/build/contracts/IERC721Metadata.json +728 -0
  23. package/build/contracts/IERC721Receiver.json +296 -0
  24. package/build/contracts/IGuardian.json +215 -0
  25. package/build/contracts/ITrustRegistry.json +6767 -0
  26. package/build/contracts/IdentityVault.json +11584 -0
  27. package/build/contracts/Math.json +23115 -0
  28. package/build/contracts/MessageHashUtils.json +1668 -0
  29. package/build/contracts/Nonces.json +865 -0
  30. package/build/contracts/Ownable.json +1859 -0
  31. package/build/contracts/Panic.json +798 -0
  32. package/build/contracts/ReportingSystem.json +2787 -0
  33. package/build/contracts/SafeCast.json +21592 -0
  34. package/build/contracts/ScoringSystem.json +11245 -0
  35. package/build/contracts/SecureTransacSBT.json +18823 -0
  36. package/build/contracts/SecureTransacToken.json +19225 -0
  37. package/build/contracts/SecureVault.json +12890 -0
  38. package/build/contracts/ShortStrings.json +2852 -0
  39. package/build/contracts/SignedMath.json +1915 -0
  40. package/build/contracts/StorageSlot.json +1773 -0
  41. package/build/contracts/Strings.json +19001 -0
  42. package/build/contracts/TransactionLogger.json +5325 -0
  43. package/build/contracts/TrustDAO.json +23850 -0
  44. package/build/contracts/TrustRegistry.json +10948 -0
  45. package/build/contracts/VerificationRegistry.json +12811 -0
  46. package/build/contracts/ZKIdentityVerifier.json +13979 -0
  47. package/contracts/AccessControl.sol +34 -0
  48. package/contracts/CreditSystem.sol +48 -0
  49. package/contracts/Guardian.sol +33 -0
  50. package/contracts/IGuardian.sol +7 -0
  51. package/contracts/IdentityVault.sol +57 -0
  52. package/contracts/ReportingSystem.sol +14 -0
  53. package/contracts/ScoringSystem.sol +71 -0
  54. package/contracts/SecureTransacSBT.sol +72 -0
  55. package/contracts/SecureTransacToken.sol +20 -0
  56. package/contracts/SecureVault.sol +24 -0
  57. package/contracts/TransactionLogger.sol +12 -0
  58. package/contracts/TrustDAO.sol +158 -0
  59. package/contracts/TrustRegistry.sol +23 -0
  60. package/contracts/VerificationRegistry.sol +51 -0
  61. package/contracts/ZKIdentityVerifier.sol +38 -0
  62. package/contracts/ZKScoreVerifier.sol +175 -0
  63. package/package.json +32 -0
@@ -0,0 +1,2852 @@
1
+ {
2
+ "contractName": "ShortStrings",
3
+ "abi": [
4
+ {
5
+ "inputs": [],
6
+ "name": "InvalidShortString",
7
+ "type": "error"
8
+ },
9
+ {
10
+ "inputs": [
11
+ {
12
+ "internalType": "string",
13
+ "name": "str",
14
+ "type": "string"
15
+ }
16
+ ],
17
+ "name": "StringTooLong",
18
+ "type": "error"
19
+ }
20
+ ],
21
+ "metadata": "{\"compiler\":{\"version\":\"0.8.21+commit.d9974bed\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"InvalidShortString\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"str\",\"type\":\"string\"}],\"name\":\"StringTooLong\",\"type\":\"error\"}],\"devdoc\":{\"details\":\"This library provides functions to convert short memory strings into a `ShortString` type that can be used as an immutable variable. Strings of arbitrary length can be optimized using this library if they are short enough (up to 31 bytes) by packing them with their length (1 byte) in a single EVM word (32 bytes). Additionally, a fallback mechanism can be used for every other case. Usage example: ```solidity contract Named { using ShortStrings for *; ShortString private immutable _name; string private _nameFallback; constructor(string memory contractName) { _name = contractName.toShortStringWithFallback(_nameFallback); } function name() external view returns (string memory) { return _name.toStringWithFallback(_nameFallback); } } ```\",\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/utils/ShortStrings.sol\":\"ShortStrings\"},\"evmVersion\":\"shanghai\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/ShortStrings.sol\":{\"keccak256\":\"0x1fcf8cceb1a67e6c8512267e780933c4a3f63ef44756e6c818fda79be51c8402\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://617d7d57f6f9cd449068b4d23daf485676d083aae648e038d05eb3a13291de35\",\"dweb:/ipfs/QmPADWPiGaSzZDFNpFEUx4ZPqhzPkYncBpHyTfAGcfsqzy\"]},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"keccak256\":\"0xcf74f855663ce2ae00ed8352666b7935f6cddea2932fdf2c3ecd30a9b1cd0e97\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9f660b1f351b757dfe01438e59888f31f33ded3afcf5cb5b0d9bf9aa6f320a8b\",\"dweb:/ipfs/QmarDJ5hZEgBtCmmrVzEZWjub9769eD686jmzb2XpSU1cM\"]}},\"version\":1}",
22
+ "bytecode": "0x6055604b600b8282823980515f1a607314603f577f4e487b71000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b305f52607381538281f3fe730000000000000000000000000000000000000000301460806040525f80fdfea2646970667358221220bac5625985d89d3de469ea51e60c9d394a57b2b624654356d16b1c39dc46260f64736f6c63430008150033",
23
+ "deployedBytecode": "0x730000000000000000000000000000000000000000301460806040525f80fdfea2646970667358221220bac5625985d89d3de469ea51e60c9d394a57b2b624654356d16b1c39dc46260f64736f6c63430008150033",
24
+ "immutableReferences": {},
25
+ "generatedSources": [],
26
+ "deployedGeneratedSources": [],
27
+ "sourceMap": "1255:3046:16:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;",
28
+ "deployedSourceMap": "1255:3046:16:-:0;;;;;;;;",
29
+ "source": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/ShortStrings.sol)\n\npragma solidity ^0.8.20;\n\nimport {StorageSlot} from \"./StorageSlot.sol\";\n\n// | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |\n// | length | 0x BB |\ntype ShortString is bytes32;\n\n/**\n * @dev This library provides functions to convert short memory strings\n * into a `ShortString` type that can be used as an immutable variable.\n *\n * Strings of arbitrary length can be optimized using this library if\n * they are short enough (up to 31 bytes) by packing them with their\n * length (1 byte) in a single EVM word (32 bytes). Additionally, a\n * fallback mechanism can be used for every other case.\n *\n * Usage example:\n *\n * ```solidity\n * contract Named {\n * using ShortStrings for *;\n *\n * ShortString private immutable _name;\n * string private _nameFallback;\n *\n * constructor(string memory contractName) {\n * _name = contractName.toShortStringWithFallback(_nameFallback);\n * }\n *\n * function name() external view returns (string memory) {\n * return _name.toStringWithFallback(_nameFallback);\n * }\n * }\n * ```\n */\nlibrary ShortStrings {\n // Used as an identifier for strings longer than 31 bytes.\n bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;\n\n error StringTooLong(string str);\n error InvalidShortString();\n\n /**\n * @dev Encode a string of at most 31 chars into a `ShortString`.\n *\n * This will trigger a `StringTooLong` error is the input string is too long.\n */\n function toShortString(string memory str) internal pure returns (ShortString) {\n bytes memory bstr = bytes(str);\n if (bstr.length > 31) {\n revert StringTooLong(str);\n }\n return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));\n }\n\n /**\n * @dev Decode a `ShortString` back to a \"normal\" string.\n */\n function toString(ShortString sstr) internal pure returns (string memory) {\n uint256 len = byteLength(sstr);\n // using `new string(len)` would work locally but is not memory safe.\n string memory str = new string(32);\n assembly (\"memory-safe\") {\n mstore(str, len)\n mstore(add(str, 0x20), sstr)\n }\n return str;\n }\n\n /**\n * @dev Return the length of a `ShortString`.\n */\n function byteLength(ShortString sstr) internal pure returns (uint256) {\n uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;\n if (result > 31) {\n revert InvalidShortString();\n }\n return result;\n }\n\n /**\n * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.\n */\n function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {\n if (bytes(value).length < 32) {\n return toShortString(value);\n } else {\n StorageSlot.getStringSlot(store).value = value;\n return ShortString.wrap(FALLBACK_SENTINEL);\n }\n }\n\n /**\n * @dev Decode a string that was encoded to `ShortString` or written to storage using {toShortStringWithFallback}.\n */\n function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\n return toString(value);\n } else {\n return store;\n }\n }\n\n /**\n * @dev Return the length of a string that was encoded to `ShortString` or written to storage using\n * {toShortStringWithFallback}.\n *\n * WARNING: This will return the \"byte length\" of the string. This may not reflect the actual length in terms of\n * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.\n */\n function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\n return byteLength(value);\n } else {\n return bytes(store).length;\n }\n }\n}\n",
30
+ "sourcePath": "@openzeppelin\\contracts\\utils\\ShortStrings.sol",
31
+ "ast": {
32
+ "absolutePath": "@openzeppelin/contracts/utils/ShortStrings.sol",
33
+ "exportedSymbols": {
34
+ "ShortString": [
35
+ 2471
36
+ ],
37
+ "ShortStrings": [
38
+ 2682
39
+ ],
40
+ "StorageSlot": [
41
+ 2806
42
+ ]
43
+ },
44
+ "id": 2683,
45
+ "license": "MIT",
46
+ "nodeType": "SourceUnit",
47
+ "nodes": [
48
+ {
49
+ "id": 2467,
50
+ "literals": [
51
+ "solidity",
52
+ "^",
53
+ "0.8",
54
+ ".20"
55
+ ],
56
+ "nodeType": "PragmaDirective",
57
+ "src": "106:24:16"
58
+ },
59
+ {
60
+ "absolutePath": "@openzeppelin/contracts/utils/StorageSlot.sol",
61
+ "file": "./StorageSlot.sol",
62
+ "id": 2469,
63
+ "nameLocation": "-1:-1:-1",
64
+ "nodeType": "ImportDirective",
65
+ "scope": 2683,
66
+ "sourceUnit": 2807,
67
+ "src": "132:46:16",
68
+ "symbolAliases": [
69
+ {
70
+ "foreign": {
71
+ "id": 2468,
72
+ "name": "StorageSlot",
73
+ "nodeType": "Identifier",
74
+ "overloadedDeclarations": [],
75
+ "referencedDeclaration": 2806,
76
+ "src": "140:11:16",
77
+ "typeDescriptions": {}
78
+ },
79
+ "nameLocation": "-1:-1:-1"
80
+ }
81
+ ],
82
+ "unitAlias": ""
83
+ },
84
+ {
85
+ "canonicalName": "ShortString",
86
+ "id": 2471,
87
+ "name": "ShortString",
88
+ "nameLocation": "353:11:16",
89
+ "nodeType": "UserDefinedValueTypeDefinition",
90
+ "src": "348:28:16",
91
+ "underlyingType": {
92
+ "id": 2470,
93
+ "name": "bytes32",
94
+ "nodeType": "ElementaryTypeName",
95
+ "src": "368:7:16",
96
+ "typeDescriptions": {
97
+ "typeIdentifier": "t_bytes32",
98
+ "typeString": "bytes32"
99
+ }
100
+ }
101
+ },
102
+ {
103
+ "abstract": false,
104
+ "baseContracts": [],
105
+ "canonicalName": "ShortStrings",
106
+ "contractDependencies": [],
107
+ "contractKind": "library",
108
+ "documentation": {
109
+ "id": 2472,
110
+ "nodeType": "StructuredDocumentation",
111
+ "src": "378:876:16",
112
+ "text": " @dev This library provides functions to convert short memory strings\n into a `ShortString` type that can be used as an immutable variable.\n Strings of arbitrary length can be optimized using this library if\n they are short enough (up to 31 bytes) by packing them with their\n length (1 byte) in a single EVM word (32 bytes). Additionally, a\n fallback mechanism can be used for every other case.\n Usage example:\n ```solidity\n contract Named {\n using ShortStrings for *;\n ShortString private immutable _name;\n string private _nameFallback;\n constructor(string memory contractName) {\n _name = contractName.toShortStringWithFallback(_nameFallback);\n }\n function name() external view returns (string memory) {\n return _name.toStringWithFallback(_nameFallback);\n }\n }\n ```"
113
+ },
114
+ "fullyImplemented": true,
115
+ "id": 2682,
116
+ "linearizedBaseContracts": [
117
+ 2682
118
+ ],
119
+ "name": "ShortStrings",
120
+ "nameLocation": "1263:12:16",
121
+ "nodeType": "ContractDefinition",
122
+ "nodes": [
123
+ {
124
+ "constant": true,
125
+ "id": 2475,
126
+ "mutability": "constant",
127
+ "name": "FALLBACK_SENTINEL",
128
+ "nameLocation": "1370:17:16",
129
+ "nodeType": "VariableDeclaration",
130
+ "scope": 2682,
131
+ "src": "1345:111:16",
132
+ "stateVariable": true,
133
+ "storageLocation": "default",
134
+ "typeDescriptions": {
135
+ "typeIdentifier": "t_bytes32",
136
+ "typeString": "bytes32"
137
+ },
138
+ "typeName": {
139
+ "id": 2473,
140
+ "name": "bytes32",
141
+ "nodeType": "ElementaryTypeName",
142
+ "src": "1345:7:16",
143
+ "typeDescriptions": {
144
+ "typeIdentifier": "t_bytes32",
145
+ "typeString": "bytes32"
146
+ }
147
+ },
148
+ "value": {
149
+ "hexValue": "307830303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030304646",
150
+ "id": 2474,
151
+ "isConstant": false,
152
+ "isLValue": false,
153
+ "isPure": true,
154
+ "kind": "number",
155
+ "lValueRequested": false,
156
+ "nodeType": "Literal",
157
+ "src": "1390:66:16",
158
+ "typeDescriptions": {
159
+ "typeIdentifier": "t_rational_255_by_1",
160
+ "typeString": "int_const 255"
161
+ },
162
+ "value": "0x00000000000000000000000000000000000000000000000000000000000000FF"
163
+ },
164
+ "visibility": "private"
165
+ },
166
+ {
167
+ "errorSelector": "305a27a9",
168
+ "id": 2479,
169
+ "name": "StringTooLong",
170
+ "nameLocation": "1469:13:16",
171
+ "nodeType": "ErrorDefinition",
172
+ "parameters": {
173
+ "id": 2478,
174
+ "nodeType": "ParameterList",
175
+ "parameters": [
176
+ {
177
+ "constant": false,
178
+ "id": 2477,
179
+ "mutability": "mutable",
180
+ "name": "str",
181
+ "nameLocation": "1490:3:16",
182
+ "nodeType": "VariableDeclaration",
183
+ "scope": 2479,
184
+ "src": "1483:10:16",
185
+ "stateVariable": false,
186
+ "storageLocation": "default",
187
+ "typeDescriptions": {
188
+ "typeIdentifier": "t_string_memory_ptr",
189
+ "typeString": "string"
190
+ },
191
+ "typeName": {
192
+ "id": 2476,
193
+ "name": "string",
194
+ "nodeType": "ElementaryTypeName",
195
+ "src": "1483:6:16",
196
+ "typeDescriptions": {
197
+ "typeIdentifier": "t_string_storage_ptr",
198
+ "typeString": "string"
199
+ }
200
+ },
201
+ "visibility": "internal"
202
+ }
203
+ ],
204
+ "src": "1482:12:16"
205
+ },
206
+ "src": "1463:32:16"
207
+ },
208
+ {
209
+ "errorSelector": "b3512b0c",
210
+ "id": 2481,
211
+ "name": "InvalidShortString",
212
+ "nameLocation": "1506:18:16",
213
+ "nodeType": "ErrorDefinition",
214
+ "parameters": {
215
+ "id": 2480,
216
+ "nodeType": "ParameterList",
217
+ "parameters": [],
218
+ "src": "1524:2:16"
219
+ },
220
+ "src": "1500:27:16"
221
+ },
222
+ {
223
+ "body": {
224
+ "id": 2524,
225
+ "nodeType": "Block",
226
+ "src": "1786:208:16",
227
+ "statements": [
228
+ {
229
+ "assignments": [
230
+ 2491
231
+ ],
232
+ "declarations": [
233
+ {
234
+ "constant": false,
235
+ "id": 2491,
236
+ "mutability": "mutable",
237
+ "name": "bstr",
238
+ "nameLocation": "1809:4:16",
239
+ "nodeType": "VariableDeclaration",
240
+ "scope": 2524,
241
+ "src": "1796:17:16",
242
+ "stateVariable": false,
243
+ "storageLocation": "memory",
244
+ "typeDescriptions": {
245
+ "typeIdentifier": "t_bytes_memory_ptr",
246
+ "typeString": "bytes"
247
+ },
248
+ "typeName": {
249
+ "id": 2490,
250
+ "name": "bytes",
251
+ "nodeType": "ElementaryTypeName",
252
+ "src": "1796:5:16",
253
+ "typeDescriptions": {
254
+ "typeIdentifier": "t_bytes_storage_ptr",
255
+ "typeString": "bytes"
256
+ }
257
+ },
258
+ "visibility": "internal"
259
+ }
260
+ ],
261
+ "id": 2496,
262
+ "initialValue": {
263
+ "arguments": [
264
+ {
265
+ "id": 2494,
266
+ "name": "str",
267
+ "nodeType": "Identifier",
268
+ "overloadedDeclarations": [],
269
+ "referencedDeclaration": 2484,
270
+ "src": "1822:3:16",
271
+ "typeDescriptions": {
272
+ "typeIdentifier": "t_string_memory_ptr",
273
+ "typeString": "string memory"
274
+ }
275
+ }
276
+ ],
277
+ "expression": {
278
+ "argumentTypes": [
279
+ {
280
+ "typeIdentifier": "t_string_memory_ptr",
281
+ "typeString": "string memory"
282
+ }
283
+ ],
284
+ "id": 2493,
285
+ "isConstant": false,
286
+ "isLValue": false,
287
+ "isPure": true,
288
+ "lValueRequested": false,
289
+ "nodeType": "ElementaryTypeNameExpression",
290
+ "src": "1816:5:16",
291
+ "typeDescriptions": {
292
+ "typeIdentifier": "t_type$_t_bytes_storage_ptr_$",
293
+ "typeString": "type(bytes storage pointer)"
294
+ },
295
+ "typeName": {
296
+ "id": 2492,
297
+ "name": "bytes",
298
+ "nodeType": "ElementaryTypeName",
299
+ "src": "1816:5:16",
300
+ "typeDescriptions": {}
301
+ }
302
+ },
303
+ "id": 2495,
304
+ "isConstant": false,
305
+ "isLValue": false,
306
+ "isPure": false,
307
+ "kind": "typeConversion",
308
+ "lValueRequested": false,
309
+ "nameLocations": [],
310
+ "names": [],
311
+ "nodeType": "FunctionCall",
312
+ "src": "1816:10:16",
313
+ "tryCall": false,
314
+ "typeDescriptions": {
315
+ "typeIdentifier": "t_bytes_memory_ptr",
316
+ "typeString": "bytes memory"
317
+ }
318
+ },
319
+ "nodeType": "VariableDeclarationStatement",
320
+ "src": "1796:30:16"
321
+ },
322
+ {
323
+ "condition": {
324
+ "commonType": {
325
+ "typeIdentifier": "t_uint256",
326
+ "typeString": "uint256"
327
+ },
328
+ "id": 2500,
329
+ "isConstant": false,
330
+ "isLValue": false,
331
+ "isPure": false,
332
+ "lValueRequested": false,
333
+ "leftExpression": {
334
+ "expression": {
335
+ "id": 2497,
336
+ "name": "bstr",
337
+ "nodeType": "Identifier",
338
+ "overloadedDeclarations": [],
339
+ "referencedDeclaration": 2491,
340
+ "src": "1840:4:16",
341
+ "typeDescriptions": {
342
+ "typeIdentifier": "t_bytes_memory_ptr",
343
+ "typeString": "bytes memory"
344
+ }
345
+ },
346
+ "id": 2498,
347
+ "isConstant": false,
348
+ "isLValue": false,
349
+ "isPure": false,
350
+ "lValueRequested": false,
351
+ "memberLocation": "1845:6:16",
352
+ "memberName": "length",
353
+ "nodeType": "MemberAccess",
354
+ "src": "1840:11:16",
355
+ "typeDescriptions": {
356
+ "typeIdentifier": "t_uint256",
357
+ "typeString": "uint256"
358
+ }
359
+ },
360
+ "nodeType": "BinaryOperation",
361
+ "operator": ">",
362
+ "rightExpression": {
363
+ "hexValue": "3331",
364
+ "id": 2499,
365
+ "isConstant": false,
366
+ "isLValue": false,
367
+ "isPure": true,
368
+ "kind": "number",
369
+ "lValueRequested": false,
370
+ "nodeType": "Literal",
371
+ "src": "1854:2:16",
372
+ "typeDescriptions": {
373
+ "typeIdentifier": "t_rational_31_by_1",
374
+ "typeString": "int_const 31"
375
+ },
376
+ "value": "31"
377
+ },
378
+ "src": "1840:16:16",
379
+ "typeDescriptions": {
380
+ "typeIdentifier": "t_bool",
381
+ "typeString": "bool"
382
+ }
383
+ },
384
+ "id": 2506,
385
+ "nodeType": "IfStatement",
386
+ "src": "1836:72:16",
387
+ "trueBody": {
388
+ "id": 2505,
389
+ "nodeType": "Block",
390
+ "src": "1858:50:16",
391
+ "statements": [
392
+ {
393
+ "errorCall": {
394
+ "arguments": [
395
+ {
396
+ "id": 2502,
397
+ "name": "str",
398
+ "nodeType": "Identifier",
399
+ "overloadedDeclarations": [],
400
+ "referencedDeclaration": 2484,
401
+ "src": "1893:3:16",
402
+ "typeDescriptions": {
403
+ "typeIdentifier": "t_string_memory_ptr",
404
+ "typeString": "string memory"
405
+ }
406
+ }
407
+ ],
408
+ "expression": {
409
+ "argumentTypes": [
410
+ {
411
+ "typeIdentifier": "t_string_memory_ptr",
412
+ "typeString": "string memory"
413
+ }
414
+ ],
415
+ "id": 2501,
416
+ "name": "StringTooLong",
417
+ "nodeType": "Identifier",
418
+ "overloadedDeclarations": [],
419
+ "referencedDeclaration": 2479,
420
+ "src": "1879:13:16",
421
+ "typeDescriptions": {
422
+ "typeIdentifier": "t_function_error_pure$_t_string_memory_ptr_$returns$__$",
423
+ "typeString": "function (string memory) pure"
424
+ }
425
+ },
426
+ "id": 2503,
427
+ "isConstant": false,
428
+ "isLValue": false,
429
+ "isPure": false,
430
+ "kind": "functionCall",
431
+ "lValueRequested": false,
432
+ "nameLocations": [],
433
+ "names": [],
434
+ "nodeType": "FunctionCall",
435
+ "src": "1879:18:16",
436
+ "tryCall": false,
437
+ "typeDescriptions": {
438
+ "typeIdentifier": "t_tuple$__$",
439
+ "typeString": "tuple()"
440
+ }
441
+ },
442
+ "id": 2504,
443
+ "nodeType": "RevertStatement",
444
+ "src": "1872:25:16"
445
+ }
446
+ ]
447
+ }
448
+ },
449
+ {
450
+ "expression": {
451
+ "arguments": [
452
+ {
453
+ "arguments": [
454
+ {
455
+ "commonType": {
456
+ "typeIdentifier": "t_uint256",
457
+ "typeString": "uint256"
458
+ },
459
+ "id": 2520,
460
+ "isConstant": false,
461
+ "isLValue": false,
462
+ "isPure": false,
463
+ "lValueRequested": false,
464
+ "leftExpression": {
465
+ "arguments": [
466
+ {
467
+ "arguments": [
468
+ {
469
+ "id": 2515,
470
+ "name": "bstr",
471
+ "nodeType": "Identifier",
472
+ "overloadedDeclarations": [],
473
+ "referencedDeclaration": 2491,
474
+ "src": "1965:4:16",
475
+ "typeDescriptions": {
476
+ "typeIdentifier": "t_bytes_memory_ptr",
477
+ "typeString": "bytes memory"
478
+ }
479
+ }
480
+ ],
481
+ "expression": {
482
+ "argumentTypes": [
483
+ {
484
+ "typeIdentifier": "t_bytes_memory_ptr",
485
+ "typeString": "bytes memory"
486
+ }
487
+ ],
488
+ "id": 2514,
489
+ "isConstant": false,
490
+ "isLValue": false,
491
+ "isPure": true,
492
+ "lValueRequested": false,
493
+ "nodeType": "ElementaryTypeNameExpression",
494
+ "src": "1957:7:16",
495
+ "typeDescriptions": {
496
+ "typeIdentifier": "t_type$_t_bytes32_$",
497
+ "typeString": "type(bytes32)"
498
+ },
499
+ "typeName": {
500
+ "id": 2513,
501
+ "name": "bytes32",
502
+ "nodeType": "ElementaryTypeName",
503
+ "src": "1957:7:16",
504
+ "typeDescriptions": {}
505
+ }
506
+ },
507
+ "id": 2516,
508
+ "isConstant": false,
509
+ "isLValue": false,
510
+ "isPure": false,
511
+ "kind": "typeConversion",
512
+ "lValueRequested": false,
513
+ "nameLocations": [],
514
+ "names": [],
515
+ "nodeType": "FunctionCall",
516
+ "src": "1957:13:16",
517
+ "tryCall": false,
518
+ "typeDescriptions": {
519
+ "typeIdentifier": "t_bytes32",
520
+ "typeString": "bytes32"
521
+ }
522
+ }
523
+ ],
524
+ "expression": {
525
+ "argumentTypes": [
526
+ {
527
+ "typeIdentifier": "t_bytes32",
528
+ "typeString": "bytes32"
529
+ }
530
+ ],
531
+ "id": 2512,
532
+ "isConstant": false,
533
+ "isLValue": false,
534
+ "isPure": true,
535
+ "lValueRequested": false,
536
+ "nodeType": "ElementaryTypeNameExpression",
537
+ "src": "1949:7:16",
538
+ "typeDescriptions": {
539
+ "typeIdentifier": "t_type$_t_uint256_$",
540
+ "typeString": "type(uint256)"
541
+ },
542
+ "typeName": {
543
+ "id": 2511,
544
+ "name": "uint256",
545
+ "nodeType": "ElementaryTypeName",
546
+ "src": "1949:7:16",
547
+ "typeDescriptions": {}
548
+ }
549
+ },
550
+ "id": 2517,
551
+ "isConstant": false,
552
+ "isLValue": false,
553
+ "isPure": false,
554
+ "kind": "typeConversion",
555
+ "lValueRequested": false,
556
+ "nameLocations": [],
557
+ "names": [],
558
+ "nodeType": "FunctionCall",
559
+ "src": "1949:22:16",
560
+ "tryCall": false,
561
+ "typeDescriptions": {
562
+ "typeIdentifier": "t_uint256",
563
+ "typeString": "uint256"
564
+ }
565
+ },
566
+ "nodeType": "BinaryOperation",
567
+ "operator": "|",
568
+ "rightExpression": {
569
+ "expression": {
570
+ "id": 2518,
571
+ "name": "bstr",
572
+ "nodeType": "Identifier",
573
+ "overloadedDeclarations": [],
574
+ "referencedDeclaration": 2491,
575
+ "src": "1974:4:16",
576
+ "typeDescriptions": {
577
+ "typeIdentifier": "t_bytes_memory_ptr",
578
+ "typeString": "bytes memory"
579
+ }
580
+ },
581
+ "id": 2519,
582
+ "isConstant": false,
583
+ "isLValue": false,
584
+ "isPure": false,
585
+ "lValueRequested": false,
586
+ "memberLocation": "1979:6:16",
587
+ "memberName": "length",
588
+ "nodeType": "MemberAccess",
589
+ "src": "1974:11:16",
590
+ "typeDescriptions": {
591
+ "typeIdentifier": "t_uint256",
592
+ "typeString": "uint256"
593
+ }
594
+ },
595
+ "src": "1949:36:16",
596
+ "typeDescriptions": {
597
+ "typeIdentifier": "t_uint256",
598
+ "typeString": "uint256"
599
+ }
600
+ }
601
+ ],
602
+ "expression": {
603
+ "argumentTypes": [
604
+ {
605
+ "typeIdentifier": "t_uint256",
606
+ "typeString": "uint256"
607
+ }
608
+ ],
609
+ "id": 2510,
610
+ "isConstant": false,
611
+ "isLValue": false,
612
+ "isPure": true,
613
+ "lValueRequested": false,
614
+ "nodeType": "ElementaryTypeNameExpression",
615
+ "src": "1941:7:16",
616
+ "typeDescriptions": {
617
+ "typeIdentifier": "t_type$_t_bytes32_$",
618
+ "typeString": "type(bytes32)"
619
+ },
620
+ "typeName": {
621
+ "id": 2509,
622
+ "name": "bytes32",
623
+ "nodeType": "ElementaryTypeName",
624
+ "src": "1941:7:16",
625
+ "typeDescriptions": {}
626
+ }
627
+ },
628
+ "id": 2521,
629
+ "isConstant": false,
630
+ "isLValue": false,
631
+ "isPure": false,
632
+ "kind": "typeConversion",
633
+ "lValueRequested": false,
634
+ "nameLocations": [],
635
+ "names": [],
636
+ "nodeType": "FunctionCall",
637
+ "src": "1941:45:16",
638
+ "tryCall": false,
639
+ "typeDescriptions": {
640
+ "typeIdentifier": "t_bytes32",
641
+ "typeString": "bytes32"
642
+ }
643
+ }
644
+ ],
645
+ "expression": {
646
+ "argumentTypes": [
647
+ {
648
+ "typeIdentifier": "t_bytes32",
649
+ "typeString": "bytes32"
650
+ }
651
+ ],
652
+ "expression": {
653
+ "id": 2507,
654
+ "name": "ShortString",
655
+ "nodeType": "Identifier",
656
+ "overloadedDeclarations": [],
657
+ "referencedDeclaration": 2471,
658
+ "src": "1924:11:16",
659
+ "typeDescriptions": {
660
+ "typeIdentifier": "t_type$_t_userDefinedValueType$_ShortString_$2471_$",
661
+ "typeString": "type(ShortString)"
662
+ }
663
+ },
664
+ "id": 2508,
665
+ "isConstant": false,
666
+ "isLValue": false,
667
+ "isPure": true,
668
+ "lValueRequested": false,
669
+ "memberLocation": "1936:4:16",
670
+ "memberName": "wrap",
671
+ "nodeType": "MemberAccess",
672
+ "src": "1924:16:16",
673
+ "typeDescriptions": {
674
+ "typeIdentifier": "t_function_wrap_pure$_t_bytes32_$returns$_t_userDefinedValueType$_ShortString_$2471_$",
675
+ "typeString": "function (bytes32) pure returns (ShortString)"
676
+ }
677
+ },
678
+ "id": 2522,
679
+ "isConstant": false,
680
+ "isLValue": false,
681
+ "isPure": false,
682
+ "kind": "functionCall",
683
+ "lValueRequested": false,
684
+ "nameLocations": [],
685
+ "names": [],
686
+ "nodeType": "FunctionCall",
687
+ "src": "1924:63:16",
688
+ "tryCall": false,
689
+ "typeDescriptions": {
690
+ "typeIdentifier": "t_userDefinedValueType$_ShortString_$2471",
691
+ "typeString": "ShortString"
692
+ }
693
+ },
694
+ "functionReturnParameters": 2489,
695
+ "id": 2523,
696
+ "nodeType": "Return",
697
+ "src": "1917:70:16"
698
+ }
699
+ ]
700
+ },
701
+ "documentation": {
702
+ "id": 2482,
703
+ "nodeType": "StructuredDocumentation",
704
+ "src": "1533:170:16",
705
+ "text": " @dev Encode a string of at most 31 chars into a `ShortString`.\n This will trigger a `StringTooLong` error is the input string is too long."
706
+ },
707
+ "id": 2525,
708
+ "implemented": true,
709
+ "kind": "function",
710
+ "modifiers": [],
711
+ "name": "toShortString",
712
+ "nameLocation": "1717:13:16",
713
+ "nodeType": "FunctionDefinition",
714
+ "parameters": {
715
+ "id": 2485,
716
+ "nodeType": "ParameterList",
717
+ "parameters": [
718
+ {
719
+ "constant": false,
720
+ "id": 2484,
721
+ "mutability": "mutable",
722
+ "name": "str",
723
+ "nameLocation": "1745:3:16",
724
+ "nodeType": "VariableDeclaration",
725
+ "scope": 2525,
726
+ "src": "1731:17:16",
727
+ "stateVariable": false,
728
+ "storageLocation": "memory",
729
+ "typeDescriptions": {
730
+ "typeIdentifier": "t_string_memory_ptr",
731
+ "typeString": "string"
732
+ },
733
+ "typeName": {
734
+ "id": 2483,
735
+ "name": "string",
736
+ "nodeType": "ElementaryTypeName",
737
+ "src": "1731:6:16",
738
+ "typeDescriptions": {
739
+ "typeIdentifier": "t_string_storage_ptr",
740
+ "typeString": "string"
741
+ }
742
+ },
743
+ "visibility": "internal"
744
+ }
745
+ ],
746
+ "src": "1730:19:16"
747
+ },
748
+ "returnParameters": {
749
+ "id": 2489,
750
+ "nodeType": "ParameterList",
751
+ "parameters": [
752
+ {
753
+ "constant": false,
754
+ "id": 2488,
755
+ "mutability": "mutable",
756
+ "name": "",
757
+ "nameLocation": "-1:-1:-1",
758
+ "nodeType": "VariableDeclaration",
759
+ "scope": 2525,
760
+ "src": "1773:11:16",
761
+ "stateVariable": false,
762
+ "storageLocation": "default",
763
+ "typeDescriptions": {
764
+ "typeIdentifier": "t_userDefinedValueType$_ShortString_$2471",
765
+ "typeString": "ShortString"
766
+ },
767
+ "typeName": {
768
+ "id": 2487,
769
+ "nodeType": "UserDefinedTypeName",
770
+ "pathNode": {
771
+ "id": 2486,
772
+ "name": "ShortString",
773
+ "nameLocations": [
774
+ "1773:11:16"
775
+ ],
776
+ "nodeType": "IdentifierPath",
777
+ "referencedDeclaration": 2471,
778
+ "src": "1773:11:16"
779
+ },
780
+ "referencedDeclaration": 2471,
781
+ "src": "1773:11:16",
782
+ "typeDescriptions": {
783
+ "typeIdentifier": "t_userDefinedValueType$_ShortString_$2471",
784
+ "typeString": "ShortString"
785
+ }
786
+ },
787
+ "visibility": "internal"
788
+ }
789
+ ],
790
+ "src": "1772:13:16"
791
+ },
792
+ "scope": 2682,
793
+ "src": "1708:286:16",
794
+ "stateMutability": "pure",
795
+ "virtual": false,
796
+ "visibility": "internal"
797
+ },
798
+ {
799
+ "body": {
800
+ "id": 2550,
801
+ "nodeType": "Block",
802
+ "src": "2152:304:16",
803
+ "statements": [
804
+ {
805
+ "assignments": [
806
+ 2535
807
+ ],
808
+ "declarations": [
809
+ {
810
+ "constant": false,
811
+ "id": 2535,
812
+ "mutability": "mutable",
813
+ "name": "len",
814
+ "nameLocation": "2170:3:16",
815
+ "nodeType": "VariableDeclaration",
816
+ "scope": 2550,
817
+ "src": "2162:11:16",
818
+ "stateVariable": false,
819
+ "storageLocation": "default",
820
+ "typeDescriptions": {
821
+ "typeIdentifier": "t_uint256",
822
+ "typeString": "uint256"
823
+ },
824
+ "typeName": {
825
+ "id": 2534,
826
+ "name": "uint256",
827
+ "nodeType": "ElementaryTypeName",
828
+ "src": "2162:7:16",
829
+ "typeDescriptions": {
830
+ "typeIdentifier": "t_uint256",
831
+ "typeString": "uint256"
832
+ }
833
+ },
834
+ "visibility": "internal"
835
+ }
836
+ ],
837
+ "id": 2539,
838
+ "initialValue": {
839
+ "arguments": [
840
+ {
841
+ "id": 2537,
842
+ "name": "sstr",
843
+ "nodeType": "Identifier",
844
+ "overloadedDeclarations": [],
845
+ "referencedDeclaration": 2529,
846
+ "src": "2187:4:16",
847
+ "typeDescriptions": {
848
+ "typeIdentifier": "t_userDefinedValueType$_ShortString_$2471",
849
+ "typeString": "ShortString"
850
+ }
851
+ }
852
+ ],
853
+ "expression": {
854
+ "argumentTypes": [
855
+ {
856
+ "typeIdentifier": "t_userDefinedValueType$_ShortString_$2471",
857
+ "typeString": "ShortString"
858
+ }
859
+ ],
860
+ "id": 2536,
861
+ "name": "byteLength",
862
+ "nodeType": "Identifier",
863
+ "overloadedDeclarations": [],
864
+ "referencedDeclaration": 2583,
865
+ "src": "2176:10:16",
866
+ "typeDescriptions": {
867
+ "typeIdentifier": "t_function_internal_pure$_t_userDefinedValueType$_ShortString_$2471_$returns$_t_uint256_$",
868
+ "typeString": "function (ShortString) pure returns (uint256)"
869
+ }
870
+ },
871
+ "id": 2538,
872
+ "isConstant": false,
873
+ "isLValue": false,
874
+ "isPure": false,
875
+ "kind": "functionCall",
876
+ "lValueRequested": false,
877
+ "nameLocations": [],
878
+ "names": [],
879
+ "nodeType": "FunctionCall",
880
+ "src": "2176:16:16",
881
+ "tryCall": false,
882
+ "typeDescriptions": {
883
+ "typeIdentifier": "t_uint256",
884
+ "typeString": "uint256"
885
+ }
886
+ },
887
+ "nodeType": "VariableDeclarationStatement",
888
+ "src": "2162:30:16"
889
+ },
890
+ {
891
+ "assignments": [
892
+ 2541
893
+ ],
894
+ "declarations": [
895
+ {
896
+ "constant": false,
897
+ "id": 2541,
898
+ "mutability": "mutable",
899
+ "name": "str",
900
+ "nameLocation": "2294:3:16",
901
+ "nodeType": "VariableDeclaration",
902
+ "scope": 2550,
903
+ "src": "2280:17:16",
904
+ "stateVariable": false,
905
+ "storageLocation": "memory",
906
+ "typeDescriptions": {
907
+ "typeIdentifier": "t_string_memory_ptr",
908
+ "typeString": "string"
909
+ },
910
+ "typeName": {
911
+ "id": 2540,
912
+ "name": "string",
913
+ "nodeType": "ElementaryTypeName",
914
+ "src": "2280:6:16",
915
+ "typeDescriptions": {
916
+ "typeIdentifier": "t_string_storage_ptr",
917
+ "typeString": "string"
918
+ }
919
+ },
920
+ "visibility": "internal"
921
+ }
922
+ ],
923
+ "id": 2546,
924
+ "initialValue": {
925
+ "arguments": [
926
+ {
927
+ "hexValue": "3332",
928
+ "id": 2544,
929
+ "isConstant": false,
930
+ "isLValue": false,
931
+ "isPure": true,
932
+ "kind": "number",
933
+ "lValueRequested": false,
934
+ "nodeType": "Literal",
935
+ "src": "2311:2:16",
936
+ "typeDescriptions": {
937
+ "typeIdentifier": "t_rational_32_by_1",
938
+ "typeString": "int_const 32"
939
+ },
940
+ "value": "32"
941
+ }
942
+ ],
943
+ "expression": {
944
+ "argumentTypes": [
945
+ {
946
+ "typeIdentifier": "t_rational_32_by_1",
947
+ "typeString": "int_const 32"
948
+ }
949
+ ],
950
+ "id": 2543,
951
+ "isConstant": false,
952
+ "isLValue": false,
953
+ "isPure": true,
954
+ "lValueRequested": false,
955
+ "nodeType": "NewExpression",
956
+ "src": "2300:10:16",
957
+ "typeDescriptions": {
958
+ "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_string_memory_ptr_$",
959
+ "typeString": "function (uint256) pure returns (string memory)"
960
+ },
961
+ "typeName": {
962
+ "id": 2542,
963
+ "name": "string",
964
+ "nodeType": "ElementaryTypeName",
965
+ "src": "2304:6:16",
966
+ "typeDescriptions": {
967
+ "typeIdentifier": "t_string_storage_ptr",
968
+ "typeString": "string"
969
+ }
970
+ }
971
+ },
972
+ "id": 2545,
973
+ "isConstant": false,
974
+ "isLValue": false,
975
+ "isPure": true,
976
+ "kind": "functionCall",
977
+ "lValueRequested": false,
978
+ "nameLocations": [],
979
+ "names": [],
980
+ "nodeType": "FunctionCall",
981
+ "src": "2300:14:16",
982
+ "tryCall": false,
983
+ "typeDescriptions": {
984
+ "typeIdentifier": "t_string_memory_ptr",
985
+ "typeString": "string memory"
986
+ }
987
+ },
988
+ "nodeType": "VariableDeclarationStatement",
989
+ "src": "2280:34:16"
990
+ },
991
+ {
992
+ "AST": {
993
+ "nativeSrc": "2349:81:16",
994
+ "nodeType": "YulBlock",
995
+ "src": "2349:81:16",
996
+ "statements": [
997
+ {
998
+ "expression": {
999
+ "arguments": [
1000
+ {
1001
+ "name": "str",
1002
+ "nativeSrc": "2370:3:16",
1003
+ "nodeType": "YulIdentifier",
1004
+ "src": "2370:3:16"
1005
+ },
1006
+ {
1007
+ "name": "len",
1008
+ "nativeSrc": "2375:3:16",
1009
+ "nodeType": "YulIdentifier",
1010
+ "src": "2375:3:16"
1011
+ }
1012
+ ],
1013
+ "functionName": {
1014
+ "name": "mstore",
1015
+ "nativeSrc": "2363:6:16",
1016
+ "nodeType": "YulIdentifier",
1017
+ "src": "2363:6:16"
1018
+ },
1019
+ "nativeSrc": "2363:16:16",
1020
+ "nodeType": "YulFunctionCall",
1021
+ "src": "2363:16:16"
1022
+ },
1023
+ "nativeSrc": "2363:16:16",
1024
+ "nodeType": "YulExpressionStatement",
1025
+ "src": "2363:16:16"
1026
+ },
1027
+ {
1028
+ "expression": {
1029
+ "arguments": [
1030
+ {
1031
+ "arguments": [
1032
+ {
1033
+ "name": "str",
1034
+ "nativeSrc": "2403:3:16",
1035
+ "nodeType": "YulIdentifier",
1036
+ "src": "2403:3:16"
1037
+ },
1038
+ {
1039
+ "kind": "number",
1040
+ "nativeSrc": "2408:4:16",
1041
+ "nodeType": "YulLiteral",
1042
+ "src": "2408:4:16",
1043
+ "type": "",
1044
+ "value": "0x20"
1045
+ }
1046
+ ],
1047
+ "functionName": {
1048
+ "name": "add",
1049
+ "nativeSrc": "2399:3:16",
1050
+ "nodeType": "YulIdentifier",
1051
+ "src": "2399:3:16"
1052
+ },
1053
+ "nativeSrc": "2399:14:16",
1054
+ "nodeType": "YulFunctionCall",
1055
+ "src": "2399:14:16"
1056
+ },
1057
+ {
1058
+ "name": "sstr",
1059
+ "nativeSrc": "2415:4:16",
1060
+ "nodeType": "YulIdentifier",
1061
+ "src": "2415:4:16"
1062
+ }
1063
+ ],
1064
+ "functionName": {
1065
+ "name": "mstore",
1066
+ "nativeSrc": "2392:6:16",
1067
+ "nodeType": "YulIdentifier",
1068
+ "src": "2392:6:16"
1069
+ },
1070
+ "nativeSrc": "2392:28:16",
1071
+ "nodeType": "YulFunctionCall",
1072
+ "src": "2392:28:16"
1073
+ },
1074
+ "nativeSrc": "2392:28:16",
1075
+ "nodeType": "YulExpressionStatement",
1076
+ "src": "2392:28:16"
1077
+ }
1078
+ ]
1079
+ },
1080
+ "evmVersion": "shanghai",
1081
+ "externalReferences": [
1082
+ {
1083
+ "declaration": 2535,
1084
+ "isOffset": false,
1085
+ "isSlot": false,
1086
+ "src": "2375:3:16",
1087
+ "valueSize": 1
1088
+ },
1089
+ {
1090
+ "declaration": 2529,
1091
+ "isOffset": false,
1092
+ "isSlot": false,
1093
+ "src": "2415:4:16",
1094
+ "valueSize": 1
1095
+ },
1096
+ {
1097
+ "declaration": 2541,
1098
+ "isOffset": false,
1099
+ "isSlot": false,
1100
+ "src": "2370:3:16",
1101
+ "valueSize": 1
1102
+ },
1103
+ {
1104
+ "declaration": 2541,
1105
+ "isOffset": false,
1106
+ "isSlot": false,
1107
+ "src": "2403:3:16",
1108
+ "valueSize": 1
1109
+ }
1110
+ ],
1111
+ "flags": [
1112
+ "memory-safe"
1113
+ ],
1114
+ "id": 2547,
1115
+ "nodeType": "InlineAssembly",
1116
+ "src": "2324:106:16"
1117
+ },
1118
+ {
1119
+ "expression": {
1120
+ "id": 2548,
1121
+ "name": "str",
1122
+ "nodeType": "Identifier",
1123
+ "overloadedDeclarations": [],
1124
+ "referencedDeclaration": 2541,
1125
+ "src": "2446:3:16",
1126
+ "typeDescriptions": {
1127
+ "typeIdentifier": "t_string_memory_ptr",
1128
+ "typeString": "string memory"
1129
+ }
1130
+ },
1131
+ "functionReturnParameters": 2533,
1132
+ "id": 2549,
1133
+ "nodeType": "Return",
1134
+ "src": "2439:10:16"
1135
+ }
1136
+ ]
1137
+ },
1138
+ "documentation": {
1139
+ "id": 2526,
1140
+ "nodeType": "StructuredDocumentation",
1141
+ "src": "2000:73:16",
1142
+ "text": " @dev Decode a `ShortString` back to a \"normal\" string."
1143
+ },
1144
+ "id": 2551,
1145
+ "implemented": true,
1146
+ "kind": "function",
1147
+ "modifiers": [],
1148
+ "name": "toString",
1149
+ "nameLocation": "2087:8:16",
1150
+ "nodeType": "FunctionDefinition",
1151
+ "parameters": {
1152
+ "id": 2530,
1153
+ "nodeType": "ParameterList",
1154
+ "parameters": [
1155
+ {
1156
+ "constant": false,
1157
+ "id": 2529,
1158
+ "mutability": "mutable",
1159
+ "name": "sstr",
1160
+ "nameLocation": "2108:4:16",
1161
+ "nodeType": "VariableDeclaration",
1162
+ "scope": 2551,
1163
+ "src": "2096:16:16",
1164
+ "stateVariable": false,
1165
+ "storageLocation": "default",
1166
+ "typeDescriptions": {
1167
+ "typeIdentifier": "t_userDefinedValueType$_ShortString_$2471",
1168
+ "typeString": "ShortString"
1169
+ },
1170
+ "typeName": {
1171
+ "id": 2528,
1172
+ "nodeType": "UserDefinedTypeName",
1173
+ "pathNode": {
1174
+ "id": 2527,
1175
+ "name": "ShortString",
1176
+ "nameLocations": [
1177
+ "2096:11:16"
1178
+ ],
1179
+ "nodeType": "IdentifierPath",
1180
+ "referencedDeclaration": 2471,
1181
+ "src": "2096:11:16"
1182
+ },
1183
+ "referencedDeclaration": 2471,
1184
+ "src": "2096:11:16",
1185
+ "typeDescriptions": {
1186
+ "typeIdentifier": "t_userDefinedValueType$_ShortString_$2471",
1187
+ "typeString": "ShortString"
1188
+ }
1189
+ },
1190
+ "visibility": "internal"
1191
+ }
1192
+ ],
1193
+ "src": "2095:18:16"
1194
+ },
1195
+ "returnParameters": {
1196
+ "id": 2533,
1197
+ "nodeType": "ParameterList",
1198
+ "parameters": [
1199
+ {
1200
+ "constant": false,
1201
+ "id": 2532,
1202
+ "mutability": "mutable",
1203
+ "name": "",
1204
+ "nameLocation": "-1:-1:-1",
1205
+ "nodeType": "VariableDeclaration",
1206
+ "scope": 2551,
1207
+ "src": "2137:13:16",
1208
+ "stateVariable": false,
1209
+ "storageLocation": "memory",
1210
+ "typeDescriptions": {
1211
+ "typeIdentifier": "t_string_memory_ptr",
1212
+ "typeString": "string"
1213
+ },
1214
+ "typeName": {
1215
+ "id": 2531,
1216
+ "name": "string",
1217
+ "nodeType": "ElementaryTypeName",
1218
+ "src": "2137:6:16",
1219
+ "typeDescriptions": {
1220
+ "typeIdentifier": "t_string_storage_ptr",
1221
+ "typeString": "string"
1222
+ }
1223
+ },
1224
+ "visibility": "internal"
1225
+ }
1226
+ ],
1227
+ "src": "2136:15:16"
1228
+ },
1229
+ "scope": 2682,
1230
+ "src": "2078:378:16",
1231
+ "stateMutability": "pure",
1232
+ "virtual": false,
1233
+ "visibility": "internal"
1234
+ },
1235
+ {
1236
+ "body": {
1237
+ "id": 2582,
1238
+ "nodeType": "Block",
1239
+ "src": "2598:175:16",
1240
+ "statements": [
1241
+ {
1242
+ "assignments": [
1243
+ 2561
1244
+ ],
1245
+ "declarations": [
1246
+ {
1247
+ "constant": false,
1248
+ "id": 2561,
1249
+ "mutability": "mutable",
1250
+ "name": "result",
1251
+ "nameLocation": "2616:6:16",
1252
+ "nodeType": "VariableDeclaration",
1253
+ "scope": 2582,
1254
+ "src": "2608:14:16",
1255
+ "stateVariable": false,
1256
+ "storageLocation": "default",
1257
+ "typeDescriptions": {
1258
+ "typeIdentifier": "t_uint256",
1259
+ "typeString": "uint256"
1260
+ },
1261
+ "typeName": {
1262
+ "id": 2560,
1263
+ "name": "uint256",
1264
+ "nodeType": "ElementaryTypeName",
1265
+ "src": "2608:7:16",
1266
+ "typeDescriptions": {
1267
+ "typeIdentifier": "t_uint256",
1268
+ "typeString": "uint256"
1269
+ }
1270
+ },
1271
+ "visibility": "internal"
1272
+ }
1273
+ ],
1274
+ "id": 2571,
1275
+ "initialValue": {
1276
+ "commonType": {
1277
+ "typeIdentifier": "t_uint256",
1278
+ "typeString": "uint256"
1279
+ },
1280
+ "id": 2570,
1281
+ "isConstant": false,
1282
+ "isLValue": false,
1283
+ "isPure": false,
1284
+ "lValueRequested": false,
1285
+ "leftExpression": {
1286
+ "arguments": [
1287
+ {
1288
+ "arguments": [
1289
+ {
1290
+ "id": 2566,
1291
+ "name": "sstr",
1292
+ "nodeType": "Identifier",
1293
+ "overloadedDeclarations": [],
1294
+ "referencedDeclaration": 2555,
1295
+ "src": "2652:4:16",
1296
+ "typeDescriptions": {
1297
+ "typeIdentifier": "t_userDefinedValueType$_ShortString_$2471",
1298
+ "typeString": "ShortString"
1299
+ }
1300
+ }
1301
+ ],
1302
+ "expression": {
1303
+ "argumentTypes": [
1304
+ {
1305
+ "typeIdentifier": "t_userDefinedValueType$_ShortString_$2471",
1306
+ "typeString": "ShortString"
1307
+ }
1308
+ ],
1309
+ "expression": {
1310
+ "id": 2564,
1311
+ "name": "ShortString",
1312
+ "nodeType": "Identifier",
1313
+ "overloadedDeclarations": [],
1314
+ "referencedDeclaration": 2471,
1315
+ "src": "2633:11:16",
1316
+ "typeDescriptions": {
1317
+ "typeIdentifier": "t_type$_t_userDefinedValueType$_ShortString_$2471_$",
1318
+ "typeString": "type(ShortString)"
1319
+ }
1320
+ },
1321
+ "id": 2565,
1322
+ "isConstant": false,
1323
+ "isLValue": false,
1324
+ "isPure": true,
1325
+ "lValueRequested": false,
1326
+ "memberLocation": "2645:6:16",
1327
+ "memberName": "unwrap",
1328
+ "nodeType": "MemberAccess",
1329
+ "src": "2633:18:16",
1330
+ "typeDescriptions": {
1331
+ "typeIdentifier": "t_function_unwrap_pure$_t_userDefinedValueType$_ShortString_$2471_$returns$_t_bytes32_$",
1332
+ "typeString": "function (ShortString) pure returns (bytes32)"
1333
+ }
1334
+ },
1335
+ "id": 2567,
1336
+ "isConstant": false,
1337
+ "isLValue": false,
1338
+ "isPure": false,
1339
+ "kind": "functionCall",
1340
+ "lValueRequested": false,
1341
+ "nameLocations": [],
1342
+ "names": [],
1343
+ "nodeType": "FunctionCall",
1344
+ "src": "2633:24:16",
1345
+ "tryCall": false,
1346
+ "typeDescriptions": {
1347
+ "typeIdentifier": "t_bytes32",
1348
+ "typeString": "bytes32"
1349
+ }
1350
+ }
1351
+ ],
1352
+ "expression": {
1353
+ "argumentTypes": [
1354
+ {
1355
+ "typeIdentifier": "t_bytes32",
1356
+ "typeString": "bytes32"
1357
+ }
1358
+ ],
1359
+ "id": 2563,
1360
+ "isConstant": false,
1361
+ "isLValue": false,
1362
+ "isPure": true,
1363
+ "lValueRequested": false,
1364
+ "nodeType": "ElementaryTypeNameExpression",
1365
+ "src": "2625:7:16",
1366
+ "typeDescriptions": {
1367
+ "typeIdentifier": "t_type$_t_uint256_$",
1368
+ "typeString": "type(uint256)"
1369
+ },
1370
+ "typeName": {
1371
+ "id": 2562,
1372
+ "name": "uint256",
1373
+ "nodeType": "ElementaryTypeName",
1374
+ "src": "2625:7:16",
1375
+ "typeDescriptions": {}
1376
+ }
1377
+ },
1378
+ "id": 2568,
1379
+ "isConstant": false,
1380
+ "isLValue": false,
1381
+ "isPure": false,
1382
+ "kind": "typeConversion",
1383
+ "lValueRequested": false,
1384
+ "nameLocations": [],
1385
+ "names": [],
1386
+ "nodeType": "FunctionCall",
1387
+ "src": "2625:33:16",
1388
+ "tryCall": false,
1389
+ "typeDescriptions": {
1390
+ "typeIdentifier": "t_uint256",
1391
+ "typeString": "uint256"
1392
+ }
1393
+ },
1394
+ "nodeType": "BinaryOperation",
1395
+ "operator": "&",
1396
+ "rightExpression": {
1397
+ "hexValue": "30784646",
1398
+ "id": 2569,
1399
+ "isConstant": false,
1400
+ "isLValue": false,
1401
+ "isPure": true,
1402
+ "kind": "number",
1403
+ "lValueRequested": false,
1404
+ "nodeType": "Literal",
1405
+ "src": "2661:4:16",
1406
+ "typeDescriptions": {
1407
+ "typeIdentifier": "t_rational_255_by_1",
1408
+ "typeString": "int_const 255"
1409
+ },
1410
+ "value": "0xFF"
1411
+ },
1412
+ "src": "2625:40:16",
1413
+ "typeDescriptions": {
1414
+ "typeIdentifier": "t_uint256",
1415
+ "typeString": "uint256"
1416
+ }
1417
+ },
1418
+ "nodeType": "VariableDeclarationStatement",
1419
+ "src": "2608:57:16"
1420
+ },
1421
+ {
1422
+ "condition": {
1423
+ "commonType": {
1424
+ "typeIdentifier": "t_uint256",
1425
+ "typeString": "uint256"
1426
+ },
1427
+ "id": 2574,
1428
+ "isConstant": false,
1429
+ "isLValue": false,
1430
+ "isPure": false,
1431
+ "lValueRequested": false,
1432
+ "leftExpression": {
1433
+ "id": 2572,
1434
+ "name": "result",
1435
+ "nodeType": "Identifier",
1436
+ "overloadedDeclarations": [],
1437
+ "referencedDeclaration": 2561,
1438
+ "src": "2679:6:16",
1439
+ "typeDescriptions": {
1440
+ "typeIdentifier": "t_uint256",
1441
+ "typeString": "uint256"
1442
+ }
1443
+ },
1444
+ "nodeType": "BinaryOperation",
1445
+ "operator": ">",
1446
+ "rightExpression": {
1447
+ "hexValue": "3331",
1448
+ "id": 2573,
1449
+ "isConstant": false,
1450
+ "isLValue": false,
1451
+ "isPure": true,
1452
+ "kind": "number",
1453
+ "lValueRequested": false,
1454
+ "nodeType": "Literal",
1455
+ "src": "2688:2:16",
1456
+ "typeDescriptions": {
1457
+ "typeIdentifier": "t_rational_31_by_1",
1458
+ "typeString": "int_const 31"
1459
+ },
1460
+ "value": "31"
1461
+ },
1462
+ "src": "2679:11:16",
1463
+ "typeDescriptions": {
1464
+ "typeIdentifier": "t_bool",
1465
+ "typeString": "bool"
1466
+ }
1467
+ },
1468
+ "id": 2579,
1469
+ "nodeType": "IfStatement",
1470
+ "src": "2675:69:16",
1471
+ "trueBody": {
1472
+ "id": 2578,
1473
+ "nodeType": "Block",
1474
+ "src": "2692:52:16",
1475
+ "statements": [
1476
+ {
1477
+ "errorCall": {
1478
+ "arguments": [],
1479
+ "expression": {
1480
+ "argumentTypes": [],
1481
+ "id": 2575,
1482
+ "name": "InvalidShortString",
1483
+ "nodeType": "Identifier",
1484
+ "overloadedDeclarations": [],
1485
+ "referencedDeclaration": 2481,
1486
+ "src": "2713:18:16",
1487
+ "typeDescriptions": {
1488
+ "typeIdentifier": "t_function_error_pure$__$returns$__$",
1489
+ "typeString": "function () pure"
1490
+ }
1491
+ },
1492
+ "id": 2576,
1493
+ "isConstant": false,
1494
+ "isLValue": false,
1495
+ "isPure": false,
1496
+ "kind": "functionCall",
1497
+ "lValueRequested": false,
1498
+ "nameLocations": [],
1499
+ "names": [],
1500
+ "nodeType": "FunctionCall",
1501
+ "src": "2713:20:16",
1502
+ "tryCall": false,
1503
+ "typeDescriptions": {
1504
+ "typeIdentifier": "t_tuple$__$",
1505
+ "typeString": "tuple()"
1506
+ }
1507
+ },
1508
+ "id": 2577,
1509
+ "nodeType": "RevertStatement",
1510
+ "src": "2706:27:16"
1511
+ }
1512
+ ]
1513
+ }
1514
+ },
1515
+ {
1516
+ "expression": {
1517
+ "id": 2580,
1518
+ "name": "result",
1519
+ "nodeType": "Identifier",
1520
+ "overloadedDeclarations": [],
1521
+ "referencedDeclaration": 2561,
1522
+ "src": "2760:6:16",
1523
+ "typeDescriptions": {
1524
+ "typeIdentifier": "t_uint256",
1525
+ "typeString": "uint256"
1526
+ }
1527
+ },
1528
+ "functionReturnParameters": 2559,
1529
+ "id": 2581,
1530
+ "nodeType": "Return",
1531
+ "src": "2753:13:16"
1532
+ }
1533
+ ]
1534
+ },
1535
+ "documentation": {
1536
+ "id": 2552,
1537
+ "nodeType": "StructuredDocumentation",
1538
+ "src": "2462:61:16",
1539
+ "text": " @dev Return the length of a `ShortString`."
1540
+ },
1541
+ "id": 2583,
1542
+ "implemented": true,
1543
+ "kind": "function",
1544
+ "modifiers": [],
1545
+ "name": "byteLength",
1546
+ "nameLocation": "2537:10:16",
1547
+ "nodeType": "FunctionDefinition",
1548
+ "parameters": {
1549
+ "id": 2556,
1550
+ "nodeType": "ParameterList",
1551
+ "parameters": [
1552
+ {
1553
+ "constant": false,
1554
+ "id": 2555,
1555
+ "mutability": "mutable",
1556
+ "name": "sstr",
1557
+ "nameLocation": "2560:4:16",
1558
+ "nodeType": "VariableDeclaration",
1559
+ "scope": 2583,
1560
+ "src": "2548:16:16",
1561
+ "stateVariable": false,
1562
+ "storageLocation": "default",
1563
+ "typeDescriptions": {
1564
+ "typeIdentifier": "t_userDefinedValueType$_ShortString_$2471",
1565
+ "typeString": "ShortString"
1566
+ },
1567
+ "typeName": {
1568
+ "id": 2554,
1569
+ "nodeType": "UserDefinedTypeName",
1570
+ "pathNode": {
1571
+ "id": 2553,
1572
+ "name": "ShortString",
1573
+ "nameLocations": [
1574
+ "2548:11:16"
1575
+ ],
1576
+ "nodeType": "IdentifierPath",
1577
+ "referencedDeclaration": 2471,
1578
+ "src": "2548:11:16"
1579
+ },
1580
+ "referencedDeclaration": 2471,
1581
+ "src": "2548:11:16",
1582
+ "typeDescriptions": {
1583
+ "typeIdentifier": "t_userDefinedValueType$_ShortString_$2471",
1584
+ "typeString": "ShortString"
1585
+ }
1586
+ },
1587
+ "visibility": "internal"
1588
+ }
1589
+ ],
1590
+ "src": "2547:18:16"
1591
+ },
1592
+ "returnParameters": {
1593
+ "id": 2559,
1594
+ "nodeType": "ParameterList",
1595
+ "parameters": [
1596
+ {
1597
+ "constant": false,
1598
+ "id": 2558,
1599
+ "mutability": "mutable",
1600
+ "name": "",
1601
+ "nameLocation": "-1:-1:-1",
1602
+ "nodeType": "VariableDeclaration",
1603
+ "scope": 2583,
1604
+ "src": "2589:7:16",
1605
+ "stateVariable": false,
1606
+ "storageLocation": "default",
1607
+ "typeDescriptions": {
1608
+ "typeIdentifier": "t_uint256",
1609
+ "typeString": "uint256"
1610
+ },
1611
+ "typeName": {
1612
+ "id": 2557,
1613
+ "name": "uint256",
1614
+ "nodeType": "ElementaryTypeName",
1615
+ "src": "2589:7:16",
1616
+ "typeDescriptions": {
1617
+ "typeIdentifier": "t_uint256",
1618
+ "typeString": "uint256"
1619
+ }
1620
+ },
1621
+ "visibility": "internal"
1622
+ }
1623
+ ],
1624
+ "src": "2588:9:16"
1625
+ },
1626
+ "scope": 2682,
1627
+ "src": "2528:245:16",
1628
+ "stateMutability": "pure",
1629
+ "virtual": false,
1630
+ "visibility": "internal"
1631
+ },
1632
+ {
1633
+ "body": {
1634
+ "id": 2622,
1635
+ "nodeType": "Block",
1636
+ "src": "2996:231:16",
1637
+ "statements": [
1638
+ {
1639
+ "condition": {
1640
+ "commonType": {
1641
+ "typeIdentifier": "t_uint256",
1642
+ "typeString": "uint256"
1643
+ },
1644
+ "id": 2600,
1645
+ "isConstant": false,
1646
+ "isLValue": false,
1647
+ "isPure": false,
1648
+ "lValueRequested": false,
1649
+ "leftExpression": {
1650
+ "expression": {
1651
+ "arguments": [
1652
+ {
1653
+ "id": 2596,
1654
+ "name": "value",
1655
+ "nodeType": "Identifier",
1656
+ "overloadedDeclarations": [],
1657
+ "referencedDeclaration": 2586,
1658
+ "src": "3016:5:16",
1659
+ "typeDescriptions": {
1660
+ "typeIdentifier": "t_string_memory_ptr",
1661
+ "typeString": "string memory"
1662
+ }
1663
+ }
1664
+ ],
1665
+ "expression": {
1666
+ "argumentTypes": [
1667
+ {
1668
+ "typeIdentifier": "t_string_memory_ptr",
1669
+ "typeString": "string memory"
1670
+ }
1671
+ ],
1672
+ "id": 2595,
1673
+ "isConstant": false,
1674
+ "isLValue": false,
1675
+ "isPure": true,
1676
+ "lValueRequested": false,
1677
+ "nodeType": "ElementaryTypeNameExpression",
1678
+ "src": "3010:5:16",
1679
+ "typeDescriptions": {
1680
+ "typeIdentifier": "t_type$_t_bytes_storage_ptr_$",
1681
+ "typeString": "type(bytes storage pointer)"
1682
+ },
1683
+ "typeName": {
1684
+ "id": 2594,
1685
+ "name": "bytes",
1686
+ "nodeType": "ElementaryTypeName",
1687
+ "src": "3010:5:16",
1688
+ "typeDescriptions": {}
1689
+ }
1690
+ },
1691
+ "id": 2597,
1692
+ "isConstant": false,
1693
+ "isLValue": false,
1694
+ "isPure": false,
1695
+ "kind": "typeConversion",
1696
+ "lValueRequested": false,
1697
+ "nameLocations": [],
1698
+ "names": [],
1699
+ "nodeType": "FunctionCall",
1700
+ "src": "3010:12:16",
1701
+ "tryCall": false,
1702
+ "typeDescriptions": {
1703
+ "typeIdentifier": "t_bytes_memory_ptr",
1704
+ "typeString": "bytes memory"
1705
+ }
1706
+ },
1707
+ "id": 2598,
1708
+ "isConstant": false,
1709
+ "isLValue": false,
1710
+ "isPure": false,
1711
+ "lValueRequested": false,
1712
+ "memberLocation": "3023:6:16",
1713
+ "memberName": "length",
1714
+ "nodeType": "MemberAccess",
1715
+ "src": "3010:19:16",
1716
+ "typeDescriptions": {
1717
+ "typeIdentifier": "t_uint256",
1718
+ "typeString": "uint256"
1719
+ }
1720
+ },
1721
+ "nodeType": "BinaryOperation",
1722
+ "operator": "<",
1723
+ "rightExpression": {
1724
+ "hexValue": "3332",
1725
+ "id": 2599,
1726
+ "isConstant": false,
1727
+ "isLValue": false,
1728
+ "isPure": true,
1729
+ "kind": "number",
1730
+ "lValueRequested": false,
1731
+ "nodeType": "Literal",
1732
+ "src": "3032:2:16",
1733
+ "typeDescriptions": {
1734
+ "typeIdentifier": "t_rational_32_by_1",
1735
+ "typeString": "int_const 32"
1736
+ },
1737
+ "value": "32"
1738
+ },
1739
+ "src": "3010:24:16",
1740
+ "typeDescriptions": {
1741
+ "typeIdentifier": "t_bool",
1742
+ "typeString": "bool"
1743
+ }
1744
+ },
1745
+ "falseBody": {
1746
+ "id": 2620,
1747
+ "nodeType": "Block",
1748
+ "src": "3094:127:16",
1749
+ "statements": [
1750
+ {
1751
+ "expression": {
1752
+ "id": 2613,
1753
+ "isConstant": false,
1754
+ "isLValue": false,
1755
+ "isPure": false,
1756
+ "lValueRequested": false,
1757
+ "leftHandSide": {
1758
+ "expression": {
1759
+ "arguments": [
1760
+ {
1761
+ "id": 2609,
1762
+ "name": "store",
1763
+ "nodeType": "Identifier",
1764
+ "overloadedDeclarations": [],
1765
+ "referencedDeclaration": 2588,
1766
+ "src": "3134:5:16",
1767
+ "typeDescriptions": {
1768
+ "typeIdentifier": "t_string_storage_ptr",
1769
+ "typeString": "string storage pointer"
1770
+ }
1771
+ }
1772
+ ],
1773
+ "expression": {
1774
+ "argumentTypes": [
1775
+ {
1776
+ "typeIdentifier": "t_string_storage_ptr",
1777
+ "typeString": "string storage pointer"
1778
+ }
1779
+ ],
1780
+ "expression": {
1781
+ "id": 2606,
1782
+ "name": "StorageSlot",
1783
+ "nodeType": "Identifier",
1784
+ "overloadedDeclarations": [],
1785
+ "referencedDeclaration": 2806,
1786
+ "src": "3108:11:16",
1787
+ "typeDescriptions": {
1788
+ "typeIdentifier": "t_type$_t_contract$_StorageSlot_$2806_$",
1789
+ "typeString": "type(library StorageSlot)"
1790
+ }
1791
+ },
1792
+ "id": 2608,
1793
+ "isConstant": false,
1794
+ "isLValue": false,
1795
+ "isPure": false,
1796
+ "lValueRequested": false,
1797
+ "memberLocation": "3120:13:16",
1798
+ "memberName": "getStringSlot",
1799
+ "nodeType": "MemberAccess",
1800
+ "referencedDeclaration": 2783,
1801
+ "src": "3108:25:16",
1802
+ "typeDescriptions": {
1803
+ "typeIdentifier": "t_function_internal_pure$_t_string_storage_ptr_$returns$_t_struct$_StringSlot_$2703_storage_ptr_$",
1804
+ "typeString": "function (string storage pointer) pure returns (struct StorageSlot.StringSlot storage pointer)"
1805
+ }
1806
+ },
1807
+ "id": 2610,
1808
+ "isConstant": false,
1809
+ "isLValue": false,
1810
+ "isPure": false,
1811
+ "kind": "functionCall",
1812
+ "lValueRequested": false,
1813
+ "nameLocations": [],
1814
+ "names": [],
1815
+ "nodeType": "FunctionCall",
1816
+ "src": "3108:32:16",
1817
+ "tryCall": false,
1818
+ "typeDescriptions": {
1819
+ "typeIdentifier": "t_struct$_StringSlot_$2703_storage_ptr",
1820
+ "typeString": "struct StorageSlot.StringSlot storage pointer"
1821
+ }
1822
+ },
1823
+ "id": 2611,
1824
+ "isConstant": false,
1825
+ "isLValue": true,
1826
+ "isPure": false,
1827
+ "lValueRequested": true,
1828
+ "memberLocation": "3141:5:16",
1829
+ "memberName": "value",
1830
+ "nodeType": "MemberAccess",
1831
+ "referencedDeclaration": 2702,
1832
+ "src": "3108:38:16",
1833
+ "typeDescriptions": {
1834
+ "typeIdentifier": "t_string_storage",
1835
+ "typeString": "string storage ref"
1836
+ }
1837
+ },
1838
+ "nodeType": "Assignment",
1839
+ "operator": "=",
1840
+ "rightHandSide": {
1841
+ "id": 2612,
1842
+ "name": "value",
1843
+ "nodeType": "Identifier",
1844
+ "overloadedDeclarations": [],
1845
+ "referencedDeclaration": 2586,
1846
+ "src": "3149:5:16",
1847
+ "typeDescriptions": {
1848
+ "typeIdentifier": "t_string_memory_ptr",
1849
+ "typeString": "string memory"
1850
+ }
1851
+ },
1852
+ "src": "3108:46:16",
1853
+ "typeDescriptions": {
1854
+ "typeIdentifier": "t_string_storage",
1855
+ "typeString": "string storage ref"
1856
+ }
1857
+ },
1858
+ "id": 2614,
1859
+ "nodeType": "ExpressionStatement",
1860
+ "src": "3108:46:16"
1861
+ },
1862
+ {
1863
+ "expression": {
1864
+ "arguments": [
1865
+ {
1866
+ "id": 2617,
1867
+ "name": "FALLBACK_SENTINEL",
1868
+ "nodeType": "Identifier",
1869
+ "overloadedDeclarations": [],
1870
+ "referencedDeclaration": 2475,
1871
+ "src": "3192:17:16",
1872
+ "typeDescriptions": {
1873
+ "typeIdentifier": "t_bytes32",
1874
+ "typeString": "bytes32"
1875
+ }
1876
+ }
1877
+ ],
1878
+ "expression": {
1879
+ "argumentTypes": [
1880
+ {
1881
+ "typeIdentifier": "t_bytes32",
1882
+ "typeString": "bytes32"
1883
+ }
1884
+ ],
1885
+ "expression": {
1886
+ "id": 2615,
1887
+ "name": "ShortString",
1888
+ "nodeType": "Identifier",
1889
+ "overloadedDeclarations": [],
1890
+ "referencedDeclaration": 2471,
1891
+ "src": "3175:11:16",
1892
+ "typeDescriptions": {
1893
+ "typeIdentifier": "t_type$_t_userDefinedValueType$_ShortString_$2471_$",
1894
+ "typeString": "type(ShortString)"
1895
+ }
1896
+ },
1897
+ "id": 2616,
1898
+ "isConstant": false,
1899
+ "isLValue": false,
1900
+ "isPure": true,
1901
+ "lValueRequested": false,
1902
+ "memberLocation": "3187:4:16",
1903
+ "memberName": "wrap",
1904
+ "nodeType": "MemberAccess",
1905
+ "src": "3175:16:16",
1906
+ "typeDescriptions": {
1907
+ "typeIdentifier": "t_function_wrap_pure$_t_bytes32_$returns$_t_userDefinedValueType$_ShortString_$2471_$",
1908
+ "typeString": "function (bytes32) pure returns (ShortString)"
1909
+ }
1910
+ },
1911
+ "id": 2618,
1912
+ "isConstant": false,
1913
+ "isLValue": false,
1914
+ "isPure": true,
1915
+ "kind": "functionCall",
1916
+ "lValueRequested": false,
1917
+ "nameLocations": [],
1918
+ "names": [],
1919
+ "nodeType": "FunctionCall",
1920
+ "src": "3175:35:16",
1921
+ "tryCall": false,
1922
+ "typeDescriptions": {
1923
+ "typeIdentifier": "t_userDefinedValueType$_ShortString_$2471",
1924
+ "typeString": "ShortString"
1925
+ }
1926
+ },
1927
+ "functionReturnParameters": 2593,
1928
+ "id": 2619,
1929
+ "nodeType": "Return",
1930
+ "src": "3168:42:16"
1931
+ }
1932
+ ]
1933
+ },
1934
+ "id": 2621,
1935
+ "nodeType": "IfStatement",
1936
+ "src": "3006:215:16",
1937
+ "trueBody": {
1938
+ "id": 2605,
1939
+ "nodeType": "Block",
1940
+ "src": "3036:52:16",
1941
+ "statements": [
1942
+ {
1943
+ "expression": {
1944
+ "arguments": [
1945
+ {
1946
+ "id": 2602,
1947
+ "name": "value",
1948
+ "nodeType": "Identifier",
1949
+ "overloadedDeclarations": [],
1950
+ "referencedDeclaration": 2586,
1951
+ "src": "3071:5:16",
1952
+ "typeDescriptions": {
1953
+ "typeIdentifier": "t_string_memory_ptr",
1954
+ "typeString": "string memory"
1955
+ }
1956
+ }
1957
+ ],
1958
+ "expression": {
1959
+ "argumentTypes": [
1960
+ {
1961
+ "typeIdentifier": "t_string_memory_ptr",
1962
+ "typeString": "string memory"
1963
+ }
1964
+ ],
1965
+ "id": 2601,
1966
+ "name": "toShortString",
1967
+ "nodeType": "Identifier",
1968
+ "overloadedDeclarations": [],
1969
+ "referencedDeclaration": 2525,
1970
+ "src": "3057:13:16",
1971
+ "typeDescriptions": {
1972
+ "typeIdentifier": "t_function_internal_pure$_t_string_memory_ptr_$returns$_t_userDefinedValueType$_ShortString_$2471_$",
1973
+ "typeString": "function (string memory) pure returns (ShortString)"
1974
+ }
1975
+ },
1976
+ "id": 2603,
1977
+ "isConstant": false,
1978
+ "isLValue": false,
1979
+ "isPure": false,
1980
+ "kind": "functionCall",
1981
+ "lValueRequested": false,
1982
+ "nameLocations": [],
1983
+ "names": [],
1984
+ "nodeType": "FunctionCall",
1985
+ "src": "3057:20:16",
1986
+ "tryCall": false,
1987
+ "typeDescriptions": {
1988
+ "typeIdentifier": "t_userDefinedValueType$_ShortString_$2471",
1989
+ "typeString": "ShortString"
1990
+ }
1991
+ },
1992
+ "functionReturnParameters": 2593,
1993
+ "id": 2604,
1994
+ "nodeType": "Return",
1995
+ "src": "3050:27:16"
1996
+ }
1997
+ ]
1998
+ }
1999
+ }
2000
+ ]
2001
+ },
2002
+ "documentation": {
2003
+ "id": 2584,
2004
+ "nodeType": "StructuredDocumentation",
2005
+ "src": "2779:103:16",
2006
+ "text": " @dev Encode a string into a `ShortString`, or write it to storage if it is too long."
2007
+ },
2008
+ "id": 2623,
2009
+ "implemented": true,
2010
+ "kind": "function",
2011
+ "modifiers": [],
2012
+ "name": "toShortStringWithFallback",
2013
+ "nameLocation": "2896:25:16",
2014
+ "nodeType": "FunctionDefinition",
2015
+ "parameters": {
2016
+ "id": 2589,
2017
+ "nodeType": "ParameterList",
2018
+ "parameters": [
2019
+ {
2020
+ "constant": false,
2021
+ "id": 2586,
2022
+ "mutability": "mutable",
2023
+ "name": "value",
2024
+ "nameLocation": "2936:5:16",
2025
+ "nodeType": "VariableDeclaration",
2026
+ "scope": 2623,
2027
+ "src": "2922:19:16",
2028
+ "stateVariable": false,
2029
+ "storageLocation": "memory",
2030
+ "typeDescriptions": {
2031
+ "typeIdentifier": "t_string_memory_ptr",
2032
+ "typeString": "string"
2033
+ },
2034
+ "typeName": {
2035
+ "id": 2585,
2036
+ "name": "string",
2037
+ "nodeType": "ElementaryTypeName",
2038
+ "src": "2922:6:16",
2039
+ "typeDescriptions": {
2040
+ "typeIdentifier": "t_string_storage_ptr",
2041
+ "typeString": "string"
2042
+ }
2043
+ },
2044
+ "visibility": "internal"
2045
+ },
2046
+ {
2047
+ "constant": false,
2048
+ "id": 2588,
2049
+ "mutability": "mutable",
2050
+ "name": "store",
2051
+ "nameLocation": "2958:5:16",
2052
+ "nodeType": "VariableDeclaration",
2053
+ "scope": 2623,
2054
+ "src": "2943:20:16",
2055
+ "stateVariable": false,
2056
+ "storageLocation": "storage",
2057
+ "typeDescriptions": {
2058
+ "typeIdentifier": "t_string_storage_ptr",
2059
+ "typeString": "string"
2060
+ },
2061
+ "typeName": {
2062
+ "id": 2587,
2063
+ "name": "string",
2064
+ "nodeType": "ElementaryTypeName",
2065
+ "src": "2943:6:16",
2066
+ "typeDescriptions": {
2067
+ "typeIdentifier": "t_string_storage_ptr",
2068
+ "typeString": "string"
2069
+ }
2070
+ },
2071
+ "visibility": "internal"
2072
+ }
2073
+ ],
2074
+ "src": "2921:43:16"
2075
+ },
2076
+ "returnParameters": {
2077
+ "id": 2593,
2078
+ "nodeType": "ParameterList",
2079
+ "parameters": [
2080
+ {
2081
+ "constant": false,
2082
+ "id": 2592,
2083
+ "mutability": "mutable",
2084
+ "name": "",
2085
+ "nameLocation": "-1:-1:-1",
2086
+ "nodeType": "VariableDeclaration",
2087
+ "scope": 2623,
2088
+ "src": "2983:11:16",
2089
+ "stateVariable": false,
2090
+ "storageLocation": "default",
2091
+ "typeDescriptions": {
2092
+ "typeIdentifier": "t_userDefinedValueType$_ShortString_$2471",
2093
+ "typeString": "ShortString"
2094
+ },
2095
+ "typeName": {
2096
+ "id": 2591,
2097
+ "nodeType": "UserDefinedTypeName",
2098
+ "pathNode": {
2099
+ "id": 2590,
2100
+ "name": "ShortString",
2101
+ "nameLocations": [
2102
+ "2983:11:16"
2103
+ ],
2104
+ "nodeType": "IdentifierPath",
2105
+ "referencedDeclaration": 2471,
2106
+ "src": "2983:11:16"
2107
+ },
2108
+ "referencedDeclaration": 2471,
2109
+ "src": "2983:11:16",
2110
+ "typeDescriptions": {
2111
+ "typeIdentifier": "t_userDefinedValueType$_ShortString_$2471",
2112
+ "typeString": "ShortString"
2113
+ }
2114
+ },
2115
+ "visibility": "internal"
2116
+ }
2117
+ ],
2118
+ "src": "2982:13:16"
2119
+ },
2120
+ "scope": 2682,
2121
+ "src": "2887:340:16",
2122
+ "stateMutability": "nonpayable",
2123
+ "virtual": false,
2124
+ "visibility": "internal"
2125
+ },
2126
+ {
2127
+ "body": {
2128
+ "id": 2649,
2129
+ "nodeType": "Block",
2130
+ "src": "3477:158:16",
2131
+ "statements": [
2132
+ {
2133
+ "condition": {
2134
+ "commonType": {
2135
+ "typeIdentifier": "t_bytes32",
2136
+ "typeString": "bytes32"
2137
+ },
2138
+ "id": 2639,
2139
+ "isConstant": false,
2140
+ "isLValue": false,
2141
+ "isPure": false,
2142
+ "lValueRequested": false,
2143
+ "leftExpression": {
2144
+ "arguments": [
2145
+ {
2146
+ "id": 2636,
2147
+ "name": "value",
2148
+ "nodeType": "Identifier",
2149
+ "overloadedDeclarations": [],
2150
+ "referencedDeclaration": 2627,
2151
+ "src": "3510:5:16",
2152
+ "typeDescriptions": {
2153
+ "typeIdentifier": "t_userDefinedValueType$_ShortString_$2471",
2154
+ "typeString": "ShortString"
2155
+ }
2156
+ }
2157
+ ],
2158
+ "expression": {
2159
+ "argumentTypes": [
2160
+ {
2161
+ "typeIdentifier": "t_userDefinedValueType$_ShortString_$2471",
2162
+ "typeString": "ShortString"
2163
+ }
2164
+ ],
2165
+ "expression": {
2166
+ "id": 2634,
2167
+ "name": "ShortString",
2168
+ "nodeType": "Identifier",
2169
+ "overloadedDeclarations": [],
2170
+ "referencedDeclaration": 2471,
2171
+ "src": "3491:11:16",
2172
+ "typeDescriptions": {
2173
+ "typeIdentifier": "t_type$_t_userDefinedValueType$_ShortString_$2471_$",
2174
+ "typeString": "type(ShortString)"
2175
+ }
2176
+ },
2177
+ "id": 2635,
2178
+ "isConstant": false,
2179
+ "isLValue": false,
2180
+ "isPure": true,
2181
+ "lValueRequested": false,
2182
+ "memberLocation": "3503:6:16",
2183
+ "memberName": "unwrap",
2184
+ "nodeType": "MemberAccess",
2185
+ "src": "3491:18:16",
2186
+ "typeDescriptions": {
2187
+ "typeIdentifier": "t_function_unwrap_pure$_t_userDefinedValueType$_ShortString_$2471_$returns$_t_bytes32_$",
2188
+ "typeString": "function (ShortString) pure returns (bytes32)"
2189
+ }
2190
+ },
2191
+ "id": 2637,
2192
+ "isConstant": false,
2193
+ "isLValue": false,
2194
+ "isPure": false,
2195
+ "kind": "functionCall",
2196
+ "lValueRequested": false,
2197
+ "nameLocations": [],
2198
+ "names": [],
2199
+ "nodeType": "FunctionCall",
2200
+ "src": "3491:25:16",
2201
+ "tryCall": false,
2202
+ "typeDescriptions": {
2203
+ "typeIdentifier": "t_bytes32",
2204
+ "typeString": "bytes32"
2205
+ }
2206
+ },
2207
+ "nodeType": "BinaryOperation",
2208
+ "operator": "!=",
2209
+ "rightExpression": {
2210
+ "id": 2638,
2211
+ "name": "FALLBACK_SENTINEL",
2212
+ "nodeType": "Identifier",
2213
+ "overloadedDeclarations": [],
2214
+ "referencedDeclaration": 2475,
2215
+ "src": "3520:17:16",
2216
+ "typeDescriptions": {
2217
+ "typeIdentifier": "t_bytes32",
2218
+ "typeString": "bytes32"
2219
+ }
2220
+ },
2221
+ "src": "3491:46:16",
2222
+ "typeDescriptions": {
2223
+ "typeIdentifier": "t_bool",
2224
+ "typeString": "bool"
2225
+ }
2226
+ },
2227
+ "falseBody": {
2228
+ "id": 2647,
2229
+ "nodeType": "Block",
2230
+ "src": "3592:37:16",
2231
+ "statements": [
2232
+ {
2233
+ "expression": {
2234
+ "id": 2645,
2235
+ "name": "store",
2236
+ "nodeType": "Identifier",
2237
+ "overloadedDeclarations": [],
2238
+ "referencedDeclaration": 2629,
2239
+ "src": "3613:5:16",
2240
+ "typeDescriptions": {
2241
+ "typeIdentifier": "t_string_storage_ptr",
2242
+ "typeString": "string storage pointer"
2243
+ }
2244
+ },
2245
+ "functionReturnParameters": 2633,
2246
+ "id": 2646,
2247
+ "nodeType": "Return",
2248
+ "src": "3606:12:16"
2249
+ }
2250
+ ]
2251
+ },
2252
+ "id": 2648,
2253
+ "nodeType": "IfStatement",
2254
+ "src": "3487:142:16",
2255
+ "trueBody": {
2256
+ "id": 2644,
2257
+ "nodeType": "Block",
2258
+ "src": "3539:47:16",
2259
+ "statements": [
2260
+ {
2261
+ "expression": {
2262
+ "arguments": [
2263
+ {
2264
+ "id": 2641,
2265
+ "name": "value",
2266
+ "nodeType": "Identifier",
2267
+ "overloadedDeclarations": [],
2268
+ "referencedDeclaration": 2627,
2269
+ "src": "3569:5:16",
2270
+ "typeDescriptions": {
2271
+ "typeIdentifier": "t_userDefinedValueType$_ShortString_$2471",
2272
+ "typeString": "ShortString"
2273
+ }
2274
+ }
2275
+ ],
2276
+ "expression": {
2277
+ "argumentTypes": [
2278
+ {
2279
+ "typeIdentifier": "t_userDefinedValueType$_ShortString_$2471",
2280
+ "typeString": "ShortString"
2281
+ }
2282
+ ],
2283
+ "id": 2640,
2284
+ "name": "toString",
2285
+ "nodeType": "Identifier",
2286
+ "overloadedDeclarations": [],
2287
+ "referencedDeclaration": 2551,
2288
+ "src": "3560:8:16",
2289
+ "typeDescriptions": {
2290
+ "typeIdentifier": "t_function_internal_pure$_t_userDefinedValueType$_ShortString_$2471_$returns$_t_string_memory_ptr_$",
2291
+ "typeString": "function (ShortString) pure returns (string memory)"
2292
+ }
2293
+ },
2294
+ "id": 2642,
2295
+ "isConstant": false,
2296
+ "isLValue": false,
2297
+ "isPure": false,
2298
+ "kind": "functionCall",
2299
+ "lValueRequested": false,
2300
+ "nameLocations": [],
2301
+ "names": [],
2302
+ "nodeType": "FunctionCall",
2303
+ "src": "3560:15:16",
2304
+ "tryCall": false,
2305
+ "typeDescriptions": {
2306
+ "typeIdentifier": "t_string_memory_ptr",
2307
+ "typeString": "string memory"
2308
+ }
2309
+ },
2310
+ "functionReturnParameters": 2633,
2311
+ "id": 2643,
2312
+ "nodeType": "Return",
2313
+ "src": "3553:22:16"
2314
+ }
2315
+ ]
2316
+ }
2317
+ }
2318
+ ]
2319
+ },
2320
+ "documentation": {
2321
+ "id": 2624,
2322
+ "nodeType": "StructuredDocumentation",
2323
+ "src": "3233:130:16",
2324
+ "text": " @dev Decode a string that was encoded to `ShortString` or written to storage using {toShortStringWithFallback}."
2325
+ },
2326
+ "id": 2650,
2327
+ "implemented": true,
2328
+ "kind": "function",
2329
+ "modifiers": [],
2330
+ "name": "toStringWithFallback",
2331
+ "nameLocation": "3377:20:16",
2332
+ "nodeType": "FunctionDefinition",
2333
+ "parameters": {
2334
+ "id": 2630,
2335
+ "nodeType": "ParameterList",
2336
+ "parameters": [
2337
+ {
2338
+ "constant": false,
2339
+ "id": 2627,
2340
+ "mutability": "mutable",
2341
+ "name": "value",
2342
+ "nameLocation": "3410:5:16",
2343
+ "nodeType": "VariableDeclaration",
2344
+ "scope": 2650,
2345
+ "src": "3398:17:16",
2346
+ "stateVariable": false,
2347
+ "storageLocation": "default",
2348
+ "typeDescriptions": {
2349
+ "typeIdentifier": "t_userDefinedValueType$_ShortString_$2471",
2350
+ "typeString": "ShortString"
2351
+ },
2352
+ "typeName": {
2353
+ "id": 2626,
2354
+ "nodeType": "UserDefinedTypeName",
2355
+ "pathNode": {
2356
+ "id": 2625,
2357
+ "name": "ShortString",
2358
+ "nameLocations": [
2359
+ "3398:11:16"
2360
+ ],
2361
+ "nodeType": "IdentifierPath",
2362
+ "referencedDeclaration": 2471,
2363
+ "src": "3398:11:16"
2364
+ },
2365
+ "referencedDeclaration": 2471,
2366
+ "src": "3398:11:16",
2367
+ "typeDescriptions": {
2368
+ "typeIdentifier": "t_userDefinedValueType$_ShortString_$2471",
2369
+ "typeString": "ShortString"
2370
+ }
2371
+ },
2372
+ "visibility": "internal"
2373
+ },
2374
+ {
2375
+ "constant": false,
2376
+ "id": 2629,
2377
+ "mutability": "mutable",
2378
+ "name": "store",
2379
+ "nameLocation": "3432:5:16",
2380
+ "nodeType": "VariableDeclaration",
2381
+ "scope": 2650,
2382
+ "src": "3417:20:16",
2383
+ "stateVariable": false,
2384
+ "storageLocation": "storage",
2385
+ "typeDescriptions": {
2386
+ "typeIdentifier": "t_string_storage_ptr",
2387
+ "typeString": "string"
2388
+ },
2389
+ "typeName": {
2390
+ "id": 2628,
2391
+ "name": "string",
2392
+ "nodeType": "ElementaryTypeName",
2393
+ "src": "3417:6:16",
2394
+ "typeDescriptions": {
2395
+ "typeIdentifier": "t_string_storage_ptr",
2396
+ "typeString": "string"
2397
+ }
2398
+ },
2399
+ "visibility": "internal"
2400
+ }
2401
+ ],
2402
+ "src": "3397:41:16"
2403
+ },
2404
+ "returnParameters": {
2405
+ "id": 2633,
2406
+ "nodeType": "ParameterList",
2407
+ "parameters": [
2408
+ {
2409
+ "constant": false,
2410
+ "id": 2632,
2411
+ "mutability": "mutable",
2412
+ "name": "",
2413
+ "nameLocation": "-1:-1:-1",
2414
+ "nodeType": "VariableDeclaration",
2415
+ "scope": 2650,
2416
+ "src": "3462:13:16",
2417
+ "stateVariable": false,
2418
+ "storageLocation": "memory",
2419
+ "typeDescriptions": {
2420
+ "typeIdentifier": "t_string_memory_ptr",
2421
+ "typeString": "string"
2422
+ },
2423
+ "typeName": {
2424
+ "id": 2631,
2425
+ "name": "string",
2426
+ "nodeType": "ElementaryTypeName",
2427
+ "src": "3462:6:16",
2428
+ "typeDescriptions": {
2429
+ "typeIdentifier": "t_string_storage_ptr",
2430
+ "typeString": "string"
2431
+ }
2432
+ },
2433
+ "visibility": "internal"
2434
+ }
2435
+ ],
2436
+ "src": "3461:15:16"
2437
+ },
2438
+ "scope": 2682,
2439
+ "src": "3368:267:16",
2440
+ "stateMutability": "pure",
2441
+ "virtual": false,
2442
+ "visibility": "internal"
2443
+ },
2444
+ {
2445
+ "body": {
2446
+ "id": 2680,
2447
+ "nodeType": "Block",
2448
+ "src": "4125:174:16",
2449
+ "statements": [
2450
+ {
2451
+ "condition": {
2452
+ "commonType": {
2453
+ "typeIdentifier": "t_bytes32",
2454
+ "typeString": "bytes32"
2455
+ },
2456
+ "id": 2666,
2457
+ "isConstant": false,
2458
+ "isLValue": false,
2459
+ "isPure": false,
2460
+ "lValueRequested": false,
2461
+ "leftExpression": {
2462
+ "arguments": [
2463
+ {
2464
+ "id": 2663,
2465
+ "name": "value",
2466
+ "nodeType": "Identifier",
2467
+ "overloadedDeclarations": [],
2468
+ "referencedDeclaration": 2654,
2469
+ "src": "4158:5:16",
2470
+ "typeDescriptions": {
2471
+ "typeIdentifier": "t_userDefinedValueType$_ShortString_$2471",
2472
+ "typeString": "ShortString"
2473
+ }
2474
+ }
2475
+ ],
2476
+ "expression": {
2477
+ "argumentTypes": [
2478
+ {
2479
+ "typeIdentifier": "t_userDefinedValueType$_ShortString_$2471",
2480
+ "typeString": "ShortString"
2481
+ }
2482
+ ],
2483
+ "expression": {
2484
+ "id": 2661,
2485
+ "name": "ShortString",
2486
+ "nodeType": "Identifier",
2487
+ "overloadedDeclarations": [],
2488
+ "referencedDeclaration": 2471,
2489
+ "src": "4139:11:16",
2490
+ "typeDescriptions": {
2491
+ "typeIdentifier": "t_type$_t_userDefinedValueType$_ShortString_$2471_$",
2492
+ "typeString": "type(ShortString)"
2493
+ }
2494
+ },
2495
+ "id": 2662,
2496
+ "isConstant": false,
2497
+ "isLValue": false,
2498
+ "isPure": true,
2499
+ "lValueRequested": false,
2500
+ "memberLocation": "4151:6:16",
2501
+ "memberName": "unwrap",
2502
+ "nodeType": "MemberAccess",
2503
+ "src": "4139:18:16",
2504
+ "typeDescriptions": {
2505
+ "typeIdentifier": "t_function_unwrap_pure$_t_userDefinedValueType$_ShortString_$2471_$returns$_t_bytes32_$",
2506
+ "typeString": "function (ShortString) pure returns (bytes32)"
2507
+ }
2508
+ },
2509
+ "id": 2664,
2510
+ "isConstant": false,
2511
+ "isLValue": false,
2512
+ "isPure": false,
2513
+ "kind": "functionCall",
2514
+ "lValueRequested": false,
2515
+ "nameLocations": [],
2516
+ "names": [],
2517
+ "nodeType": "FunctionCall",
2518
+ "src": "4139:25:16",
2519
+ "tryCall": false,
2520
+ "typeDescriptions": {
2521
+ "typeIdentifier": "t_bytes32",
2522
+ "typeString": "bytes32"
2523
+ }
2524
+ },
2525
+ "nodeType": "BinaryOperation",
2526
+ "operator": "!=",
2527
+ "rightExpression": {
2528
+ "id": 2665,
2529
+ "name": "FALLBACK_SENTINEL",
2530
+ "nodeType": "Identifier",
2531
+ "overloadedDeclarations": [],
2532
+ "referencedDeclaration": 2475,
2533
+ "src": "4168:17:16",
2534
+ "typeDescriptions": {
2535
+ "typeIdentifier": "t_bytes32",
2536
+ "typeString": "bytes32"
2537
+ }
2538
+ },
2539
+ "src": "4139:46:16",
2540
+ "typeDescriptions": {
2541
+ "typeIdentifier": "t_bool",
2542
+ "typeString": "bool"
2543
+ }
2544
+ },
2545
+ "falseBody": {
2546
+ "id": 2678,
2547
+ "nodeType": "Block",
2548
+ "src": "4242:51:16",
2549
+ "statements": [
2550
+ {
2551
+ "expression": {
2552
+ "expression": {
2553
+ "arguments": [
2554
+ {
2555
+ "id": 2674,
2556
+ "name": "store",
2557
+ "nodeType": "Identifier",
2558
+ "overloadedDeclarations": [],
2559
+ "referencedDeclaration": 2656,
2560
+ "src": "4269:5:16",
2561
+ "typeDescriptions": {
2562
+ "typeIdentifier": "t_string_storage_ptr",
2563
+ "typeString": "string storage pointer"
2564
+ }
2565
+ }
2566
+ ],
2567
+ "expression": {
2568
+ "argumentTypes": [
2569
+ {
2570
+ "typeIdentifier": "t_string_storage_ptr",
2571
+ "typeString": "string storage pointer"
2572
+ }
2573
+ ],
2574
+ "id": 2673,
2575
+ "isConstant": false,
2576
+ "isLValue": false,
2577
+ "isPure": true,
2578
+ "lValueRequested": false,
2579
+ "nodeType": "ElementaryTypeNameExpression",
2580
+ "src": "4263:5:16",
2581
+ "typeDescriptions": {
2582
+ "typeIdentifier": "t_type$_t_bytes_storage_ptr_$",
2583
+ "typeString": "type(bytes storage pointer)"
2584
+ },
2585
+ "typeName": {
2586
+ "id": 2672,
2587
+ "name": "bytes",
2588
+ "nodeType": "ElementaryTypeName",
2589
+ "src": "4263:5:16",
2590
+ "typeDescriptions": {}
2591
+ }
2592
+ },
2593
+ "id": 2675,
2594
+ "isConstant": false,
2595
+ "isLValue": false,
2596
+ "isPure": false,
2597
+ "kind": "typeConversion",
2598
+ "lValueRequested": false,
2599
+ "nameLocations": [],
2600
+ "names": [],
2601
+ "nodeType": "FunctionCall",
2602
+ "src": "4263:12:16",
2603
+ "tryCall": false,
2604
+ "typeDescriptions": {
2605
+ "typeIdentifier": "t_bytes_storage_ptr",
2606
+ "typeString": "bytes storage pointer"
2607
+ }
2608
+ },
2609
+ "id": 2676,
2610
+ "isConstant": false,
2611
+ "isLValue": false,
2612
+ "isPure": false,
2613
+ "lValueRequested": false,
2614
+ "memberLocation": "4276:6:16",
2615
+ "memberName": "length",
2616
+ "nodeType": "MemberAccess",
2617
+ "src": "4263:19:16",
2618
+ "typeDescriptions": {
2619
+ "typeIdentifier": "t_uint256",
2620
+ "typeString": "uint256"
2621
+ }
2622
+ },
2623
+ "functionReturnParameters": 2660,
2624
+ "id": 2677,
2625
+ "nodeType": "Return",
2626
+ "src": "4256:26:16"
2627
+ }
2628
+ ]
2629
+ },
2630
+ "id": 2679,
2631
+ "nodeType": "IfStatement",
2632
+ "src": "4135:158:16",
2633
+ "trueBody": {
2634
+ "id": 2671,
2635
+ "nodeType": "Block",
2636
+ "src": "4187:49:16",
2637
+ "statements": [
2638
+ {
2639
+ "expression": {
2640
+ "arguments": [
2641
+ {
2642
+ "id": 2668,
2643
+ "name": "value",
2644
+ "nodeType": "Identifier",
2645
+ "overloadedDeclarations": [],
2646
+ "referencedDeclaration": 2654,
2647
+ "src": "4219:5:16",
2648
+ "typeDescriptions": {
2649
+ "typeIdentifier": "t_userDefinedValueType$_ShortString_$2471",
2650
+ "typeString": "ShortString"
2651
+ }
2652
+ }
2653
+ ],
2654
+ "expression": {
2655
+ "argumentTypes": [
2656
+ {
2657
+ "typeIdentifier": "t_userDefinedValueType$_ShortString_$2471",
2658
+ "typeString": "ShortString"
2659
+ }
2660
+ ],
2661
+ "id": 2667,
2662
+ "name": "byteLength",
2663
+ "nodeType": "Identifier",
2664
+ "overloadedDeclarations": [],
2665
+ "referencedDeclaration": 2583,
2666
+ "src": "4208:10:16",
2667
+ "typeDescriptions": {
2668
+ "typeIdentifier": "t_function_internal_pure$_t_userDefinedValueType$_ShortString_$2471_$returns$_t_uint256_$",
2669
+ "typeString": "function (ShortString) pure returns (uint256)"
2670
+ }
2671
+ },
2672
+ "id": 2669,
2673
+ "isConstant": false,
2674
+ "isLValue": false,
2675
+ "isPure": false,
2676
+ "kind": "functionCall",
2677
+ "lValueRequested": false,
2678
+ "nameLocations": [],
2679
+ "names": [],
2680
+ "nodeType": "FunctionCall",
2681
+ "src": "4208:17:16",
2682
+ "tryCall": false,
2683
+ "typeDescriptions": {
2684
+ "typeIdentifier": "t_uint256",
2685
+ "typeString": "uint256"
2686
+ }
2687
+ },
2688
+ "functionReturnParameters": 2660,
2689
+ "id": 2670,
2690
+ "nodeType": "Return",
2691
+ "src": "4201:24:16"
2692
+ }
2693
+ ]
2694
+ }
2695
+ }
2696
+ ]
2697
+ },
2698
+ "documentation": {
2699
+ "id": 2651,
2700
+ "nodeType": "StructuredDocumentation",
2701
+ "src": "3641:374:16",
2702
+ "text": " @dev Return the length of a string that was encoded to `ShortString` or written to storage using\n {toShortStringWithFallback}.\n WARNING: This will return the \"byte length\" of the string. This may not reflect the actual length in terms of\n actual characters as the UTF-8 encoding of a single character can span over multiple bytes."
2703
+ },
2704
+ "id": 2681,
2705
+ "implemented": true,
2706
+ "kind": "function",
2707
+ "modifiers": [],
2708
+ "name": "byteLengthWithFallback",
2709
+ "nameLocation": "4029:22:16",
2710
+ "nodeType": "FunctionDefinition",
2711
+ "parameters": {
2712
+ "id": 2657,
2713
+ "nodeType": "ParameterList",
2714
+ "parameters": [
2715
+ {
2716
+ "constant": false,
2717
+ "id": 2654,
2718
+ "mutability": "mutable",
2719
+ "name": "value",
2720
+ "nameLocation": "4064:5:16",
2721
+ "nodeType": "VariableDeclaration",
2722
+ "scope": 2681,
2723
+ "src": "4052:17:16",
2724
+ "stateVariable": false,
2725
+ "storageLocation": "default",
2726
+ "typeDescriptions": {
2727
+ "typeIdentifier": "t_userDefinedValueType$_ShortString_$2471",
2728
+ "typeString": "ShortString"
2729
+ },
2730
+ "typeName": {
2731
+ "id": 2653,
2732
+ "nodeType": "UserDefinedTypeName",
2733
+ "pathNode": {
2734
+ "id": 2652,
2735
+ "name": "ShortString",
2736
+ "nameLocations": [
2737
+ "4052:11:16"
2738
+ ],
2739
+ "nodeType": "IdentifierPath",
2740
+ "referencedDeclaration": 2471,
2741
+ "src": "4052:11:16"
2742
+ },
2743
+ "referencedDeclaration": 2471,
2744
+ "src": "4052:11:16",
2745
+ "typeDescriptions": {
2746
+ "typeIdentifier": "t_userDefinedValueType$_ShortString_$2471",
2747
+ "typeString": "ShortString"
2748
+ }
2749
+ },
2750
+ "visibility": "internal"
2751
+ },
2752
+ {
2753
+ "constant": false,
2754
+ "id": 2656,
2755
+ "mutability": "mutable",
2756
+ "name": "store",
2757
+ "nameLocation": "4086:5:16",
2758
+ "nodeType": "VariableDeclaration",
2759
+ "scope": 2681,
2760
+ "src": "4071:20:16",
2761
+ "stateVariable": false,
2762
+ "storageLocation": "storage",
2763
+ "typeDescriptions": {
2764
+ "typeIdentifier": "t_string_storage_ptr",
2765
+ "typeString": "string"
2766
+ },
2767
+ "typeName": {
2768
+ "id": 2655,
2769
+ "name": "string",
2770
+ "nodeType": "ElementaryTypeName",
2771
+ "src": "4071:6:16",
2772
+ "typeDescriptions": {
2773
+ "typeIdentifier": "t_string_storage_ptr",
2774
+ "typeString": "string"
2775
+ }
2776
+ },
2777
+ "visibility": "internal"
2778
+ }
2779
+ ],
2780
+ "src": "4051:41:16"
2781
+ },
2782
+ "returnParameters": {
2783
+ "id": 2660,
2784
+ "nodeType": "ParameterList",
2785
+ "parameters": [
2786
+ {
2787
+ "constant": false,
2788
+ "id": 2659,
2789
+ "mutability": "mutable",
2790
+ "name": "",
2791
+ "nameLocation": "-1:-1:-1",
2792
+ "nodeType": "VariableDeclaration",
2793
+ "scope": 2681,
2794
+ "src": "4116:7:16",
2795
+ "stateVariable": false,
2796
+ "storageLocation": "default",
2797
+ "typeDescriptions": {
2798
+ "typeIdentifier": "t_uint256",
2799
+ "typeString": "uint256"
2800
+ },
2801
+ "typeName": {
2802
+ "id": 2658,
2803
+ "name": "uint256",
2804
+ "nodeType": "ElementaryTypeName",
2805
+ "src": "4116:7:16",
2806
+ "typeDescriptions": {
2807
+ "typeIdentifier": "t_uint256",
2808
+ "typeString": "uint256"
2809
+ }
2810
+ },
2811
+ "visibility": "internal"
2812
+ }
2813
+ ],
2814
+ "src": "4115:9:16"
2815
+ },
2816
+ "scope": 2682,
2817
+ "src": "4020:279:16",
2818
+ "stateMutability": "view",
2819
+ "virtual": false,
2820
+ "visibility": "internal"
2821
+ }
2822
+ ],
2823
+ "scope": 2683,
2824
+ "src": "1255:3046:16",
2825
+ "usedErrors": [
2826
+ 2479,
2827
+ 2481
2828
+ ],
2829
+ "usedEvents": []
2830
+ }
2831
+ ],
2832
+ "src": "106:4196:16"
2833
+ },
2834
+ "compiler": {
2835
+ "name": "solc",
2836
+ "version": "0.8.21+commit.d9974bed.Emscripten.clang"
2837
+ },
2838
+ "networks": {},
2839
+ "schemaVersion": "3.4.16",
2840
+ "updatedAt": "2026-01-24T20:23:04.050Z",
2841
+ "devdoc": {
2842
+ "details": "This library provides functions to convert short memory strings into a `ShortString` type that can be used as an immutable variable. Strings of arbitrary length can be optimized using this library if they are short enough (up to 31 bytes) by packing them with their length (1 byte) in a single EVM word (32 bytes). Additionally, a fallback mechanism can be used for every other case. Usage example: ```solidity contract Named { using ShortStrings for *; ShortString private immutable _name; string private _nameFallback; constructor(string memory contractName) { _name = contractName.toShortStringWithFallback(_nameFallback); } function name() external view returns (string memory) { return _name.toStringWithFallback(_nameFallback); } } ```",
2843
+ "kind": "dev",
2844
+ "methods": {},
2845
+ "version": 1
2846
+ },
2847
+ "userdoc": {
2848
+ "kind": "user",
2849
+ "methods": {},
2850
+ "version": 1
2851
+ }
2852
+ }