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

Support Ethers v6 and Hardhat Toolbox 3.0.0 #187

Open
mvillere opened this issue Aug 2, 2023 · 4 comments
Open

Support Ethers v6 and Hardhat Toolbox 3.0.0 #187

mvillere opened this issue Aug 2, 2023 · 4 comments

Comments

@mvillere
Copy link

mvillere commented Aug 2, 2023

Currently, if you would like to use Hardhat Toolbox 3.0.0, it requires dependencies on hardhat-ethers 3.0.4 and Ethers v6. This leads to an incompatibility with Smock, because smock requires hardhat-ethers v2 and Ethers v5.

It would be nice if Smock was updated to support Ethers v6. Unfortunately, I think this might require removing the hardhat-waffle dependency, as there is not a v3 of that since it is dead (Hardhat has moved on to using chai matchers and hardhat network helpers which they claim is an improvement over waffle).

Ethers v6 has substantial changes, specifically the elimination of BigNumber. Its probably better to deal with that big update sooner rather than later.

Can you please update to support Ethers v6 and also the hardhat 3/toolbox approach? If not, can you provide insight into if that update will ever occur?

Thank you.

@developerasun
Copy link

Upvoted this issue. I ran into the sample problem using current smock version.

Deps
    "@defi-wonderland/smock": "^2.3.5",
    "hardhat": "^2.17.3",
    "@nomicfoundation/hardhat-toolbox": "^3.0.0",
    "@typechain/ethers-v6": "^0.5.0",
    "@typechain/hardhat": "^9.0.0",
    "ethers": "^6.7.1",

When running test like below,

import { FakeContract, smock } from '@defi-wonderland/smock';
it.only("some words" , async function TestMock() {
      const fakeCn = await smock.fake<Assembly>('Assembly')
      console.log({fakeCn})
})

Hardhat complains throw below logs.

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/utils' is not defined by "exports" in C:\Users\user\Desktop\code\web3-snippets\node_modules\.pnpm\@[email protected]_@[email protected]_@[email protected][email protected]\node_modules\ethers\package.json

@huseyindeniz
Copy link

Hello, like @mvillere asked, do you have plans to support ethersV6? I love this package and I'd like to continue using it but upgrading to hardhat3 and ethersV6 is inevitable for most of us.

@temporaryna
Copy link

any news on that?

I found that one fork tried to update it to ethers-v6 (@puuuuh/smock), but I couldn't make it work.

@RishabhSGT
Copy link

Any updates on this one?

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

5 participants