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

Implement std::abi and use in Fe v2 to provide Contract ABI support #900

Open
g-r-a-n-t opened this issue Jun 28, 2023 · 0 comments
Open

Comments

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

g-r-a-n-t commented Jun 28, 2023

std::abi

The Fe standard library should provide an implementation of the Ethereum Contract ABI and this implementation should be used in Fe v2 to replace the existing dispatcher codegen.

Here is a rough outline of what's being worked on in #856:

IO types

  • MemoryBuffer, MemoryBufferWriter, MemoryBufferReader
  • CalldataReader

Note: we should probably be using io::{Read, Write} traits, but limitations in the current trait implementation make this difficult. In v2 we can refactor this.

ABI traits

  • AbiEncode, AbiDecode

ABI impls

  • all primitive types
  • Array types (u8 array as bytes)
  • tuple types up to a given length
  • String

Contract ABI support in Fe v2

On the Fe v2 branch, we need to add Contract ABI support using the __call__ function and the std::abi implementation.

The compiler will be responsible for generating the following functional components of the Contract ABI:

  • function selection and dispatching
saifalkatout pushed a commit to saifalkatout/fe that referenced this issue Jun 28, 2023
Implement CallDataReader, as per the tasks of issue ethereum#900
saifalkatout pushed a commit to saifalkatout/fe that referenced this issue Sep 28, 2023
Implement CallDataReader, as per the tasks of issue ethereum#900
saifalkatout pushed a commit to saifalkatout/fe that referenced this issue Sep 28, 2023
Implement CallDataReader, as per the tasks of issue ethereum#900
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

No branches or pull requests

1 participant