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, ...
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 ...
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>, ...
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/...
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
anchor × 1529solana-program × 503
rust × 234
anchor-lang × 169
pda × 135
web3.js × 126
anchor-test × 126
account × 85
anchor-client × 76
spl-token × 74
cpi × 58
solana-cli × 55
program × 46
typescript × 45
idl × 45
metaplex × 44
anchor-spl × 43
transactions × 38
anchor-program-idl × 37
nft × 36
testing × 33
cargo × 32
error × 28
deploy × 27
token-2022 × 23