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

Contract ABI Specification Format #151

Closed
sezna opened this issue Apr 30, 2021 · 1 comment · Fixed by #194
Closed

Contract ABI Specification Format #151

sezna opened this issue Apr 30, 2021 · 1 comment · Fixed by #194
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@sezna
Copy link
Contributor

sezna commented Apr 30, 2021

If this issue would be better on the HLL, let me know. I believe this is a good place for it though, as it impacts the VM, the chain, and the compiler.

In the most technical sense, what format do we want to use to specify the ABI? In the compiler I have a mapping of public entry points to ASM, but I'm uncertain what serialization format would be the best.

  1. I know we mentioned using hash-based indexing, but once those are specified, what output (from the compiler) would be easiest for other tooling to ingest?
  2. What is "standard" for ABI description formats in our space?
@adlerjohn
Copy link
Contributor

While the ABI does only matter to higher-level constructs than the VM, using ABI encoding in transaction data very much affects other parts of the tech stack, including developer-facing SDKs. As such, it might not be such a bad idea to include a specification of the ABI format in this repo.

For reference, the Solidity ABI specification can be found here: https://docs.soliditylang.org/en/v0.7.6/abi-spec.html. Ideally we should follow a similar format, of specifying the function selector, followed by specifying how things are encoded recursively. We only have a dozen or so types, so the rules should be fairly short FuelLabs/sway#4.

solc outputs a JSON file of a contract's ABI: https://docs.soliditylang.org/en/v0.7.6/abi-spec.html#json. We could do something similar, maybe using a better file format.

@adlerjohn adlerjohn added the documentation Improvements or additions to documentation label Jun 27, 2021
@digorithm digorithm mentioned this issue Aug 3, 2021
@digorithm digorithm linked a pull request Aug 3, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants