I want to store URLs in a contract, which means I need a string of at most 16kB in size. However, I can probably get away with having a 2 or 4 kB string.
Unfortunately, Solidity only seems to support 256B strings and 64kB text objects. 32 ascii characters is way too small, and 8,192 ascii characters is way too many. What can I do to get strings of different sizes?
0 ·
Comments
If you have strings with different sizes, you probably want to use the 'string' or 'text' type, which will only take as much storage as they need plus an additional slot that contains the length of the string.