How to create mintable ERC20?

Hi Folks,
Anyone can help me To write mintable smart contract without initial supply and it should take any token value like if we give 10 input then on;y 10 token can mint ,How to write this smart contract?

Hi, welcome! :wave:

Do you mean you want a Capped token?

Hi Skyge,
I need ti implement this functionality in my Dapp using below contarct Mintable Tokens generation / crowdsale- mint single token/ perform crowdsale

pragma solidity ^0.6.2;

import “”;

contract Token is ERC20 {

constructor () public ERC20("Token", "TKN") {
    _mint(msg.sender, 1000000 * (10 ** uint256(decimals())));


So you mean you can mint only once?

Hi @Heena,

Have a look at Contracts Wizard:

yes and need to mint tokens such way we should not fix the value of that token its should be change every time like that we have to write this mint function