// SPDX-License-Identifier: MIT pragma solidity 0.8.37; import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; /// @notice Fixed initial supply, issued to the deploying wallet. No administrator, /// further minting, transfer taxes, freezing, proxy or privileged balance access. contract MNCCommunityToken is ERC20 { uint256 public constant CREATION_FEE = 5 ether; address payable public constant FEE_RECIPIENT = payable(0x4D4E430000000000000000000000000000000003); event CreationFeePaid(address indexed creator, address indexed recipient, uint256 amount); uint8 private tokenPrecision; string public logoURI; constructor(string memory tokenName, string memory tokenSymbol, uint8 precision, uint256 wholeSupply, string memory publicLogoURI) payable ERC20(tokenName, tokenSymbol) { require(bytes(tokenName).length > 0 && bytes(tokenName).length <= 64, "Name length"); bytes memory symbolBytes = bytes(tokenSymbol); require(symbolBytes.length > 0 && symbolBytes.length <= 11, "Symbol length"); for (uint256 i; i < symbolBytes.length; i++) { require((symbolBytes[i] >= 0x41 && symbolBytes[i] <= 0x5a) || (symbolBytes[i] >= 0x30 && symbolBytes[i] <= 0x39), "Symbol characters"); } require(precision <= 18 && wholeSupply > 0 && wholeSupply <= 1e18, "Supply or precision"); bytes memory uri = bytes(publicLogoURI); require(uri.length <= 240, "Logo URI length"); if (uri.length != 0) { require(uri.length >= 9 && uri[0] == 0x68 && uri[1] == 0x74 && uri[2] == 0x74 && uri[3] == 0x70 && uri[4] == 0x73 && uri[5] == 0x3a && uri[6] == 0x2f && uri[7] == 0x2f, "HTTPS logo required"); } require(msg.value == CREATION_FEE, "Creation fee: 5 MNC"); tokenPrecision = precision; logoURI = publicLogoURI; _mint(msg.sender, wholeSupply * 10 ** precision); (bool paid,) = FEE_RECIPIENT.call{value: msg.value}(""); require(paid, "Treasury payment failed"); emit CreationFeePaid(msg.sender, FEE_RECIPIENT, msg.value); } function decimals() public view override returns (uint8) { return tokenPrecision; } }