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

Update Hardhat and Related Depdendencies #100

Closed
wants to merge 1 commit into from

Conversation

nlordell
Copy link
Collaborator

@nlordell nlordell commented Oct 19, 2023

Part of #87

This PR updates hardhat and related dependencies to the latest version. The choice to also update the hardhat-* packages was mostly to be sure that there aren't any unexpected incompatibilities with the actual hardhat version being used (those changes can be reverted if necessary).

Some notable changes that may seem unrelated but worth clarifying:

Another interesting change is the @nomiclabs/hardhat-waffle dependency was changed to an exact version. More recent versions of this package pull in ethereum-waffle v4, which transitively pulls in ganache v7, whose TypeScript definitions are causing compilation errors (I tried updating the compiler with hopes that it might fix the build errors but it did not).

Copy link
Member

@mmv08 mmv08 left a comment

Choose a reason for hiding this comment

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

I suggest using the @nomicfoundation/hardhat-toolbox umbrella package to compose all the dependencies in one umbrella package. It's also the current hardhat's recommended way to bootstrap a project. More info can be found here:
https://hardhat.org/hardhat-runner/plugins/nomicfoundation-hardhat-toolbox

For an example code, you can check out the allowance module in this repo or safe-contracts repository

@mmv08
Copy link
Member

mmv08 commented Oct 19, 2023

Also, when I was migrating the safe-contracts repo to the latest hardhat tooling, I had many problems with Waffle, so I had to remove it, and it was well worth it, I didn't lose any functionality. All the APIs exist in hardhat. Another reason for this is zksync compatibility - achieving this with as few dependencies as possible is easier.

nlordell added a commit that referenced this pull request Oct 23, 2023
Supersedes #100 

This PR implements the suggestion from
#100 (review)
(thanks @mmv08 for the suggestion!), and migrates the 4337 package to
use the latest `hardhat` with `@nomicfoundation/hardhat-toolbox` in
order to simplify dependency management (it also removes a lot of extra
dependencies that were pulled in by `ethereal-waffle` 🎉).

Note that, in order to use the latest version of `hardhat` and
`hardhat-toolbox`, the codebase needed to migrate to Ethers.js v6 which
caused some fairly small changes to the existing TypeScript codebase.

Some additional dependency version changes that may seem unrelated but
worth clarifying:

* `solc`: A follow up to
#99, where the direct
`solc` version didn't change to reflect the hardhat compiler settings
* `@types/node`: Updated to the LTS version of node, which we intend to
use.

Additionally, for testing I was able to execute the `runOp` script
([tx](https://goerli.etherscan.io/tx/0xc1edbf6eb28c37f9df8df1bf44b79bf87fe037b1bf114278718276379bc75ace)).
@nlordell
Copy link
Collaborator Author

nlordell commented Oct 23, 2023

Superseded by #103

@nlordell nlordell closed this Oct 23, 2023
@nlordell nlordell deleted the update-hardhat-version branch March 5, 2024 07:28
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.

2 participants