If I deploy the following contract in Remix the bytes array test get stored at address 0x00 in storage.
contract parseBytes {
bytes test = "\x20\x00\x10";
function f() {
assembly{
test //should push address of test bytes array and offset to stack
pop //should pop offset
}
}
}
If I extend the bytes array to longer than 31 bytes the storage looks:
0x0000000000000000000000000000000000000000000000000000000000000000: 41 0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563: a020001000100001000e238989d74a050072b08989d74a050040000f0204000000
So it seems that the 32bytes get stored elsewhere (at address 0x290...). How can I retrieve this address using inline assembly? Executing the function above the stack contains the values:
0: 0x2d //is not the address of the bytes array in storage
1: 0x26121ff0