ethereumjs-abi
ethereumjs-abi copied to clipboard
Split monolithic encoder/decoder
Each type should have a simple class with:
encode(input: variable type; output:Buffer)decode(input:Buffer; output: variable type)isValid? to check if a parameter can be encoded as the given type
@yann300 @chriseth any comments/ideas on designing this?
The main goal is to have a more flexible interface (and the ability to decode/encode more complex types) as well as to avoid code duplication in https://github.com/ethereum/remix/pull/104.
Note, this library already has support for the ABI encoding as well as the packed Solidity encoding.
I think this is too simple, because e.g. arrays need access to the current base offset.
In general, though, I think that we should go for an object-oriented approach like that, yes.
At some point (probably together with the API documentation of this library) we should als odefine the mapping between ABI types and javascript types.
What is the status of this issue?