When reading the data returned by
CALLing another contract,
RETURNDATACOPY opcodes are used. They allow moving the data from an otherwise unreachable context to the memory, so it can be consumed.
CALL opcode accepts parameters
retSize. According to https://www.evm.codes/ they are dealing with the same problem:
retOffset: byte offset in the memory in bytes, where to store the return data of the sub context.
retSize: byte size to copy (size of the return data).
What are these parameters used for?
Why nobody seems to be using them? It seems that everybody just passes two
0s and then uses
RETURNDATACOPY to get the return data.
RETURNDATACOPY a newer, more flexible approach?
retSize seems difficult to work with dynamically sized data. Can
retSize still be used?