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

Consider adding hardhat-abi-exporter to Hardhat itself #5984

Open
SebastienGllmt opened this issue Nov 26, 2024 · 1 comment
Open

Consider adding hardhat-abi-exporter to Hardhat itself #5984

SebastienGllmt opened this issue Nov 26, 2024 · 1 comment
Assignees
Labels
status:needs-more-info There's not enough information to start working on this issue

Comments

@SebastienGllmt
Copy link
Contributor

SebastienGllmt commented Nov 26, 2024

Describe the feature

I've updated hardhat-abi-exporter to Hardhat v3 (I think I'm the first person outside of Nomic to build a v3 plugin)

It went well! Code was fairly easy to read, debug and test. Excited to try Hardhat v3 node when it comes out. You can find the code here: ItsNickBarry/hardhat-abi-exporter#64

There are a few other plugins I would have liked to have v3 support for (docgen and ignition being the main two), but one step at a time. Let me know if there is any other way I can help

Why I think this could be useful to integrate into Hardhat

Viem is very commonly used nowadays and it requires having access to the ABI to have proper types for things like getLogs

You can't just use the .json ABI for viem to have proper types because of microsoft/TypeScript#32063, so to solve this I added a tsWrapper option to hardhat-abi-exporter that wraps the ABI JSON in a typescript file with as const so you can have proper type checking for your viem calls

I expect this to also be something a lot of other people want from hardhat

Search terms

No response

@kanej
Copy link
Member

kanej commented Dec 4, 2024

Hey @SebastienGllmt, I have checked in with the team on this.
In Hardhat 3 the new compilation system generates typescript files containing the ABI information as part of the build artifacts. The types in those files can be consumed by Viem to get typing on Viem contract instances.
This capability is leveraged in our updated version of the hardhat-viem plugin, but the underlying code generation of typescript files is built-in to the new compilation pipeline.
From the issue description, it sounds as if this Hardhat 3 capability will meet your requirements or are there further capabilities of hardhat-abi-exporter we should consider?

@kanej kanej added status:needs-more-info There's not enough information to start working on this issue and removed status:needs-decision We need to make a decision about this labels Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:needs-more-info There's not enough information to start working on this issue
Projects
Status: Backlog
Development

No branches or pull requests

3 participants