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

Bug: Ethers create random broke in new hardhat version #2923

Closed
0xged opened this issue Jul 11, 2022 · 5 comments
Closed

Bug: Ethers create random broke in new hardhat version #2923

0xged opened this issue Jul 11, 2022 · 5 comments
Assignees

Comments

@0xged
Copy link

0xged commented Jul 11, 2022

Hey guys!

When using ethers way of creating a random wallet, there is a conflict in crypto/hash.

Reproduction:

import { ethers } from 'hardhat';
await ethers.Wallet.createRandom()

Throws:

Error: error:0308010C:digital envelope routines::unsupported
      at new Hash (node:internal/crypto/hash:67:19)
      at createHash (node:crypto:133:10)
      at ripemd160 (node_modules/@ethersproject/sha2/src.ts/sha2.ts:14:29)
      at new HDNode (node_modules/@ethersproject/hdnode/src.ts/index.ts:115:67)
      at Function.HDNode._fromSeed (node_modules/@ethersproject/hdnode/src.ts/index.ts:258:16)
      at Function.HDNode.fromMnemonic (node_modules/@ethersproject/hdnode/src.ts/index.ts:269:23)
      at Function.Wallet.fromMnemonic (node_modules/@ethersproject/wallet/src.ts/index.ts:192:34)
      at Function.Wallet.createRandom (node_modules/@ethersproject/wallet/src.ts/index.ts:177:23)
      at generateRandom (test/utils/wallet.ts:8:23)
      at Context.<anonymous> (test/unit/Greeter.spec.ts:16:25)
      at processImmediate (node:internal/timers:471:21)

I'm trying to get up to date defi-wonderland solidity-boilerplate: defi-wonderland/solidity-hardhat-boilerplate#77

@github-actions
Copy link
Contributor

This issue is also being tracked on Linear.

We use Linear to manage our development process, but we keep the conversations on Github.

LINEAR-ID: c0d6227e-9a0d-49ad-9781-c87bc7d88179

@alcuadrado
Copy link
Member

Have you upgraded node? I'm fairly confident that error comes from Node 17's OpenSSL changes

@alcuadrado
Copy link
Member

I just checked the PR, and I can confirm that. Do you mind reporting it to ethers and tagging me?

@0xged
Copy link
Author

0xged commented Jul 11, 2022

@alcuadrado will do sir! you can close the issue! Sorry! 😬

Ref.: ethers-io/ethers.js#3082

@0xged
Copy link
Author

0xged commented Jul 11, 2022

Issue arises from ethers compatibility with node17 and node18 openssl changes, it's not on Nomics Foundation domain.

@0xged 0xged closed this as not planned Won't fix, can't repro, duplicate, stale Jul 11, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants