// SPDX-License-Identifier: MIT pragma solidity ^0.8.24; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {MRStandardToken} from "./tokens/MRStandardToken.sol"; import {MRTaxToken} from "./tokens/MRTaxToken.sol"; import {MRReflectionToken} from "./tokens/MRReflectionToken.sol"; /// @title MoonRushTokenFactory — Deploy tokens for a flat launch fee; fees fund RUSH buy & burn. contract MoonRushTokenFactory is Ownable { enum TokenType { Standard, Tax, Reflection } address public feeCollector; uint256 public launchFee; event TokenLaunched( address indexed creator, address indexed token, TokenType tokenType, string name, string symbol, uint256 totalSupply ); event LaunchFeeUpdated(uint256 fee); event FeeCollectorUpdated(address indexed collector); constructor(address feeCollector_, uint256 launchFee_) Ownable(msg.sender) { require(feeCollector_ != address(0), "collector=0"); feeCollector = feeCollector_; launchFee = launchFee_; } function setLaunchFee(uint256 fee) external onlyOwner { launchFee = fee; emit LaunchFeeUpdated(fee); } function setFeeCollector(address collector) external onlyOwner { require(collector != address(0), "collector=0"); feeCollector = collector; emit FeeCollectorUpdated(collector); } function createStandardToken( string calldata name_, string calldata symbol_, uint256 totalSupply_, uint8 decimals_ ) external payable returns (address token) { _collectFee(); token = address( new MRStandardToken(name_, symbol_, totalSupply_, decimals_, msg.sender) ); _emitLaunch(token, TokenType.Standard, name_, symbol_, totalSupply_); } function createTaxToken( string calldata name_, string calldata symbol_, uint256 totalSupply_, uint8 decimals_, uint256 buyTaxBps_, uint256 sellTaxBps_, address taxWallet_ ) external payable returns (address token) { _collectFee(); token = address( new MRTaxToken( name_, symbol_, totalSupply_, decimals_, msg.sender, buyTaxBps_, sellTaxBps_, taxWallet_ ) ); _emitLaunch(token, TokenType.Tax, name_, symbol_, totalSupply_); } function createReflectionToken( string calldata name_, string calldata symbol_, uint256 totalSupply_, uint8 decimals_, uint256 buyTaxBps_, uint256 sellTaxBps_ ) external payable returns (address token) { _collectFee(); token = address( new MRReflectionToken( name_, symbol_, totalSupply_, decimals_, msg.sender, buyTaxBps_, sellTaxBps_ ) ); _emitLaunch(token, TokenType.Reflection, name_, symbol_, totalSupply_); } function _collectFee() private { require(msg.value >= launchFee, "fee too low"); (bool ok,) = feeCollector.call{value: msg.value}(""); require(ok, "fee transfer failed"); } function _emitLaunch( address token, TokenType tokenType, string calldata name_, string calldata symbol_, uint256 totalSupply_ ) private { emit TokenLaunched(msg.sender, token, tokenType, name_, symbol_, totalSupply_); } }