// SPDX-License-Identifier: MIT pragma solidity 0.8.37; import {ERC20} from "@openzeppelin/contracts@5.6.1/token/ERC20/ERC20.sol"; import {ERC20Burnable} from "@openzeppelin/contracts@5.6.1/token/ERC20/extensions/ERC20Burnable.sol"; import {AccessControl} from "@openzeppelin/contracts@5.6.1/access/AccessControl.sol"; /// @notice Unbacked test token, NOT a stablecoin or a claim on dollars. /// @dev Demonstrates issuer roles and mint/burn accounting only. contract MockUSD is ERC20, ERC20Burnable, AccessControl { bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); uint256 public constant CAP = 1_000_000_000 * 10 ** 6; constructor() ERC20("Mock USD - Test Only", "mUSD") { require(block.chainid == 20260922, "Cryptik Testnet only"); _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); _grantRole(MINTER_ROLE, msg.sender); } function decimals() public pure override returns (uint8) { return 6; } /// @param amount Base units: 1 test mUSD = 1,000,000 units. function mint(address to, uint256 amount) external onlyRole(MINTER_ROLE) { require(block.chainid == 20260922, "Cryptik Testnet only"); require(amount > 0 && amount <= CAP - totalSupply(), "Invalid mint amount"); _mint(to, amount); } }