Define parameters in ERC20

Have been finding it very difficult building a Mintable, Burnable, Pausable token with the latest solidity version despite having access to the files here.

Please, I need assistance especially on how to configure the constructor or define the parameters of the token like Name, Symbol, Total Supply, Decimal.

Thank you.

Hi @AktiViti,

Welcome to the community :wave:

I suggest looking at the following tutorials:

Just like so:

pragma solidity 0.6.12;

import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol";

contract MyToken is Initializable, ERC20Upgradeable {
    function initialize(string memory name, string memory symbol, uint256 initialSupply) public virtual initializer {
        __ERC20_init(name, symbol);
        _mint(_msgSender(), initialSupply);
    }
}

Then you can set for name, symbol and totalSupply, BTW, the default decimals is 18, so if you want to set it for another value, you also need to call the function _setReserveDecimals() to set a new value.

Hi @AktiViti,

Please note, the example from @Skyge above can be used with upgradeable contracts: Create upgradeable ERC20

For a non-upgradeable contract you could look at the following: Deploy a simple ERC20 token in Remix

Thanks for your kind remind.

Thank you for your assistance. But i want it to be mintable, pausable, and burnable. How do i implement in ERC20UpgradablePresetMinterPauser

I observed that. Thank you.

Hi @AktiViti,

Please use one of the following tutorials to use the Preset ERC20:

Hi @Skyge,

Thanks for being an awesome member of the community :pray:

I really appreciate your contribution.

Ohh, it is my pleasure!

Hi @AktiViti,

Did you get to try one of the tutorials using the Preset ERC20?

Yes. It worked.
Thank you so much for your assistance.