Skip to content

Commit b3c4170

Browse files
author
hectiik
authored
Feat: Add executeCreateMemecoin External onlyMultiSigContract onlyPendingTx Func
1 parent cdf6ec4 commit b3c4170

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

src/FactoryTokenContractV2.sol

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,4 +286,39 @@ contract FactoryTokenContractV2 is Ownable, ReentrancyGuard, Pausable {
286286

287287
emit TransactionQueued(txId, _owner, _signers, _tokenName, _tokenSymbol, block.timestamp);
288288
}
289+
290+
function executeCreateMemecoin(uint256 _txId)
291+
external
292+
onlyMultiSigContract
293+
onlyPendingTx(_txId)
294+
nonReentrant
295+
{
296+
TransactionData storage txData = transactions[_txId];
297+
298+
// Create the token
299+
TokenContract newToken = _deployToken(txData);
300+
301+
// Update transaction status
302+
txData.isPending = false;
303+
txData.isExecuted = true;
304+
txData.tokenAddress = address(newToken);
305+
txData.executedAt = block.timestamp;
306+
307+
// Update tracking
308+
isTokenCreated[address(newToken)] = true;
309+
tokenToOwner[address(newToken)] = txData.owner;
310+
totalTokensCreated++;
311+
312+
// Initialize liquidity pool
313+
_initializeLiquidityPool(address(newToken));
314+
315+
emit MemecoinCreated(
316+
txData.owner,
317+
address(newToken),
318+
txData.tokenName,
319+
txData.tokenSymbol,
320+
txData.totalSupply,
321+
block.timestamp
322+
);
323+
}
289324
}

0 commit comments

Comments
 (0)