I need to keep track of some events - lots
struct Lot{
address owner,
uint256 price,
uint256 time
};
There is no need to go into the details of this entity, it is only important that there are many lots and they are regularly created.
Initially, I made a mapping of all lots:
mapping(address=>Lot) lots;
However, this approach requires a lot of gas, especially when trying to change any lot.
Therefore, I thought to do it the following way - to encode each lot and store all lots as a bytecode sequence in the contract. That is, F let the encoding function:
F(x) = b1b2...bN; bi - byte
F-1(b1b2...bN) = x
S = F(lot1, lot2, ..., lotM)
Now only S will be contained in the storage and store all existing lots in itself.
Are there implementations of this?