I would like to return a 2D array from solidity code and look at it with web3.js
this is the solidity function:
uint8 [10][10][100][100] public blocks;
function getBlock(uint x, uint y) returns (uint8[10][10]) {
if (x < blockStoreSide && y < blockStoreSide) {
return blocks[x][y];
}
}
but what I get back from getBlock
in web3.js is this number:
0xf5027db1aeac4c95acf2c3c32651cfd3f5561906399e19bd14818a6c7cc2d9cb
My assumption is this is an address?
I tried web3.eth.getStorageAt
for that address but I just get zeros, not what I actually set the value to.
the ABI looks okay to me:
{ constant: false,
inputs:
[ { name: 'x', type: 'uint256' },
{ name: 'y', type: 'uint256' } ],
name: 'getBlock',
outputs: [ { name: '', type: 'uint8[10][10]' } ],
type: 'function' }
So how do I actually read the storage? More general question, how can I efficiently read large amounts of storage?