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] Support sol outputting to a file #601

Open
kayabaNerve opened this issue Apr 14, 2024 · 3 comments
Open

[Feature] Support sol outputting to a file #601

kayabaNerve opened this issue Apr 14, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@kayabaNerve
Copy link

Component

sol! macro

Describe the feature you would like

As ethers-contract allowed, alloy-contract should allow outputting the generated code to a file to allow manual inspection.

This allows anyone curious about how their specific contract had code generated (exact function API/type signatures) trivially inspect it, and can make the sol macro functionality a one-time dependency (to output to code once) or solely a build-time dependency.

Additional context

No response

@kayabaNerve kayabaNerve added the enhancement New feature or request label Apr 14, 2024
@DaniPopes
Copy link
Member

You can inspect any generated code with cargo-expand.

I might still add it for the build script use case though.

@kayabaNerve
Copy link
Author

kayabaNerve commented Apr 15, 2024

AFAICT, this would be... 'trivially' resolved if SolMacroExpander were made public (enable functionally calling it, like one can with Abigen). I'm unsure I want to make a PR with that amount of an API commitment though. Happy to hear opinions/suggestions.

EDIT: SolMacroExpander would have to be moved to a new crate/into the sol-macro-input crate, unless the file exporting was part of the macro (and not functional like with Abigen) :/ I did get a PoC of what I'd like though.

@prestwich
Copy link
Member

after #626 this should be pretty straightforward. cc @yash-atreya

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

3 participants