Skip to main content
3 votes

whats the difference between #[account(zero copy)] and #[account(zero copy(unsafe)]?

Anchor's zero-copy has a number of strict requirements that you can handwave around with unsafe if you prefer. For example let's say your strut has an enum like: #[repr(u8)] #[derive(Copy, Clone, ...
Whiteseal's user avatar
  • 3,597
1 vote

What's the Concept behind PDAs which are system Accounts?

System Account is just a name given to the PDA account. PDA accounts are owned by the program that derived them. The name for System account might come from the fact that they are holding lamports and ...
ApolloSurferPt's user avatar
1 vote

Anchor test error "InstructionDidNotDeserialize"

If you use the #[instruction()] constraint on your Accounts struct, you need to pass value in your instruction as an argument. pub fn remove_mint_authority(ctx: Context<RemoveMintAuthority>, ...
Jimii's user avatar
  • 7,712
1 vote

Solana: `initializeUserMint` Function Fails with '_bn' Error Despite Matching Program ID

It's tough to tell without more info, but likely one of the PublicKeys passed into your function is invalid -- the _bn field is stored directly on the PublicKey at https://github.com/solana-labs/...
Jon C's user avatar
  • 19.6k
1 vote

Functionality of getVoteAccounts without relying on the RPC call

In my opinion, you cannot fully replicate getVoteAccounts on-chain because Solana programs (smart contracts) cannot directly access or query global account data (like all vote accounts) or perform the ...
pizzza1bit's user avatar
1 vote

Package `Solana-program vX.X.X` cannot be built because it requires rustc X.X.X or newer

Anchor uses the rust compiler that ships with your Solana tools version. You probably want to install a more recent Solana version like: solana-install init 1.18.17 Solana-install is deprecated so if ...
Whiteseal's user avatar
  • 3,597

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