Skip to main content
4 votes
Accepted

Account creation on Solana

yes The system program is the default owner of the account however the program id used to find that PDA still has signing authority for that PDA
Mitch's user avatar
  • 316
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
2 votes

Anchor pass parameters to PDA creation from initialization

I think bn is little endian. I just tried it in a progam and this works: Try in the client: const extraSeeds = new anchor.BN(10).toArrayLike(Buffer, "le", 8); const [playerPDA] = anchor....
Jonas H.'s user avatar
  • 5,777
2 votes
Accepted

Wrapping Sol results into Error: IncorrectProgramId

I finally figured out the problem: I was not initializing the ATA(I assumed it happens automatically when doing a transaction), the owner of the ATA was not the Token Program One more point worth ...
Nika Pestvenidze's user avatar
2 votes

Struct field "token_account_owner_pda" is unsafe, but is not documented

Two ways to fix this - either add the comment, or make it a more specific account instead of an AccountInfo. In your example, this is a special account of length 0, so first declare a new Account type ...
Ahri's user avatar
  • 4,110
1 vote

Struct field "token_account_owner_pda" is unsafe, but is not documented

TL;DR; this usage is safe and you are expected to add the /// CHECK: comment at the field. To understand the error, let's break it down: Struct field "token_account_owner_pda" is unsafe, but ...
chalda's user avatar
  • 1,162
1 vote

Error Number: 2006. Error Message: A seeds constraint was violated

You migh be deriving the lottery address incorrectly, Try this and check whether the tests pass const [lotteryPda, lotteryBump] = PublicKey.findProgramAddressSync( [Buffer.from(lotterySeed), ...
Jimii's user avatar
  • 3,270
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
1 vote

Not able to read the updated value in a Solana Data Account

Instead of manually deserializing the account data, try: const account = await program.account.greetingAccount.fetch( greetingAccount.publicKey ) Anchor can automatically deserialize ...
john's user avatar
  • 7,445

Only top scored, non community-wiki answers of a minimum length are eligible