MetaMask / metamask-extension

:globe_with_meridians: :electric_plug: The MetaMask browser extension enables browsing Ethereum blockchain enabled websites
https://metamask.io
Other
11.84k stars 4.83k forks source link

Investigation: `bn.js` vs `bignumber.js` vs `bigInt` #16533

Open adonesky1 opened 1 year ago

adonesky1 commented 1 year ago

Currently we have many versions of bn.js and a few of bignumber.js. We need to investigate the following:

  1. Can these packages be used interchangeably?
  2. If so, which one should we use?
  3. Can we eventually migrate use to bigInt? Or do we rely on functionality not available with bigInt
brad-decker commented 1 year ago

@adonesky @danjm — as i was designing Numeric i was imagining a good path forward is to start using it instead of BigNumber or BN everywhere. It uses BigNumber under the hood but should be easy to change it out for either approach. This gives us a migration path and a single API that as long as the tests pass for then we know the migration to one of the other libraries will work.