-
Notifications
You must be signed in to change notification settings - Fork 51
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
There's no way to accept multiple ABIs at once #41
Comments
+1 this would be a helpful feature when generating interfaces for contracts that utilize a proxy / logic pattern. My current solution is to combine the ABIs first and then run the generator on the merged ABI. |
@RyanRHall thanks for your feedback! Since your comment, I've made some progress on addressing this limitation. I hope to get some time soon to finish that up! |
@gnidan amazing 🎉 excited to see it. Happy to take the PR for a test drive if you want some feedback. |
Thanks for the offer @RyanRHall! Not sure if your offer extends to precursor work, but I just redid a bunch of internals in #114 that I'm a bit worried could introduce bugs. I'm going to do a bit more thorough testing before I merge+release it as v0.8.0, but if there's a way for you to try this out in your existing workflow, I'd love the extra validation! Once that's in, it should be pretty trivial to get multiple ABI support in place (this precursor work has been such a blocker for a long time, oof!) Update: that change has now been released in abi-to-sol v0.8.0 (see release notes) |
abi-to-sol currently accepts one ABI JSON as input and produces one "primary"
interface
as output alongside any number of otherstruct
orinterface
definitions.This suffices for the use case of copying a single ABI (e.g. from Etherscan) and pasting it into your project; you can reference the
interface
by name in your own Solidity code, and you can even reference all thestruct
definitions and such that the original Soliditycontract
defined.But this is not ideal if your project interfaces with multiple deployed contracts from the same project (e.g. Factory, Router, etc.), since multiple contracts from the same project will likely reference the same
struct
s. Right now, you can run abi-to-sol multiple times (once for each related ABI), and presumably save the output to multiple separate.sol
files. Problem is: now you can't use a normal global import all of these files at the same time, since solc will complain if you import two of the same identifier.It seems natural that abi-to-sol should target this use case, since it already does the hard work of collecting all these different identifiers and organizing them in the right
interface
containers.One open question: is it okay, when operating on multiple ABIs, for abi-to-sol to output just one single Solidity source (like it does now), or is it necessary for abi-to-sol to allow configuration that produces multiple sources (to be saved as separate files)?
The text was updated successfully, but these errors were encountered: