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

How to use v2 with @nomicfoundation/hardhat-toolbox ? #246

Open
kopax opened this issue Oct 1, 2024 · 3 comments
Open

How to use v2 with @nomicfoundation/hardhat-toolbox ? #246

kopax opened this issue Oct 1, 2024 · 3 comments

Comments

@kopax
Copy link

kopax commented Oct 1, 2024

Hi there, I can see you upgraded ethers v5 to v6 in v2, which is highly needed for deduping package.

However, @NomicFoundation use the obselete outdated v1 version.

I have tried to force install the v2 instead of v1, but it seem incompatible.

How do you guy use hardhat-gas-reporter@2 ? Do you have any top so I can use it with the toolbar ?

Thanks

Link NomicFoundation/hardhat#5795

@cgewecke
Copy link
Owner

cgewecke commented Oct 1, 2024

@kopax Does this fix itself if you completely uninstall the gas-reporter (e.g make sure neither version is in your dependency tree) and then only install the latest?

Another approach is suggested in #229, where you can use npm's overrides, or yarn's resolutions features to specify which version to install by adding the relevant key below to your package.json:

npm

"overrides": {
    "hardhat-gas-reporter": "^2.2.1"
  }

yarn

"resolutions": {
    "hardhat-gas-reporter": "^2.2.1"
  }

@kopax
Copy link
Author

kopax commented Oct 2, 2024

Hi @cgewecke and thanks for your reply. I just pinned the hardhat-gas-reporter version to latest, and so far I do not see regression (your first suggestion). However, I am not if later i use more feature from hardhat-toolbox if it will become buggy.

Are all the interface the same ? I wish they could upgrade hardhat-toolbox with the latest version, but no one poped yet in the opened issue on their repository.

@cgewecke
Copy link
Owner

cgewecke commented Oct 2, 2024

@kopax

if later i use more feature from hardhat-toolbox if it will become buggy...are all the interface the same ?

Yes, it should be ok. There were no relevant API changes in the gas reporter between v1 and v2 and the toolbox basically just imports a set of plugins - I think it's meant to make people's hardhat.config.ts look cleaner and be convenient to set up.

You might see peer dependency warnings from npm when installing since the toolbox lists v1 as a peer here, but that's all.

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

No branches or pull requests

3 participants
@kopax @cgewecke and others