0

I am trying to create account using below method of bubblegum but getting strange error({"err":{"InstructionError":[0,{"Custom":1}]}}) as described here https://github.com/metaplex-foundation/mpl-bubblegum/blob/main/clients/js-solita/tests/main.test.ts#L139-L145 can someone suggest what is going wrong here

const allocTreeIx = anchor.web3.SystemProgram.createAccount({
      fromPubkey: payer.publicKey,
      newAccountPubkey: merkleTree.publicKey,
      lamports:
        await provider.connection.getMinimumBalanceForRentExemption(space),
      space: space,
      programId: SPL_ACCOUNT_COMPRESSION_PROGRAM_ID,
    });
    const tx = new Transaction().add(allocTreeIx);
    tx.feePayer = payer.publicKey;
    console.log(tx);
    await sendAndConfirmTransaction(
      provider.connection,
      tx,
      [payer, merkleTree],
      {
        commitment: "confirmed",
        skipPreflight: true,
      },
    );

1 Answer 1

0

Since this seems to just be calling the system program, and returning an error code of 1, https://github.com/anza-xyz/agave/blob/9a7bada2284e06e421db6186b6d9c715d9eb56cb/sdk/program/src/system_instruction.rs#L61, which is "account does not have enough SOL to perform the operation".

You'll need to be sure that payer has enough SOL to pay for the rent on the new account.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.