ERC20 Wizard - Hardcode amount to mint

How to I change the code to make it mint ONLY 10 tokes each time, and NOT changable?

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

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

contract Test is ERC20, ERC20Burnable, Ownable {
    constructor() ERC20("Test", "MTK") {}

    function mint(address to, uint256 amount) public onlyOwner {
        _mint(to, amount);
    }
}

I have change the mint function to this, and it does what I need :slight_smile:

   function mint() public {
        _mint(msg.sender, 1 * 10 ** decimals());
    }
1 Like