Skip to main content

New answers tagged

1 vote

Solana call mint token from pda program: Cross-program invocation with unauthorized

The reason why CreateToken is probably because you are using different seeds. The mint seeds will be your program ID + your mint seeds const [mintAccount, mintAccountBum] = anchor....
Jimii's user avatar
  • 3,260
2 votes

Referencing an account from another within #[derive(Accounts)]

This is a known breaking change from Anchor 0.30.0. This means you have 3 options: Use Anchor 0.29.0 Use one of the two workarounds I suggested here where I answered someone who had a similar issue ...
Ahri's user avatar
  • 4,100
1 vote
Accepted

Error Message: A seeds constraint was violated. The ts client does not correspond to the pda of the Solana program

Everything looks good and works as expected on my machine. Some things to debug, Could you check that you are using the correct programId, maybe you updated it and forgot to update the IDL Try ...
Jimii's user avatar
  • 3,260
1 vote

Anchor build not working

This looks like a bug in the typenum crate that you're using. You're using Windows, which doesn't allow for / in the paths, but the code is trying to include a file directly at https://github.com/...
Jon C's user avatar
  • 15.6k
3 votes

How to Convert from Account<'info, TokenAccount> to UncheckedAccount<'info>

The two types aren't inherently different under the hood. UncheckedAccount simply skips the validation checks a normal included account would go through in an Anchor instruction. You can attempt to ...
Joey Meere's user avatar
  • 1,412
1 vote

How to Convert from Account<'info, TokenAccount> to UncheckedAccount<'info>

Not sure if I fully understand your question, but you want to convert a typed account to an untyped account? Since both AccountInfo and UncheckedAccount are basically just AccountInfo types, using ....
Jimii's user avatar
  • 3,260
2 votes
Accepted

How do I build a transaction using `declare_program!` with anchor_client?

Turns out I was just using two different versions of anchor_client and anchor_lang. Made sure both are the same version, and it works perfectly now.
Ahri's user avatar
  • 4,100
3 votes
Accepted

({"err":{"InstructionError":[0,"InvalidInstructionData"]}})

Your auction account is a program derived address (PDA), defined by your Auction struct. In the client side, you must derive that PDA and then pass it, it can't be just a public key as you are doing ...
Syed Aabis Akhtar's user avatar
1 vote

Anchor Test has Transaction simulation failed: Error processing Instruction 0: custom program error: 0x0

I would recommend using SolanaProgramTest to test Solana programs. If you're using devnet, you'll have to redeploy under a different address or change the seeds between each initialization of an ...
frank's user avatar
  • 11
2 votes

Anchor Test has Transaction simulation failed: Error processing Instruction 0: custom program error: 0x0

This is an expected behaviour. At least based on the code you provided. The test says If PDA Account already created, then we expect an error. The error you receive is 0x0 'Allocate: account Address { ...
chalda's user avatar
  • 1,162
0 votes

mpl-token-metadata 4.1.2 causing issues

checkout https://www.anchor-lang.com/release-notes/0.29.0 Build error: could not find `metadata` in `anchor_spl` and could not find `pda` in `mpl_token_metadata` https://github.com/metaplex-foundation/...
Sandstorm Symmetry's user avatar
1 vote

Is there a way to get program id of CPI call?

The information about the caller program is not provided to a callee program during CPI, but there's a workaround. You could verify the caller program id by: including the caller program id as ...
Jon C's user avatar
  • 15.6k

Top 50 recent answers are included