Do I need to set a Cap to my token?

Hi Team,
Newbie question here. I am working with an ERC20 contract, it is burnable and it is pre-minted. In my contract the _min() function is only called once by the Constructor. If this is my use case and I don't want any more tokens minted ever, Do I really need a Cap?

My question is do I need to use ERC20Capped.sol since mint is not exposed in my contract and there is no other way to call it?

:1234: Code to reproduce

Here is my contract as is...

// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.11;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";

contract myToken is ERC20, ERC20Burnable {
    constructor(uint256 initialSupply) ERC20("myToken", "MYT") {
        _mint(msg.sender, initialSupply);

:computer: Environment

Using Truffle on VS CODE compiling with Solidity 0.8.11


No, you're exactly right. There is no way to call the _mint function, outside of the contract because you have not included it in a callable function, so you don't need to cap the mint. Whatever you mint in the beginning will be as much as you can ever mint.

1 Like

Thought so, thanks for confirming this it is greatly appreciated.