Questions tagged [program]
The program tag has no summary.
180 questions
2 votes
1 answer
53 views
Reduce program deployment cost / Reduce anchor program size
I have relatively simple solana anchor program: About 10 methods No extra dependencies (only anchor-lang and anchor-spl) But still program size is 557K, which will be about 4 SOL or ~550$. This is ...
5 votes
1 answer
23 views
What's the correct ProgramError to use for failed owner checks?
So the ProgramError enum has a bunch of entries where I'm not quite sure what they are supposed to be used for. For instance, what's the difference between IncorrectProgramId, IllegalOwner and ...
1 vote
1 answer
32 views
Decoding program notification
I am trying to decode base64 data I got from the method programSubscribe. I have the IDL for the program, but I don't know how to get the event index for the notification. When I tried decoding Solana ...
3 votes
1 answer
48 views
Unknown Error from looping solana program instruction
I have a simple solana program instruction that does nothing but loop and print the remaining CUs left:- use anchor_lang::{ prelude::*, solana_program::log::sol_log_compute_units }; pub fn ...
1 vote
1 answer
73 views
ata rent calculation for token 2022 mint
Is there any simple way to calculate the minimum rent required to create a associated token account onchain. In Token program it is 165 bytes, 2039280 lamports. But how do we calculate the same for ...
1 vote
1 answer
41 views
Won't the rental balance be refunded after closing a program?
I'm encountering an issue with closing a Solana program on devnet: Initial situation: Program ID: BsnxXwnRuom3Y2Am3VJhaGJK7H8dMhNZbW2kHUaNMghw Program Data Account: ...
3 votes
1 answer
255 views
How are program IDs generated?
I am new to Solana and just started reviewing a code base that had an already existing program, which is using the declare_id! macro from Anchor, like this: declare_id!("...
2 votes
1 answer
208 views
Is there an idiomatic way of defining a SOL amount?
In Solidity, it is possible to define an ETH amount like so: uint256 treasury = 100 ether; Does something like that exist when developing a Solana program?
0 votes
0 answers
28 views
Beginner level advice
Advanced protection program recently installed on my moto g has been a burden and with it I've sorta lost control. Several of my apps passkeys have disappeared, leaving me with errors saying I need ...
0 votes
2 answers
44 views
What seeds does the OpenBook program use to make program derived addresses?
I want to trigger the raydium:swap instruction on the Raydium Liquidity Pool V4 program and I'm wondering where i can find the right seeds to regenerate pdas for OpenBook
0 votes
1 answer
61 views
Best way to create different NFTs inside one Collection?
I'm developing a program like a marketplace (or something like that). I already created a collection, verified the collection, create a nft and marked it as part of this collection. I'm finding the ...
3 votes
1 answer
52 views
How does Solana know a program I uploaded is actually executable?
How does Solana validate an program account I deploy is valid sbpf bytecode? What would happen if I tried to deploy some random bytes to a program account (assuming the headers are correct, since I ...
0 votes
1 answer
68 views
Invoke smart contract using rust
I am writing a rust program (not a smart contract) that needs to execute a swap by calling the orca exchange smart contract. how would i do this. I have the IDL but i cannot seam to generate the ...
0 votes
1 answer
74 views
Solana program events@RPC reliability
Example: We have a simple program that allows you to create accounts. The create account instruction emits a custom event say “AccountCreated” We also have a node server subscribing to those events ...
5 votes
1 answer
94 views
Is there something equivalent to Checks Effects Interactions on Solana?
The Checks Effects Interactions (CEI) pattern is a best practice on the EVM that involves structuring the code in such a way that it makes it secure against reentrancy attacks. Is there an equivalent ...