I have a contract which declares a array of structures allocated in storage
.
From this contract, I invoke a function in another contract, which takes a single structure as input.
In order to workaround "syntax obstacles", I pass the contents (variables) of the structure instead.
I needed to add a few more variables to the structure, and now I get the following compilation error:
Stack too deep, try removing local variables.
Instinctively, I believe that the only solution is to pass the structure to the function "by address"
Since I have the array of these structures allocated in storage
, I think that it should be feasible.
However, no matter how I try to write it down, I keep getting errors.
When I declare the return-type as address
, I get the following compilation error:
Return argument type struct MyStruct storage ref is not implicitly convertible to expected type address.
When I declare the return-type as MyStruct storage
, I get the following compilation error:
Location has to be memory for publicly visible functions (remove the "storage" keyword).
When I declare the return-type as MyStruct memory
, I get the following runtime error:
Static memory load of more than 32 bytes requested.
Does the Solidity standard state anywhere that this is not feasible?
Thank you.