ethereumjs-abi
ethereumjs-abi copied to clipboard
Handle type aliases
I copied types over from my contract and ran into an error when it tried to parse lengths that were missing. The workaround is easy, but it'd be nice if it were safe to copy the types from the contract.
Sorry @niran I am not sure exactly which types this is an issue with? Would you mind posting some examples?
uint
and int
are aliases for uint256
and int256
. byte
is an alias for bytes1
.
https://solidity.readthedocs.org/en/latest/types.html
@niran those aliases are implemented. Where are you getting an error?
@niran apparently byte
is a new addition as hence it is not included. It needs to go into the ABI first, but happy to support it after.
uint
failed for me here if I recall correctly: https://github.com/axic/ethereumjs-abi/blob/master/lib/index.js#L78
It tries to parse the size, but there isn't one.
@niran the translation is done earlier: https://github.com/axic/ethereumjs-abi/blob/master/lib/index.js#L178 and https://github.com/axic/ethereumjs-abi/blob/master/lib/index.js#L217
It should be (u)int256
by the time it gets into the single item encoding
What's the status of this, is this a bug or was this wrong use of the API?