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

chore: enhance contract macro #27

Merged
merged 13 commits into from
Dec 20, 2024

Conversation

0xrusowsky
Copy link
Contributor

enhances the functionalities of the contract_derive crate by autogenerating interfaces for every contract impl.

when devs use an external r55 contract as a dependency, they simply need to add it to their cargo.toml file with the feature flag interface-only:

https://github.com/0xrusowsky/r55/blob/f8ec238f9d1981dc126116bb5084ec8a3b6c2665/erc20x/Cargo.toml#L9

then it is available for use:

https://github.com/0xrusowsky/r55/blob/f8ec238f9d1981dc126116bb5084ec8a3b6c2665/erc20x/src/lib.rs#L12-L20

Finally, as in the original design, the changes still allow users to have standalone implementations by defining the interfaces themselves:

https://github.com/0xrusowsky/r55/blob/f8ec238f9d1981dc126116bb5084ec8a3b6c2665/erc20x_standalone/src/lib.rs#L15-L23


PS: it requires the feature flag to be defined on the cargo.toml of the crate that is used as a dependency to import the interface
https://github.com/0xrusowsky/r55/blob/f8ec238f9d1981dc126116bb5084ec8a3b6c2665/erc20/Cargo.toml#L6-L8

Copy link
Collaborator

@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.

discussed in r55 chat, lgtm and like this devex

@gakonst gakonst merged commit 8047454 into r55-eth:main Dec 20, 2024
13 checks passed
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