2

Say, there is a function in a contract:

function foo(uint[2][2][2] numbers) {}

How the following array should be encoded in raw transaction data?

[
    [
        [ 1, 2 ],
        [ 3, 4 ]
    ],
    [
        [ 5, 6 ],
        [ 7, 8 ]
    ]
]

What if array is incomplete?

[
    [
        [ 1, 2 ]
    ],
    [
        [ 5 ],
        [ 7, 8 ]
    ]
]

Also, is there a plan to support dynamically-sized multidimensional arrays (e.g. uint[][][], string[][]) in function arguments / return values?

0

According to the official answer from the Ethereum team:

This should be working now (in latest nightly) via using the new experimental encoder:

pragma experimental ABIEncoderV2;

contract C {
  function f() returns (uint[][][] memory) {
  }
}

Note: this will turn on an experimental feature (which is also noted in the metadata) and should not be used in production. It is only about encoding, decoding is not supported.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.