diff --git a/src/FactoryTokenContractV2.sol b/src/FactoryTokenContractV2.sol index 264ad32..9b14641 100644 --- a/src/FactoryTokenContractV2.sol +++ b/src/FactoryTokenContractV2.sol @@ -219,4 +219,71 @@ contract FactoryTokenContractV2 is Ownable, ReentrancyGuard, Pausable { //////////////////// // External Functions // //////////////////// + + /** + * @notice Creates a pending transaction to initialize a new meme token + * @param _signers Array of addresses that need to sign the transaction + * @param _owner Address of the token owner + * @param _tokenName Name of the token + * @param _tokenSymbol Symbol of the token + * @param _totalSupply Initial token supply + * @param _maxSupply Maximum token supply (if cap enabled) + * @param _canMint Whether token can be minted + * @param _canBurn Whether token can be burned + * @param _supplyCapEnabled Whether supply cap is enabled + * @param _ipfsHash IPFS hash for token metadata + * @return txId The ID of the created transaction + */ + function queueCreateMemecoin( + address[] memory _signers, + address _owner, + string memory _tokenName, + string memory _tokenSymbol, + uint256 _totalSupply, + uint256 _maxSupply, + bool _canMint, + bool _canBurn, + bool _supplyCapEnabled, + string memory _ipfsHash + ) + external + payable + nonReentrant + whenNotPaused + onlyValidOwner(_owner) + returns (uint256 txId) + { + // Validate fee payment + if (msg.value < creationFee) { + revert FactoryTokenContract__InsufficientLiquidity(); + } + + // Validate input parameters + _validateTokenParameters(_signers, _tokenName, _tokenSymbol, _totalSupply, _maxSupply, _supplyCapEnabled, _ipfsHash); + + // Create transaction + txId = _createTransaction( + _signers, + _owner, + _tokenName, + _tokenSymbol, + _totalSupply, + _maxSupply, + _canMint, + _canBurn, + _supplyCapEnabled, + _ipfsHash + ); + + // Queue in multisig contract + multiSigContract.queueTx(txId, _owner, _signers); + + // Transfer fee + if (msg.value > 0) { + (bool success, ) = feeRecipient.call{value: msg.value}(""); + require(success, "Fee transfer failed"); + } + + emit TransactionQueued(txId, _owner, _signers, _tokenName, _tokenSymbol, block.timestamp); + } }