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

VIP: Inject constants and structs into ABI output #2320

Open
Tracked by #2324
fubuloubu opened this issue Feb 21, 2021 · 1 comment
Open
Tracked by #2324

VIP: Inject constants and structs into ABI output #2320

fubuloubu opened this issue Feb 21, 2021 · 1 comment
Labels
VIP: Discussion Used to denote VIPs and more complex issues that are waiting discussion in a meeting

Comments

@fubuloubu
Copy link
Member

Simple Summary

Inject constants and structs into ABI output

Motivation

The ABI is a living document, and there is no specific reason why additional types can't be added to it, to help facilitate working with a specific contract. Two things in particular would be extremely helpful: defined constants, and structure definitions.

Specification

Since the ABI JSON format is an array of interface types, this makes it hard to work with. This approach will need specific handling by tools in order to function properly:

[
  {
    "name": "THIS_IS_MY_CONSTANT",
    "type": "uint256",
    "value": "100000"
  },
  {
    "name": "MyStruct",
    "type": [
      {"name": "memberA", "type": "address"},
      {"name": "memberB", "type": "bytes32"}
    ]
  },

  {
    "inputs": [{"name": "val", "type": "MyStruct"}]
  }
]

Backwards Compatibility

Not compatible with ABI v2

Dependencies

No dependencies

References

https://docs.soliditylang.org/en/latest/abi-spec.html

Copyright

Copyright and related rights waived via CC0

@fubuloubu fubuloubu added the VIP: Discussion Used to denote VIPs and more complex issues that are waiting discussion in a meeting label Feb 21, 2021
@fubuloubu fubuloubu mentioned this issue Feb 22, 2021
4 tasks
@charles-cooper
Copy link
Member

related/dup: #2835

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
VIP: Discussion Used to denote VIPs and more complex issues that are waiting discussion in a meeting
Projects
None yet
Development

No branches or pull requests

2 participants