mit-dci / opencbdc-tx

A transaction processor for a hypothetical, general-purpose, central bank digital currency
Other
898 stars 198 forks source link

Fix errant hardhat console instruction in parsec_user_guide #234

Closed maurermi closed 11 months ago

maurermi commented 1 year ago

ethers.toBeHex(ethers.parseUnits()) no longer appears to be supported as written, modified to parseEther() for correct functionality.

maurermi commented 1 year ago

May also loop in #230 if DCO not fixed for an omnibus doc improvement PR

maurermi commented 1 year ago

Note that ethers.utils.parseEther works in ethers v5, but is not defined in ethers v6 (rather it is just ethers.parseEther see: https://docs.ethers.org/v6/api/utils/#parseEther)

> ethers.version
'6.7.1'
> ethers.parseEther
[Function: parseEther]
> ethers.utils
undefined
> ethers.utils.parseEther
Uncaught TypeError: Cannot read properties of undefined (reading 'parseEther')

More generally, ethers v6 is not backward compatible with v5. The main gist of the migration issues are explained here but the doc is not comprehensive.

I recommend that we explicitly require ethers v6 (as in the uniswap demo doc) and make the necessary changes in the doc.

@AlexRamRam I agree, this is an oversight on my part. Thanks for catching this. I will make the corresponding updates shortly