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

Add configuration option to return interface declarations without pragma/spdx/comments #89

Closed
tintinweb opened this issue Aug 8, 2022 · 4 comments

Comments

@tintinweb
Copy link

Heya 🙌

I'm using abi-to-sol with solidity-shell to fetch abi and autogenerate interfaces from etherscan and just wanted to say this lib is amazing!

My tool merges the generated interface decl into an existing source unit that defines an SPDX header and version pragma already. Would it be possible to add options to output the interface declarations (and types etc.) without any inline comments, SPDX, or pragma?

generateSolidity({
...
outputPragma: False
outputSPDX: False
outputComments: False
...
}

thanks!

ref: tintinweb/solidity-shell#20

@gnidan
Copy link
Owner

gnidan commented Aug 11, 2022

Thanks for opening this! I'll knock this out over the weekend.

@gnidan
Copy link
Owner

gnidan commented Aug 25, 2022

Sorry for the delay @tintinweb, but I just put up a draft PR #91 to address this. I've got some more testing to do on it before I publish it in a release, but quick question for you...

Would you consider leaving --no-attribution turned off? With my changes in #91, if you specify mode: "embedded" in the options, then the abi-to-sol attribution notice will appears inside the primary interface, rather than as a separate sourceunit-level, if that was your reasoning for turning that message off.

Of course feel free to keep using that option, but thought I'd ask :)

@tintinweb
Copy link
Author

Hey @gnidan, thanks for adding this feature 🤗. There are two reasons for omitting everything other than pure solidity code in solidity-shell.

  1. solc is picky when compiling source code and that's why I try to selectively include interface code only. Ideally, the lib would only produce actual interface code w/o pragmas/spdx headers/comments of any sort as multiple or inconsistent pragmas, contradicting SPDX headers may just fail compilation)
  2. I'd like to keep the solidity-shell session output as pure as possible - code only. anything else just unnecessarily pollutes the session (potentially over and over again, i.e. in debug mode or when fetching multiple interfaces).

I think the better solution is to link your tool in the Readme. Open to other ideas 😊. Cheers 🙌

@gnidan
Copy link
Owner

gnidan commented May 28, 2023

Hey @tintinweb, sorry for the delay in publishing these changes. They're live now in v0.7.0 and greater, and you probably noticed that I just opened tintinweb/solidity-shell#26 to incorporate them into solidity-shell.

Understood about the attribution message... thanks for mentioning it in your README's acknowledgements! 🙇

Anyway, closing this issue now :) Thanks again!

@gnidan gnidan closed this as completed May 28, 2023
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

No branches or pull requests

2 participants