Questions tagged [program]
The program tag has no usage guidance.
150
questions
2
votes
1
answer
50
views
Admin endpoints in a program
How can I ensure that a function can only be called by the address that deployed the program, or the address that is the mint authority ? In anchor
0
votes
0
answers
46
views
deploy program and failed at 99% almost every time?
Error: 1 write transactions failed
There was a problem deploying: Output { status: ExitStatus(unix_wait_status(256)), stdout: "", stderr: "" }.
what this means? some one rejected ...
1
vote
1
answer
52
views
Got error "account data too small for instruction" when run Anchor deploy?
Sometimes I got this error when deploy program with running "anchor deploy":
Error: Deploying program failed: RPC response error -32002: Transaction simulation failed: Error processing ...
0
votes
1
answer
39
views
What happened to this meme coin?
How something like this shown in the chart can happen and how can I possibly find out before it happens.
https://dexscreener.com/solana/2wicz7qpvun1rnuhvusdf8xah22rbkixekgs43rdboj4
0
votes
2
answers
38
views
can not deploy, getting weird error
i'm trying to build and deploy a program, but i get errors while building (althought it still finishes the build), and i can't deploy.
Here is the error while deploying :
ELF error: Failed to parse ...
0
votes
0
answers
18
views
Funding Unfunded Account using Smart Contract
I am searching a way to fund a account using smart conttact, that work fine if the receiver is already done some transactions. This is failing if there is no transactions done on the account.
How can ...
1
vote
1
answer
44
views
Invoking Solana Programs
I was checking different ways to initialize a solana program. I am quiet new to field and expecting some support here.
I am running some VMs on a auto scaling group. I want to invoke a program when ...
2
votes
1
answer
34
views
Deploy a program from another program
I'm trying to build a bridge and I need to create pools in both chains
In Solidity, I would be creating a contract that deploys and manage individual pools, but not sure if that can be achieved in ...
1
vote
1
answer
12
views
Is there a reason for usage of C representation of types in some SPL
For example, why is there COption when compared to the Native Rust primitives and the Rust native Option?
What's the advantage of having this?
0
votes
1
answer
24
views
How can I develop to purchase NFT in Solana and anchor
Help me please~~~
Could you send me a sample code or project?
1
vote
1
answer
45
views
Account creation on Solana
Suppose I have a PDA address that hasn't been initialized yet and I send SOL to it,
Am I correct in assuming that this account will exist?
Who will have control over this account? Will it still be by ...
2
votes
1
answer
27
views
How is program size calculated
I would love to know how a Solana program's size is calculated.
Do PDA's size that are owned by the program add up when this calculation is done? What about arguments?
0
votes
1
answer
25
views
Is the stateless-ask program deployed on mainnet somewhere?
Has someone or some organization deployed the stateless ask program on mainnet somewhere?
https://github.com/solana-labs/solana-program-library/tree/master/stateless-asks
0
votes
1
answer
25
views
Best practice design PDA in solana
When developing contract in solana, I had seen some example (include example in solana cook book - https://solanacookbook.com/gaming/store-sol-in-pda.html#tiny-adventure-anchor-program-part-two) had ...
1
vote
1
answer
23
views
Is there anyway to decode program account change that I don’t know the struct?
I’m trying to decode update that I got from the call of “connection.onProgramAcccountChange” but I don’t know the struct of possible outcome, is there anyway to get the struct or decode it somehow ?
...
0
votes
1
answer
45
views
Tx Reverting Even If Internal CPI Fails
Creating a CPI call, since it returns a Result. If the internal call throws an error, err should have an err() field as per the definition. The whole transaction should not revert, but it is reverting....
0
votes
2
answers
76
views
Revoke Mint authority in Anchor
How can I revoke the mint authority of my SPL token using Anchor?
Using the Revoke accounts context seems not to make a difference.
Side note, what does source represent from anchor's SPL token ...
0
votes
2
answers
61
views
Is it possible to burn tokens on transfer?
Hey is it possible to create a token2022, and burn x% of tokens on every transfer? Something like transfer tax, but burning the tokens. Also i got second question, how can i deploy token on-chain, ...
1
vote
1
answer
12
views
Does <AccountInfo> have the accont key?
Looking at getMultipleAccountInfo it returns a
AccountInfo<T>: {
data: T;
executable: boolean;
lamports: number;
owner: PublicKey;
rentEpoch?: number;
}
Am I correct in ...
1
vote
1
answer
36
views
Websocket version of getProgramAccounts
Is there a WebSocket version of getProgramAccounts that allows me to fetch PDAs with supplied seeds?
2
votes
1
answer
36
views
Relational PDA design through seeds
I have somewhat what seems to be a fairly simple question.
Lets assume we are building a Todo list where everything is public. And lets say a user will be able to create a new Task and that task will ...
0
votes
0
answers
7
views
want to what's wrong in my contract as i can't able to call my deposit function
use anchor_lang::prelude::*;
use anchor_spl::token::{self, Token, TokenAccount, Transfer as SplTransfer};
// use solana_program::system_instruction;
use solana_program::{account_info::AccountInfo, ...
0
votes
1
answer
40
views
Can't run local validator on MAC
Hello I'm getting the following error:
Error: failed to start validator: Failed to create ledger at test-ledger: io error: Error checking to unpack genesis archive: Archive error: extra entry found: &...
1
vote
3
answers
218
views
Deploying a program to mainnet seems impossible?
I have no issue deploying to testnet and devnet, but everything I've tried to get the program to deploy to mainnet using the CLI ends up with it hanging.
Has anyone deployed a program recently (April ...
0
votes
0
answers
18
views
Can anyone help me, they changed the owner of my account and I don't know what to do?
Can anyone help me, they changed the owner of my account and I don't know what to do?
my wallet 86tBAuUuyJE8hUj1wBy2WfAKGts8KhJD6skpyUUowzRJ
They hacked me and changed the owner, is there a way to ...
0
votes
0
answers
33
views
How do i get manual about token-creator-lac.vercel.app
I need manual about "https://token-creator-lac.vercel.app/".
do you have any manual about "https://token-creator-lac.vercel.app/"?
My email is [email protected]
please send me.
...
2
votes
0
answers
255
views
Cannot deploy program onto solana mainnet
First of all, it's super slow when deploy(anchor deploy) my program to mainnet, I got error:
Blockhash expired. 4 retries remaining
Blockhash expired. 3 retries remaining
Blockhash expired. 2 retries ...
0
votes
1
answer
122
views
failed to send transaction: Transaction simulation failed: Error processing Instruction 0: custom program error: 0x5
I encountered an error while executing a program call. Specifically, the error arises during the invocation of a function where I'm attempting to create a metadata account using the ...
1
vote
1
answer
95
views
get transactions/logs from different program, on a span of blocks
Here is the situation:
I'm using Rust.
I need to be able to "listen" to transaction, or at least logs from a list of solana program. I cannot use Websocket's "logsubscribe" ...
1
vote
1
answer
245
views
"package solana-program v1.18.7 cannot be built" error [duplicate]
I have a new Rust project that gives the following error when I compile it.
package `solana-program v1.18.7` cannot be built because it requires rustc 1.72.0 or newer, while the currently active rustc ...
0
votes
2
answers
159
views
creating a custom spl token 22
hey i made a custom keypair and want to make a custom contact address like my keypair. then I spl-token create-token and entered my keypair json and I got this "Error: "default signer is ...
0
votes
1
answer
206
views
How To Name Solana Instructions and Add Program Public Name
On Solscan, when you go to Analytics and scroll to the bottom, I noticed some programs like Raydium, Pyth and Metaplex have public name's set and you see that instead of seeing the program account ...
1
vote
2
answers
38
views
Does a CPI method to a program leave any special footprint on the blockchain?
Firstly, do I understand correctly that CPI call is one of the ways to call a method of program?
If so, only by examining a TX on the blockchain, will it be possible to distinguish a CPI call to a ...
0
votes
1
answer
89
views
Validate secp256k1 ethereum signature?
I’m working on an anchor-lang project to validate secp256k1 ethereum signature. I used secp256k1_recover program docs as a reference for this code. The problem is that the public key I get from the ...
0
votes
0
answers
71
views
Deserialize Solana.Transaction Golang
I have a Golang Solana.Transaction object and want to obtain the raw/pre-compiled instruction details.
How can I deserialize the Transaction.Message.Instruction?
1
vote
1
answer
66
views
How to pause program on Solana?
How can I pause program in Anchor on Solana like pause provided by Solidity?
I know programs on Solana is stateless, but I need to achieve this function.
0
votes
0
answers
26
views
My ownership transferred to another program. How can i set it back to systemprogram?
Scammer transferred my program to another program. Now my wallet is assigned to his program. So I it can't pay for transaction fees anymore.
How can I set it back to system program to recover ?
0
votes
1
answer
419
views
Solana Transactions using Solders object has no attribute 'recent_blockhash'
Below is the Python code I wrote to try to engage the logs of a deployed program.
I don't know why I keep getting the following error:
An error occurred: 'solders.transaction.Transaction' object has ...
2
votes
1
answer
70
views
Access Account Discriminator in Anchor
I wish to access the discriminator of an Account Type inside a program.
The only method I found is
let mut init_storage_data = ctx.accounts.storage.try_to_vec().unwrap();, but it's skips the first 8 ...
1
vote
2
answers
45
views
Is There a Limit To How Many People Can Transfer SOL Into a "Pot" Account?
I'm building a game and want to give players the ability to pool SOL into a PDA account that is distributed to the player that wins. I've read about write-locked accounts, but usually only in the ...
0
votes
1
answer
71
views
Deploying program with sol_remaining_compute_units() gives "invalid account data"
Including something like
msg!("remaining compute: {}", solana_program::compute_units::sol_remaining_compute_units());
will lead to error when deploying
RPC URL: https://api.devnet.solana....
1
vote
1
answer
159
views
What determines the size of a program
How is the size of a program calculated?
If all accounts have a limit of 10 kibibytes, I assume that also applies to programs as well? How will the extend program size affect this? does it allow me to ...
2
votes
1
answer
130
views
Deserialise getAccountInfo data from Rust rpcclient for a PDA from drift protocol
Basically I have the following code in devnet. I want to call getAccountInfo to get some account information.
I have a PDA: JD71QyQpAJvoyq4p6mfwyaw4rY9qaDLk4CQpHeuPSpEK created by the programId: ...
2
votes
1
answer
33
views
canonical method of calling programs functions in script format
I have a couple deployed programs on Devnet. Is there a standard way of calling functions on a deployed program, assuming I have the IDL?
Obviously I could write a test but a test typically deploys a ...
3
votes
2
answers
936
views
How do I interact with closed-source Solana programs with no public IDL?
How do I interact with a program that has no open source and no Anchor program IDL. I need to get types, accounts and instructions for this program: https://solscan.io/account/...
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: ...