I'm trying to return a dynamic array of structs created on the fly from storage data, similar to how we return ViewModel from DB data in MVC. What is the best way of doing it in Solidity?
- Tried creating a dynamic memory array, but couldn't use
- Tried creating a dynamic storage array, but it said,
Uninitialized storage pointer.
- If I declare the output array on the contract level, it won't let me
push, because it would modify the array.