I am trying to understand how https://solidity.readthedocs.io/en/v0.7.2/internals/layout_in_memory.html works.
function test(uint a) public {
uint test1 = 20;
uint[1] testArr;
testArr[0] = 20;
}
Question 1) where is test1
is stored ? I saw the article which states that all the local variables are stored in memory and not in stack. is this correct ?
Question 2) could you write assembly code with mload
of how to get test1 and testArr[0] from memory since I don't understand how solidity explains memory layout. I'd really appreciate this.