// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import {PermissionedMintingERC20} from "../PermissionedMintingERC20.sol"; /** * @title JiritsuPermissionedMintingERC20 * @dev A demonstration ERC20 token contract with permissioned minting. * Only accounts with the MINTING_ROLE can mint tokens. This contract * inherits from PermissionedMintingERC20, which provides the logic for * permissioned minting based on a PermissionedManager. */ contract JiritsuPermissionedMintingERC20 is PermissionedMintingERC20 { // Role identifier for accounts allowed to mint tokens bytes32 public constant MINTING_ROLE = keccak256("MINTING_ROLE"); /** * @dev Constructor that initializes the token with a name, symbol, and permissioned minting manager. * The deployer is granted the MINTING_ROLE, allowing them to mint tokens. * @param tokenName The name of the token. * @param tokenSymbol The symbol of the token. * @param permissionedMintingManagerAddress The address of the permissioned minting manager contract. */ constructor( string memory tokenName, string memory tokenSymbol, address permissionedMintingManagerAddress ) PermissionedMintingERC20( tokenName, tokenSymbol, permissionedMintingManagerAddress, msg.sender // The deployer is the initial owner ) { _grantRole(MINTING_ROLE, msg.sender); // Deployer gets minting rights } /** * @notice Allows accounts with the MINTING_ROLE to mint tokens. * @dev Mints `amount` tokens to the `account` address. * @param account The address receiving the minted tokens. * @param amount The amount of tokens to mint. */ function mint( address account, uint256 amount ) external onlyRole(MINTING_ROLE) { _mint(account, amount); } }