Erc20 token smart contract shows Total Supply is 0 uint256

:1234: Code to reproduce


:computer: Environment

Help: As owner, when I checked my Erc20 token smart contract, it shows Total Supply is 0 uint256. I want to input 100,000,000,000 into total supply. How do I write/do it?

Could it be coz, the contract is erc20 and I havent minted any yet, so Total Supply shows as 0 uint256?

If I want Total Supply to be 100B but my ICO/Pre-Sale is 20B, where should I mint? In Token Contract or ICO Contract? How do I write 100B and 20B in solidity language.. In uint256?

So if I want Total Supply to be 100B but my ICO/Pre-Sale is 20B, where should I mint? In Token Contract or ICO Contract? How do I write 100B and 20B in uint256?

Up to your logic, maybe in the ICO contract.

Up to your token decimals, if the decimals is 18, 1B = 1000000000 * 10 ** 18, if the decimals is 6, 1B = 1000000000 * 10 ** 6

Hi, welcome to the community! :wave:

If possible, you can share the code at here, so we can find out what is wrong with it.

Decimals: 2

So if its 2 decimals, for 100000000000 I should write * 1000 ** 2 in uint256?
and 20B, I should write * 200 ** 2 in uint256?

Here's the ERC20 Token Contract Address:

Seems like the contract owner can call function mint() to mint new tokens, so after calling this function, the totalSupply will change.

Tx for your reponses @Skyge & @Amanda! Did I write it correctly, if the decimals are 2?

If decimals is 2, 1B = 1000000000 * 10 ** 2

Tx Amanda! Its truly appreciated!

Tx Skyge. Both you and Amamda are Godsends!

2 Likes