Closed yohamta closed 1 month ago
Hi there, thanks for flagging this, I've been thinking about doing something similar too!
AutoloadConfig
whether to use that codepath or not, how does that sound?Another hesitation I had is that it also includes the ABI, so if you're able to retrieve the ContractResult
via MultiABILoader
then you can skip autoload
altogether, right? I'm not certain whether this is not ergonomic enough.
Regarding loader_name
, I actually just added isVerified
to AutoloadResult
(not released yet), what if instead I changed it to something like verifiedBy: undefined|ABILoader
? [Edit: Actually maybe you're right, it would be more convenient to put it inside ContractResult
]
Could you tell me a bit about how you're using WhatsABi so that I have more context?
Hi @shazow,
Thank you for the quick response and your thoughtful insights.
ContractResult
, I completely agree. Adding a flag, like includeContract
in AutoloadConfig
, to control this behavior sounds like a good solution. This would give users the flexibility to opt-in based on their specific needs.Another hesitation I had is that it also includes the ABI, so if you're able to retrieve the ContractResult via MultiABILoader then you can skip autoload altogether, right? I'm not certain whether this is not ergonomic enough.
In our case, we might not be able to skip autoload
due to the need to account for proxies. If users have control over how to handle the proxy resolution with their own autoload
like implementation, I believe they can make an informed decision based on their use case.
As for the verifiedBy
field, I think that would be an excellent addition. Including it in AutoloadResult
would be particularly useful for our needs.
To provide some context, we are developing a feature that retrieves ABIs from addresses to provide a contract interface. We have developed an internal service similar to Whatsabi, but only noticed this project afterward. Since Whatsabi is already open-source and nearly feature-complete, we are considering replacing our internal service with it and contributing to the project to fill any gaps.
Sounds good, let me play around with it and I'll ping you on a PR to review when I have something. :)
Opened a PR here, let me know what you think :)
Merged #122, let me know if there's anything else missing before I do a release sometime next week.
@shazow Thank you for the quick implementation. I've looked at the changes. I'll continue testing, and if anything stands out, I'll provide feedback :)
Hi @shazow,
I would like to propose the following enhancement to streamline the retrieval process:
Modify
autoload
Function to ReturnContractResult
and Includeloader_name
inAutoloadResult
Currently, to obtain all necessary contract information for our use case, we need to perform two separate steps:
autoload
function.MultiABILoader
(e.g.,SourcifyABILoader
,EtherscanABILoader
).Proposal
loader_name
to theAutoloadResult
:etherscan
orsourcify
.autoload
function to also return aContractResult
, consolidating the retrieval process.includeContract
, to enable or disable this feature based on user preference.We are willing to submit a pull request to implement this feature if that would be acceptable.