AccessManagedERC20MintBase.sol 667 B

12345678910111213141516
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.8.20;
  3. import {AccessManaged} from "@openzeppelin/contracts/access/manager/AccessManaged.sol";
  4. import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
  5. contract AccessManagedERC20Mint is ERC20, AccessManaged {
  6. constructor(address manager) ERC20("MyToken", "TKN") AccessManaged(manager) {}
  7. // Minting is restricted according to the manager rules for this function.
  8. // The function is identified by its selector: 0x40c10f19.
  9. // Calculated with bytes4(keccak256('mint(address,uint256)'))
  10. function mint(address to, uint256 amount) public restricted {
  11. _mint(to, amount);
  12. }
  13. }