[Ethereum] Dynamic total supply for ERC20 tokens

contract-developmenterc-20tokens

I am trying to create an ERC20 token using the following workflow.

  1. Create a new token, let's say 'XYZ' with an initial total supply of 1000 coins.
  2. List them on exchanges and also create coin's own wallet for purchasing the coins.
  3. When initial supply of 1000 coins is exhausted and a user tries to purchase more coins, let's say 150 coins, then my smart contract mints new tokens (150) on the fly and credits to user's wallet on successful payment. And the cycle continues. Obviously, the total supply will keep increasing accordingly.

In OpenZeppelin smart contracts, there are methods for minting and burning tokens but can they be used without any issues?

More importantly, I need to understand if there are any kind of flaws with the workflow mentioned above. Could be technical, financial or otherwise.

Best Answer

https://ethereum.org/token covers most of what you describe, so no, I don't think there are any issues with doing that.

Related Topic