Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 84
0 votes

Are there any risks with the PDA account generate with the hash function?

The PDA generation code itself is already hashing together all of the seeds, so that adds an additional hash step, which is compute-intensive when executed on-chain. … You can read more about PDA generation at https://solana.com/developers/courses/native-onchain-development/program-derived-addresses#3-create-program-address …
Jon C's user avatar
  • 19.6k
1 vote

How to Calculate Space for PDA Accounts with Dynamic Vectors in Solana?

To answer your questions.... You'll need to just put some amount that you want to allocate at the start. Using std::mem::size_of will be incorrect, since it'll give you the stack space for a Vec, whi …
Jon C's user avatar
  • 19.6k
1 vote
Accepted

Passing PDA seeds and bump to sol_invoke_signed_c syscall in solana_nostd_entrypoint environ...

There's a specialized function for converting PDAs into an account meta usable for CPI: to_meta_c_signer https://github.com/cavemanloverboy/solana-nostd-entrypoint/blob/59856f0fd551845080482d64235914a …
Jon C's user avatar
  • 19.6k
1 vote

Best to have PDA own a System Account or be the System Account to move SOL tokens?

You can read up on PDAs at https://solana.com/docs/core/pda and ownership at https://solana.com/docs/core/accounts#system-program …
Jon C's user avatar
  • 19.6k
1 vote

Cross-program invocation with unauthorized signer orr writable account

Your program is being called from token-2022, and then your program is trying to CPI back into token-2022, which isn't possible. Re-entrancy is not allowed on Solana. You'll need to update your soluti …
Jon C's user avatar
  • 19.6k
0 votes

PDA signed CPI access control

For example, if program A calls to program B, program A can sign with a PDA and also provide the seeds used. … Program B can check that the PDA signed and that it was derived using a certain program id. If everything checks out, then program B can be sure that program A signed somewhere. …
Jon C's user avatar
  • 19.6k
1 vote

cargo build works but `cargo build-sbf` and `anchor build` fail with unsupported target error

It seems like there might be something missing in what you've provided. The error says that getrandom cannot be used in Solana programs, but the program you've provided doesn't seem to use any rand de …
Jon C's user avatar
  • 19.6k
0 votes

How to Display Custom Balance of an SPL-Token without Associated Token Account?

If you're writing a custom token program, why not just store the correct balance on the ATA instead of the other PDA you've designed? The ATA is just a PDA too! …
Jon C's user avatar
  • 19.6k
1 vote

Are funds sent into an address with IsOnCurve: false Retreivable?

If IsOnCurve is false, it means the address is a program-derived address. If an exchange has control of that address in their program, they can update their program to do anything with it, including r …
Jon C's user avatar
  • 19.6k
0 votes

How to filter most recently created pdas of a program

There may be better solutions through different RPC providers, but using the default Solana RPC, there's no way to create a "greater than" or "less than" filter, just exact memory comparison. So your …
Jon C's user avatar
  • 19.6k
0 votes

Checking the generated PDA against the user's PDA input

Since you're passing in the seeds to invoke_signed, the runtime will check to make sure that one of the accounts can be promoted to a signer using the provided seeds. The runtime will perform create_p …
Jon C's user avatar
  • 19.6k
0 votes

How can I send to multiple wallets from a single PDA in a single transaction?

Be sure to upgrade all of your tools to the same consistent values, preferably 1.18 at the time of this writing, Solana crates and CLI. You can upgrade the CLI with: solana-install init 1.18.7 And in …
Jon C's user avatar
  • 19.6k
1 vote

Stack offset of 4376 exceeded max offset of 4096 by 280 bytes, please minimize large stack v...

An option is to add #[inline(never)] to any functions that InitiateWheel` might call into. For example, the spl-stake-pool program was having issues in its main processor function because the compiler …
Jon C's user avatar
  • 19.6k
1 vote

Is it a waste to implement HashMap via PDAs when the value type is only a bool?

just need a small piece of metadata, you might be able to use the token-metadata extension in token-2022: https://spl.solana.com/token-2022/extensions#metadata If you give metadata update authority to a PDA
Jon C's user avatar
  • 19.6k
0 votes
Accepted

Autonomous Pyth Price Feed Updates Without User Wallet Confirmations

There's a couple of questions here, and I think it'll help a lot if we separate them. To start, web and hardware wallets typically require manual confirmation for all transactions that the user signs …
Jon C's user avatar
  • 19.6k

15 30 50 per page