How to create an ERC20 mintable token?

hello guys
recently i created erc20 token with fixed supply
how i can create maintable token erc20 in v3
please i need good explain about this.

i think i have to add mintable functions in the erc-20 but i think i am lil bit confused

1 Like

Hello @Yazanalsharif, welcome to the forum! I suggest you Introduce yourself here! to the rest of the community :slight_smile:

Have you had the chance to read our :rainbow: amazing documentation on ERC20 tokens supply :rainbow: ?

I strongly suggest you read the whole Tokens section of the documentation and come back in here if you have specific doubts. Let me know how it goes!

1 Like

hello martriay
i am yaza al sharif
studying software engineering lvl 3
i was studying web back-end development and now i am interesting in blockchain development
so i am a beginner in ethereum blockchain looking for experience if you have any advice i will be happy if you share me it
thanks for replying and i readed documentation of erc20 tokens supply

i have some question :slightly_smiling_face:
first why you deleted crowedsale in v3 and what is the alternative

secound in mintable token
how exactly minting tokens , here i see when transaction happen will mint some of tokens

contract ERC20WithAutoMinerReward is ERC20 {
    constructor() public ERC20("Reward", "RWD") {}

    function _mintMinerReward() internal {
        _mint(block.coinbase, 1000);

    function _beforeTokenTransfer(address from, address to, uint256 value) internal virtual override {
        super._beforeTokenTransfer(from, to, value);

and i can add some sort of function in erc20
removerminter() etc…

but what how exactly i can starting mining tokens on test network

1 Like

Hi @Yazanalsharif,

Welcome to the community :wave:

For information on why Crowdsales were removed from OpenZeppelin Contracts 3.x please see the documentation:

Crowdsales are still available in the 2.5 release of OpenZeppelin Contracts.

We can create a mintable ERC20 using Truffle, Remix, buidler or OpenZeppelin CLI without writing Solidity using the Preset ERC20 contract. The guides include how to create a transaction to mint tokens on a local testnet.


i want minig the token like how i mining the ethereum coin

can i do this ?

i already mined ethereum in geth
can i mined my minable token instead of ethereum in geth?

thanks alot