pumpdotfun-sdk icon indicating copy to clipboard operation
pumpdotfun-sdk copied to clipboard

ConstraintSeeds Error (0x7d6) for creator_vault with sdk.createAndBuy()

Open vin-spiegel opened this issue 6 months ago • 6 comments

Hello, I'm encountering an error during transaction simulation when calling the sdk.createAndBuy function, related to a ConstraintSeeds violation for the creator_vault account (error code 0x7d6).

Problem Description

When attempting to create a new token and immediately buy a portion of it using the sdk.createAndBuy function, the transaction simulation fails. The error logs indicate a ConstraintSeeds violation for the creator_vault account (AnchorError, Error Number 2006, custom program error 0x7d6).

Steps to Reproduce

  1. Initialize PumpFunSDK in a standard manner.
  2. Prepare a new mintKeypair for the token, a payerKeypair, and the token metadata.
  3. Call the sdk.createAndBuy(payerKeypair, mintKeypair, tokenMetadata, ...) function with standard arguments.

Actual Outcome

The transaction simulation fails with error logs similar to the following:

Message: Transaction simulation failed: Error processing Instruction 4: custom program error: 0x7d6.
Logs:
[
  ...
  "Program log: AnchorError caused by account: creator_vault. Error Code: ConstraintSeeds. Error Number: 2006. Error Message: A seeds constraint was violated.",
  ...
  "Program ... failed: custom program error: 0x7d6"
]

vin-spiegel avatar May 28 '25 15:05 vin-spiegel

Same here, really really waiting for IDL and to find out what else is missing -_-

SpicyChicken-lab avatar May 29 '25 10:05 SpicyChicken-lab

I hope this helps you.

      const [coinCreatorVaultAuthority] = PublicKey.findProgramAddressSync(
        [
          Buffer.from("creator_vault"), // seed from IDL
          new PublicKey(user).toBuffer(), // coin_creator from pool
        ],
        PUMP_AMM_PROGRAM
      );

      const coinCreatorVaultAta = spl.getAssociatedTokenAddressSync(
        WSOL, // WSOL mint
        coinCreatorVaultAuthority, // owner (the PDA we just derived)
        true // allow owner off curve
      );

plzbugmenot avatar May 30 '25 16:05 plzbugmenot

I hope this helps you.

  const [coinCreatorVaultAuthority] = PublicKey.findProgramAddressSync(
    [
      Buffer.from("creator_vault"), // seed from IDL
      new PublicKey(user).toBuffer(), // coin_creator from pool
    ],
    PUMP_AMM_PROGRAM
  );

  const coinCreatorVaultAta = spl.getAssociatedTokenAddressSync(
    WSOL, // WSOL mint
    coinCreatorVaultAuthority, // owner (the PDA we just derived)
    true // allow owner off curve
  );

could u share please more in details? and could u share proper IDL please as well?

SpicyChicken-lab avatar May 31 '25 08:05 SpicyChicken-lab

Sorry for my delay. You can check this repo built customized transaction. https://github.com/plzbugmenot/Solana_Wallet_Manager_Script

plzbugmenot avatar Jun 03 '25 02:06 plzbugmenot

any updates?

vacuumDev avatar Jun 05 '25 03:06 vacuumDev

Any update

kristijorgji avatar Jun 09 '25 09:06 kristijorgji