I'm trying to store an array of
uint8 but its not very gas efficient. This is my current solution of storing things:
uint8 public VALUES = [10, 11, 12, 13, 14];
The problem is that I will have about 40 of these
VALUE arrays, and if I test that in Remix, I can't even start the Contract (I've waited minutes for the initialisation and it doesn't occur, so I am assuming this is very inefficient).
My next planned solution is to store the values in a string:
string public VALUES = "1011121314";
And then I would retrieve numbers by getting their index
i+1, and using
parseInt(string) to get the number. But I'm not so sure about the efficiency of doing that.
So since I've heard about assembly being very efficienct within Solidity, I'm wondering if there was a way to store multiple
uint8 values in a larger data format, such as a
byte32? My current use case is 5
uint8 values, so perhaps
byte5 would only be required? Also how would I retrieve such values?