└── mingingforver /mingingforver: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | contract TokenMinter { 5 | string public name = "Minter Token"; 6 | string public symbol = "MTK"; 7 | uint256 public totalSupply; 8 | mapping(address => uint256) public balanceOf; 9 | 10 | address public owner; 11 | 12 | event Mint(address indexed to, uint256 amount); 13 | 14 | modifier onlyOwner() { 15 | require(msg.sender == owner, "Only owner can mint tokens"); 16 | _; 17 | } 18 | 19 | constructor() { 20 | owner = msg.sender; 21 | } 22 | 23 | function mint(address to, uint256 amount) public onlyOwner { 24 | totalSupply += amount; 25 | balanceOf[to] += amount; 26 | emit Mint(to, amount); 27 | } 28 | } 29 | --------------------------------------------------------------------------------