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

[Feature] derive attributes for Solidity files #688

Open
Wollac opened this issue Jul 11, 2024 · 0 comments
Open

[Feature] derive attributes for Solidity files #688

Wollac opened this issue Jul 11, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Wollac
Copy link
Contributor

Wollac commented Jul 11, 2024

Component

sol! macro

Describe the feature you would like

When using the sol! macro for ABI JSON files it is possible to specify additional (derive) attributes and everything works as expected:

sol!(
   #![sol(all_derives)]
    #[derive(Deserialize, Serialize)]
    MyJsonContract,
    "../out/MyJsonContract.json"
);

However, the same approach does not work when using sol! for a path to a Solidity file.
It would be great if such a pattern would also work here to add derives (probably serde being the most relevant one) to all applicable generated types.
Of course, the content of the Solidity file could be copied into the macro to make the derives work, but this would lead to code duplication and consistency errors.

Additional context

No response

@Wollac Wollac added the enhancement New feature or request label Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant