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

Simplified ABI encoder #27

Merged
merged 9 commits into from
Oct 3, 2018
Merged

Conversation

mpapierski
Copy link
Contributor

This one assumes that the ABI is known in advance, and is not obtained by decoding JSON file.

This does very simplified encoding of basic types, and saves the hussle of encoding offsets of dynamic variables (which we are using) i.e. strings, bytes.

There are bunch of tests that correctly verifies the simplified encoder based on the examples https://solidity.readthedocs.io/en/develop/abi-spec.html#abi-json

Partly related to #21

This doesn't make much sense at this moment as we don't do validation
against the JSON ABI from a compiled contract. In future, though, we
might want to reintroduce this feature and check if the size we're
trying to encode (i.e. u64) is less or equal to the size of uint in the
ABI.
Copy link
Contributor

@drozdziak1 drozdziak1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat!

@mpapierski mpapierski merged commit e75e141 into althea-net:master Oct 3, 2018
@mpapierski mpapierski mentioned this pull request Oct 3, 2018
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants