Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

feat: add ethabitype support for solidity style enums #526

Merged
merged 3 commits into from
Oct 24, 2021

Conversation

mattsse
Copy link
Collaborator

@mattsse mattsse commented Oct 23, 2021

Motivation

Solution

https://docs.soliditylang.org/en/v0.5.3/types.html#enums

The data representation is the same as for enums in C: The options are represented by subsequent unsigned integer values starting from 0.

EthAbiType will use the position of the enum variant as u8 for tokenization.

PR Checklist

  • Added Tests
  • Added Documentation
  • Updated the changelog

Copy link
Owner

@gakonst gakonst left a comment

Choose a reason for hiding this comment

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

LGTM - we can also add another test for how it gets parsed via abigen enums

@gakonst gakonst merged commit 5779a3c into gakonst:master Oct 24, 2021
meetmangukiya pushed a commit to meetmangukiya/ethers-rs that referenced this pull request Mar 21, 2022
…#526)

* feat: add impl_figment macro

* chore: rename macro

* update test

* feat: use new impl figment macro
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants