I tried replacing "REDACTED" with the code below. I'm not sure if it's a good fix, but the code fails to create a new launch. Could you please provide some assistance? git code : https://github.com/bilix-software/pump-fun-token-launcher/blob/77bbc0fe2ae05896a23809f58cb43e112e9bdb4c/src/launch.ts#L60
//const bondingCurve = new PublicKey("REDACTED")
const TRADE_PROGRAM_ID = new PublicKey('TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA');
const BONDING_ADDR = new Uint8Array([98, 111, 110, 100, 105, 110, 103, 45, 99, 117, 114, 118, 101]);
const [bondingCurve] = PublicKey.findProgramAddressSync([BONDING_ADDR, mint.publicKey.toBuffer()], TRADE_PROGRAM_ID);
//const associatedBondingCurve = new PublicKey("REDACTED")
const [associatedBondingCurve] = PublicKey.findProgramAddressSync([bondingCurve.toBuffer(), TOKEN_PROGRAM_ID.toBuffer(), mint.publicKey.toBuffer()], ASSOCIATED_TOKEN_PROGRAM_ID);
//const metadata = new PublicKey("REDACTED")
const META_ADDR = new Uint8Array([109, 101, 116, 97, 100, 97, 116, 97]);
const METAPLEX_TOKEN_META = new PublicKey('metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s');
const [metadata] = PublicKey.findProgramAddressSync([META_ADDR, METAPLEX_TOKEN_META.toBuffer(), mint.publicKey.toBuffer()], METAPLEX_TOKEN_META);
================================================== Below is the error :
SendTransactionError: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: custom program error: 0x7d6
at Connection.sendEncodedTransaction (E:\dev\nodejs\dessertcorenode\node_modules\@solana\web3.js\lib\index.cjs.js:8052:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Connection.sendRawTransaction (E:\dev\nodejs\dessertcorenode\node_modules\@solana\web3.js\lib\index.cjs.js:8017:20)
at async Connection.sendTransaction (E:\dev\nodejs\dessertcorenode\node_modules\@solana\web3.js\lib\index.cjs.js:8008:12)
at async sendAndConfirmTransaction (E:\dev\nodejs\dessertcorenode\node_modules\@solana\web3.js\lib\index.cjs.js:2180:21) {
logs: [
'Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P invoke [1]',
'Program log: Instruction: Create',
'Program 11111111111111111111111111111111 invoke [2]',
'Program 11111111111111111111111111111111 success',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]',
'Program log: Instruction: InitializeMint2',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 2780 of 188555 compute units',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success',
'Program log: AnchorError caused by account: bonding_curve. Error Code: ConstraintSeeds. Error Number: 2006. Error Message: A seeds constraint was violated.',
'Program log: Left:',
'Program log: 7Mu152gzqNCP4JuttXmsoN4J1EvsBsAWpKmHePUwRRgQ',
'Program log: Right:',
'Program log: 2w1JdkzwNnMug6aPV7UqhFQJ8mPxvX3fqbXqT9EihrjL',
'Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P consumed 21828 of 200000 compute units',
'Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P failed: custom program error: 0x7d6'
]
}
The complete code is here : https://github.com/bilix-software/pump-fun-token-launcher/blob/77bbc0fe2ae05896a23809f58cb43e112e9bdb4c/src/launch.ts#L60
I have replaced the constants, watching solscan transaction "created token" via pump.fun website:
const SYSTEM_PROGRAM = SystemProgram.programId;
const RENT = SYSVAR_RENT_PUBKEY;
const GLOBAL = new PublicKey("4wTV1YmiEkRvAtNtsSGPtUrqRYQMe5SKy2uB4Jjaxnjf");
const PUMP_FUN_ACCOUNT = new PublicKey("Ce6TQqeHC9p8KetsN6JsjHK7UTZk7nasjjnr7XxXp9F1")
const MPL_TOKEN_METADATA = new PublicKey("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s");
const MINT_AUTHORITY = new PublicKey("TSLvdd1pWpHVjahSpsvCXUbgwsL3JAcvokwaKt1eokM");
const COMPUTE_BUDGET_PROGRAM_ID = new PublicKey("ComputeBudget111111111111111111111111111111");
const PUMP_FUN_PROGRAM = new PublicKey("6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P");
const BONDING_ADDR = new Uint8Array([98, 111, 110, 100, 105, 110, 103, 45, 99, 117, 114, 118, 101]);
const [bondingCurve] = PublicKey.findProgramAddressSync([BONDING_ADDR, mint.publicKey.toBuffer()], PUMP_FUN_ACCOUNT);
const [associatedBondingCurve] = PublicKey.findProgramAddressSync([bondingCurve.toBuffer(), PUMP_FUN_ACCOUNT.toBuffer(), mint.publicKey.toBuffer()], ASSOCIATED_TOKEN_PROGRAM_ID);
const META_ADDR = new Uint8Array([109, 101, 116, 97, 100, 97, 116, 97]);
const METAPLEX_TOKEN_META = new PublicKey('metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s');
const [metadata] = PublicKey.findProgramAddressSync([META_ADDR, METAPLEX_TOKEN_META.toBuffer(), mint.publicKey.toBuffer()], METAPLEX_TOKEN_META);
const txBuilder = new web3.Transaction();
const computeBudgetInstruction = new web3.TransactionInstruction({
keys: [], programId: COMPUTE_BUDGET_PROGRAM_ID,
data: Buffer.concat([Buffer.from(Uint8Array.of(3)), bufferFromUInt64(100000)])
});
txBuilder.add(computeBudgetInstruction);
const keys = [
{ pubkey: mint.publicKey, isSigner: true, isWritable: true }, // Mint account
{ pubkey: MINT_AUTHORITY, isSigner: false, isWritable: false }, // Mint authority
{ pubkey: bondingCurve, isSigner: false, isWritable: true }, // Bonding curve PDA
{ pubkey: associatedBondingCurve, isSigner: false, isWritable: true }, // Associated bonding curve PDA
{ pubkey: GLOBAL, isSigner: false, isWritable: false }, // Global config
{ pubkey: MPL_TOKEN_METADATA, isSigner: false, isWritable: false }, // Metadata program ID
{ pubkey: metadata, isSigner: false, isWritable: true }, // Metadata PDA
{ pubkey: owner, isSigner: true, isWritable: true }, // Owner account
{ pubkey: SYSTEM_PROGRAM, isSigner: false, isWritable: false }, // System program
{ pubkey: TOKEN_PROGRAM_ID, isSigner: false, isWritable: false }, // Token program
{ pubkey: ASSOCIATED_TOKEN_PROGRAM_ID, isSigner: false, isWritable: false }, // Associated token account program
{ pubkey: RENT, isSigner: false, isWritable: false }, // Rent sysvar
{ pubkey: PUMP_FUN_ACCOUNT, isSigner: false, isWritable: false }, // Pump fun account
{ pubkey: PUMP_FUN_PROGRAM, isSigner: false, isWritable: false } // Pump fun program ID
];