Questions tagged [program]
The program tag has no usage guidance.
150
questions
1
vote
1
answer
22
views
What standard of NFT to adopt when wanting to mint a set of nft to a collection and then mint NFT one by one to the collection
I want to mint a set of NFT to a collection and then want to mint NFT one by one...what standard and procedure would be best in terms of tx cost would that be most efficient in this scenario?
3
votes
1
answer
549
views
Is it possible to invoke a program using solana cli?
I'm using anchor framework to write and deploy programs in solana blockchain. I run solana-test-validator and then use anchor deploy to deploy my simple hello-world program. It gives me the programs ...
2
votes
1
answer
153
views
How do you avoid frontrunning when initializing a program with a PDA?
Let's say I have a PDA which maintains the global state of my program. This is like a singleton. And the following snippets of code initialize it :
pub fn initialize(ctx: Context<Initialize>) -&...
2
votes
1
answer
392
views
Adoptability of token program 2022
So I'm having to create a nontransferable spl token and token program 2022 does provide features for it. The thing is I want to know that has the program been globally accepted in the solana ecosystem ...
1
vote
1
answer
167
views
Why do I get an error when trying to make an associated token account via anchor?
let create_cpi_accounts = associated_token::Create {
payer: ctx.accounts.user.to_account_info(),
associated_token: ctx.accounts.wallet.to_account_info(),
authority: ...
1
vote
1
answer
477
views
How can I deploy an SPL fungible token through anchor?
I attempt to create a new account with the anchor #[account(init)] macro, then assign ownership of the new account to the token program, and then attempt to send the initialize_mint instruction to the ...
2
votes
1
answer
208
views
Why does my SOL transfer succeed despite the fact that it reduces the balance to 0, below the rent exempt amount?
The solana documentation states that any transaction which will cause an account to go below it's rent exempt balance, should fail (here).
Every time an account's balance is reduced, a check is ...
1
vote
1
answer
115
views
Is it safe to use UncheckedAccount if it is simply the destination address for a SOL transfer?
The anchor documentation recommends not using the UncheckedAccount type unless you are sure that there are no security vulnerabilities.
Explicit wrapper for AccountInfo types to emphasize that no ...
2
votes
2
answers
217
views
Why does solana use the term "authority" instead of "owner"?
In ethereum, usually admin rights are defined by the term "owner". For example, many libraries follow this convention such as OpenZeppelin's Ownable contracts. Why in solana, are admin ...
2
votes
1
answer
59
views
What is the best pattern for accepting funds to a program?
Should I create a separate PDA account that is solely dedicated to handling funds or should I handle funds in the same PDA account that is storing state about my program? Are there any security ...
3
votes
1
answer
169
views
Why don't I need to pass in the signer or system_program account when using anchor ts?
I have the following Accounts struct in my program:
#[derive(Accounts)]
pub struct StartLottery<'info> {
#[account(init, payer = user, space = 8 + 8 + 8 + 8)]
pub lottery_state: Account&...
2
votes
1
answer
48
views
How is the PDA created for this program?
in this code example:
use borsh::{BorshDeserialize, BorshSerialize};
use solana_program::{
account_info::{next_account_info, AccountInfo},
declare_id,
entrypoint::ProgramResult,
msg,
...
0
votes
1
answer
27
views
Read Global Settings from Core Program?
In chains like eos there are system contracts that can be read from. In ethereum things like the eth staking contract can also be referenced.
Are there core solana programs that can be read from? I'm ...
4
votes
1
answer
145
views
Where can I find information on Solana's eqivalent of opcodes?
In ethereum we have opcodes which provide access to things like state at execution time. Is there documentation on what is available for solana programs?
I'm specifically interested in hooks that ...
2
votes
1
answer
148
views
How to determine transaction fee inside rust program?
I am trying to determine if it is possible to determine the transaction fee from within the program itself?
In solidity we have gasleft() which allows us to take snapshots at the beginning and end of ...