Consensys / abi-decoder

Nodejs and Javascript library for decoding data params and events from ethereum transactions
GNU General Public License v3.0
633 stars 218 forks source link

Fix decoding of multidimensional (u)int arrays #15

Closed DeltaBalances closed 6 years ago

DeltaBalances commented 6 years ago

Multidimensional uint arrays cause a throw in _decodeMethod(data).

10 fixed 1-dimensional arrays: new Web3().toBigNumber([1,2,3,4]).toString()

But multidimensional still fails: new Web3().toBigNumber([[1,2],[3,4]]).toString()

Issue is also mentioned in #6

An example function from the 0x project batchFillOrKillOrders(address[5][] orderAddresses, uint256[6][] orderValues, uint256[] fillTakerTokenAmounts, uint8[] v, bytes32[] r, bytes32[] s) Example transaction

DeltaBalances commented 6 years ago

Closed because the current decodeParams doesn't handle this correctly either. Currently using ethers.js Interface.decodeParmams to parse AbiV2 encoded input.