Skip to main content

Questions tagged [program]

The tag has no usage guidance.

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?
Tahlil's user avatar
  • 171
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 ...
Amir reza Riahi's user avatar
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>) -&...
Dylan Kerler's user avatar
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 ...
Muhammad Ali's user avatar
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: ...
Dylan Kerler's user avatar
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 ...
Dylan Kerler's user avatar
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 ...
Dylan Kerler's user avatar
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 ...
Dylan Kerler's user avatar
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 ...
Dylan Kerler's user avatar
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 ...
Dylan Kerler's user avatar
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&...
Dylan Kerler's user avatar
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, ...
FluffyMuffin47's user avatar
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 ...
Nat's user avatar
  • 163
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 ...
Nat's user avatar
  • 163
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 ...
Nat's user avatar
  • 163

15 30 50 per page
1 2 3
4
5
10