I am in the process of preparing a BEP 20 smart contract for the bsc mainnet and bsc testnet networks.
I need to check my BNB contract balance. I know that I can do it using address(this).balance
, but this value is given without marking the decimal part. How to get the number of decimal places in a given network for WETH without having to write it down hard?
There are probably 9 places on the testnet and 18 on the mainnet.