I have a smart contract which I wrote in solidity 0.5.0.
The issue I am having is that I can’t add default supply of token like 0.4.24 or other versions.
Can someone guide as what is the right way to add token supply in smart contract.
It is ERC-20 standard.
To add an initial supply, you can call _mint in your token constructor and mint them to any required address such as the creator of the contract.
See the SimpleToken example:
All state variables are now private , which means that derived contracts cannot access them directly, but have to use getters. This is to increase encapsulation, to be able to reason better about the code. (#1197, #1265, #1267, #1269, #1270, #1268, #1281)
Thank you Andrew.
I even used the same example which is given in above link. I placed every code in single .sol file and compiled using https://remix.ethereum.org.
I used https://www.myetherwallet.com to deploy into ropsten network. Everything is good but as usual my total supply is 0.
The following ERC20 token can be deployed using Remix.
You can mint additional tokens by calling mint from ERC20Mintable where the deployer of the contract has the MinterRole.