Skip to content

What is ABI Encoding? #90

Discussion options

You must be logged in to vote

What is ABI encoding?

ABI encoding is a specification for turning structured data into bytes. Structured data can be: static (eg int,uint,bool, etc,...), dynamic (eg bytes, string), arrays, and tuples. Arrays can be fixed length (ie int[4]) or dynamic length (ie int[]). Static means the size of the data is known by the type. Fixed length arrays and tuples are can be static if all of their members are static.

ABI decoding requires a schema since the encoded data doesn't include any information about what has been encoded. Here is an example of decoding with a schema:

abi.Decode(b, schema.Parse("(uint8, uint8[])"))

In this example, we are decoding the bytes in b as a single tuple containing…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ryandotsmith
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant