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 support for ethers v6 in @typechain/hardhat #843

Closed
wants to merge 8 commits into from

Conversation

fvictorio
Copy link
Contributor

@fvictorio fvictorio commented May 30, 2023

Closes #842.

Tentative changes. I tried this locally and seems to work.

Something I don't like about my implementation is that the contract-specific types for deployContract don't have the right constructor parameters types. I'm not sure how to do this properly, but it seems to me that generateHardhatHelper should receive more information about the contracts to be able to do that, and not just the names.

I also changed some docs to use our chai matchers instead of waffle, since that's the approach we recommend, and because the chai matchers will have support for ethers v6 (and waffle doesn't yet afaik).

@changeset-bot
Copy link

changeset-bot bot commented May 30, 2023

🦋 Changeset detected

Latest commit: 137ebd0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@typechain/hardhat Major
@typechain/ethers-v6 Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@socket-security
Copy link

New dependency changes detected. Learn more about Socket for GitHub ↗︎


👍 No new dependency issues detected in pull request

Bot Commands

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore foo@1.0.0 bar@* or ignore all packages with @SocketSecurity ignore-all

⚠️ Please accept the latest app permissions to ensure bot commands work properly. Accept the new permissions here.

Pull request alert summary
Issue Status
Install scripts ✅ 0 issues
Native code ✅ 0 issues
Bin script shell injection ✅ 0 issues
Unresolved require ✅ 0 issues
Invalid package.json ✅ 0 issues
HTTP dependency ✅ 0 issues
Git dependency ✅ 0 issues
Potential typo squat ✅ 0 issues
Known Malware ✅ 0 issues
Telemetry ✅ 0 issues
Protestware/Troll package ✅ 0 issues

📊 Modified Dependency Overview:

➕ Added Package Capability Access +/- Transitive Count Publisher
@nomicfoundation/hardhat-ethers@3.0.0 None +6 fvictorio
@nomicfoundation/hardhat-chai-matchers@2.0.0 None +5 fvictorio
⬆️ Updated Package Version Diff Added Capability Access +/- Transitive Count Publisher
ethers@6.3.0 5.4.0...6.3.0 None +3/-27 ricmoo

🚮 Removed packages: @nomiclabs/hardhat-ethers@2.0.5, @nomiclabs/hardhat-waffle@2.0.3

@fvictorio
Copy link
Contributor Author

I tested this more and pushed some fixes. It would be great if you could get this merged and released soon, so we can release a new version of our Toolbox with proper Typechain support for ethers v6 ❤️

@@ -14,7 +14,7 @@
"@nomiclabs/hardhat-etherscan": "^2.1.1",
"@nomiclabs/hardhat-truffle5": "^2.0.0",
"@nomiclabs/hardhat-web3": "^2.0.0",
"@typechain/hardhat": "workspace:^7.0.0",
"@typechain/hardhat": "workspace:^8.0.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why change this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, this is a leftover of when I was trying things locally with verdaccio. I'll undo it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fvictorio note i fixed this and all other issues in: #845

> extends Event {
args: TArgsArray & TArgsObject;
}
/* Autogenerated file. Do not edit manually. */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think thit is a slight bug in ethers-v6 target that causes double preamble. Wanna have a look?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@krzkaczor krzkaczor closed this Jun 3, 2023
krzkaczor added a commit that referenced this pull request Jun 5, 2023
Co-authored-by: Franco Victorio <victorio.franco@gmail.com>
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

Successfully merging this pull request may close these issues.

Add support for hardhat + ethers v6
2 participants