struct S {
uint128 a;
uint128 b;
}
S test1;
function assemblyStorage() public returns (uint a, uint b, uint c, uint d, uint f, uint g){
test1 = S(5,10);
assembly {
a:=sload(0)
}
}
As we can see, test1
now will occupy the first slot. and not the second one since variables can be packed...
Now, why does sload(0)
returns something like this 3402823669209384634633746074317682114565
and how can I return 5 and 10 ?