Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ABI pack/unpack operations #129

Closed
g-r-a-n-t opened this issue Nov 20, 2020 · 0 comments
Closed

ABI pack/unpack operations #129

g-r-a-n-t opened this issue Nov 20, 2020 · 0 comments

Comments

@g-r-a-n-t
Copy link
Member

g-r-a-n-t commented Nov 20, 2020

What is wrong?

We currently have inline unpacking taking place in our encoding functions, but do not support packing within our decoding function. Furthermore, we are unnecessarily using an unpacking loop statement on non-padded types within our encoding functions..

How can it be fixed

We should create two new operations (pack and unpack) that take in a segment of memory and unpack or pack the content. These operations should then be used inside of our ABI encode/decode operations in cases where the padded_size and data_size of the inner type of an ABI array are not equal. In cases where they are equal (i.e. u256 arrays and bytes) we just copy or return the entire segment of memory without modifying the content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant