All Questions
Tagged with account-data anchor
13
questions
0
votes
1
answer
20
views
Mutate account data of a program by another program
I have a sender program, and a receiver program. What I want to do is,
sender program has a account, data_account. I want sender program to call modify_data of receiver program, which in turn mutates ...
1
vote
1
answer
99
views
Correct way to define and initialize a variable-length account in Anchor
I have been following the Tic-Tac-Toe tutorial and i am experimenting with creating a PDA account in my program that holds a variable-length list of values (in particular, public keys representing ...
0
votes
1
answer
37
views
The data that anchor' account stored surprise me, for a non-PDA account, it store all history input data. Why?
I play this https://beta.solpg.io/62d67703f6273245aca4f5fe example days ago.
Just added more logs inside initialize() instruction.
After invoke initialize() multiple times with different 'new_account' ...
1
vote
2
answers
85
views
does account declared among different`#[derive(Accounts)]` struct share one storage?
When learning PDAs, I got an example that use PDAs to implement voting:
https://github.com/bfriel/crunchy-vs-smooth/blob/master/programs/crunchy-vs-smooth/src/lib.rs#L34
We can see that there are code:...
1
vote
0
answers
36
views
Increase PDA size after deployment
I read somewhere some time ago that Solana now provides feature to increase the PDA size post deployment. For example, let's assume that I deploy a PDA with a capacity to hold 10 Publickeys and later ...
2
votes
3
answers
190
views
Extending struct fields in a PDA and ensuring compatibility
I need to extend the fields I have within a PDA. Some accounts are already live, so I want those to still be compatible with the new layout. As a simple illustrative example, consider this account ...
1
vote
2
answers
106
views
Are enums with associated values permitted?
Not sure if this is really an anchor or solana related question, since I am able to compile, just not to run tests.
I can run code and test against code that has an account that has following enum:
#[...
3
votes
1
answer
223
views
How do you repopen a closed account?
If an account has been closed with the following anchor context:
#[account(
mut,
close = user,
seeds = [
SEED_SCHEMA.as_bytes(),
&user.key().as_ref()...
7
votes
2
answers
511
views
How to correctly read data from a Zero Copy account
I'm having trouble reading data in the client from a program with a zero copy account. I've defined the account as follows:
#[account(zero_copy)]
#[repr(packed)]
pub struct EventQueue {
header: ...
1
vote
1
answer
734
views
Error: AnchorError: AnchorError caused by account: base_account. Error Code: AccountNotInitialized
I wrote a Solana Program with two functions, one for the initialization of an account and a second to upload data to the account. While testing on localhost it was working fine, but when I uploaded it ...
3
votes
1
answer
537
views
Can Solana Accounts be accessed by any Solana Program using its address?
If I have a deployed Solana Program which creates some Solana accounts for storing data in it. Can these Solana accounts be accessed by any other Solana program using the account addresses? I am ...
3
votes
2
answers
374
views
Store text as string vs. bytes
Is there any advantage to using Vec<u8> over String to store text in storage account fields? And if so, why? From a storage perspective, they are nearly handled identically as far as I can tell ...
5
votes
1
answer
1k
views
How to fetch data from Solana smart contract
Is there a tutorial or detailed explanation on how to fetch all the transactions from a deployed contract on Solana?
My concrete question is: I deployed a contract (https://explorer.solana.com/address/...