create pools script (uncommenting approvals and adding reset USDT)

This commit is contained in:
2025-11-26 16:07:52 -04:00
parent 99929d8db8
commit e36f6011c9

View File

@@ -139,13 +139,13 @@ const TEST_TOKENS = currentConfig.tokens;
// Default pool parameters
const DEFAULT_POOL_PARAMS = {
name: 'Liquidity Party POC',
symbol: 'POC.LP',
name: 'Original Genesis of Liquidity Party',
symbol: 'OG.LP',
kappa: ethers.BigNumber.from('184467440737095520'), //0.01 * 2^64
swapFeesPpm: Object.values(TEST_TOKENS).map(t => t.feePpm),
flashFeePpm: 5, // 0.0005%
stable: false,
initialLpAmount: ethers.utils.parseUnits('100', 18) // 100 USD in 18 decimals
initialLpAmount: ethers.utils.parseUnits('1', 18) // 100 USD in 18 decimals
};
// Input amount in USD
@@ -289,13 +289,13 @@ async function approveTokens(provider, tokenAmounts, receiverPrivateKey) {
console.log(` [~] Approving ${symbol} ${tokenInfo.address} ${approvalAmount} (1% buffer)...`);
try {
// // USDT and some tokens require setting allowance to 0 before setting a new value
// // Skip for BNB as it has a broken approve function
// if (symbol !== 'BNB') {
// const resetTx = await tokenContract.approve(PARTY_PLANNER_ADDRESS, 0);
// await resetTx.wait();
// console.log(` [+] ${symbol} allowance reset to 0`);
// }
// USDT and some tokens require setting allowance to 0 before setting a new value
// Skip for BNB as it has a broken approve function
if (symbol == 'USDT') {
const resetTx = await tokenContract.approve(PARTY_PLANNER_ADDRESS, 0);
await resetTx.wait();
console.log(` [+] ${symbol} allowance reset to 0`);
}
const tx = await tokenContract.approve(PARTY_PLANNER_ADDRESS, approvalAmount);
await tx.wait();
@@ -445,14 +445,14 @@ async function main() {
// Step 4: Check balances
await checkBalances(provider, wallet, tokenAmounts, RECEIVER_ADDRESS);
// // // Step 5: Approve tokens
// if (NETWORK === 'mockchain' && currentConfig.receiverPrivateKey) {
// // On mockchain, use receiver wallet for approvals
// await approveTokens(provider, tokenAmounts, currentConfig.receiverPrivateKey);
// } else if (NETWORK === 'mainnet') {
// // On mainnet, use the main wallet (payer and receiver are the same)
// await approveTokens(provider, tokenAmounts, PRIVATE_KEY);
// }
// // Step 5: Approve tokens
if (NETWORK === 'mockchain' && currentConfig.receiverPrivateKey) {
// On mockchain, use receiver wallet for approvals
await approveTokens(provider, tokenAmounts, currentConfig.receiverPrivateKey);
} else if (NETWORK === 'mainnet') {
// On mainnet, use the main wallet (payer and receiver are the same)
await approveTokens(provider, tokenAmounts, PRIVATE_KEY);
}
// Step 6: Create pool
await createPool(wallet, tokenAmounts);