ethereumjs-abi icon indicating copy to clipboard operation
ethereumjs-abi copied to clipboard

Split monolithic encoder/decoder

Open axic opened this issue 9 years ago • 3 comments

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

axic avatar Jun 13 '16 19:06 axic

@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.

axic avatar Oct 04 '16 18:10 axic

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.

chriseth avatar Oct 05 '16 10:10 chriseth

What is the status of this issue?

holgerd77 avatar Sep 21 '18 12:09 holgerd77