Don't Store Ethers or Wei as Simple Integer or Floatsfleeting
- Référence externe : https://docs.ethers.org/v5/api/utils/bignumber/
Why can’t I just use numbers?
The first problem many encounter when dealing with Ethereum is the concept of numbers. Most common currencies are broken down with very little granularity. For example, there are only 100 cents in a single dollar. However, there are 1018 wei in a single ether.
To demonstrate how this may be an issue in your code, consider: