shazow / whatsabi

Extract the ABI (and resolve proxies, and get other metadata) from Ethereum bytecode, even without source code.
https://shazow.github.io/whatsabi/
MIT License
1.06k stars 74 forks source link

Feature Request: Include `userdoc` and `devdoc` in `ContractResult` #114

Closed yohamta closed 1 month ago

yohamta commented 1 month ago

Hi @shazow,

First and foremost, thank you for developing this incredibly useful library. I would like to propose the following enhancement:


Add userdoc and devdoc to the ContractResult Type

Implementation Details

  1. Modify the ContractResult type to include:
    • userdoc: User documentation
    • devdoc: Developer documentation
  2. Update the relevant functions to parse and include these fields from Sourcify's response.

We are willing to submit a pull request to implement this feature if that would be acceptable.

shazow commented 1 month ago

Hi @yohamta, sounds good to add these fields if they are returned by default anyway.

Do you know if they are also available in Etherscan's results?

Happy to have you contribute this!

yohamta commented 1 month ago

Hi @shazow, thanks for the prompt feedback!

Do you know if they are also available in Etherscan's results?

From what I understand, Etherscan’s results don’t currently include userdoc or devdoc. So for now, it might make sense to only add these fields when using the Sourcify loader. In the future, it could be possible to use solc-js to gather them from the source code, which could help extend support to Etherscan, but that’s just an idea!

shazow commented 1 month ago

Let's add them as optional fields, so we can set them if they exist.

yohamta commented 1 month ago

Understood! I'll prepare the PR shortly.