I am trying to create an ERC20 token using the following workflow.
- Create a new token, let's say 'XYZ' with an initial total supply of 1000 coins.
- List them on exchanges and also create coin's own wallet for purchasing the coins.
- 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.