Skip to main content

Questions tagged [rust]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
2 answers
28 views

Reference to mint is not recognized in Struct creation while trying to create an NFT in Anchor

I've tried to follow and complete the following guide to create an NFT through Anchor, but after finishing writing the code following each step throroughly following error while compiling: error[E0425]...
R. Vargas's user avatar
0 votes
0 answers
9 views

Geyser messages are being sent earlier to my local computer in compare with my server even though my server in the same place

I'm running rust code while when I'm running the .exe file from my local computer I get the yellowstone geyser messages like 1-4 seconds faster than the geyser messages that are being sent to my ...
Daniel Kotlarov's user avatar
1 vote
1 answer
33 views

solana contract rust error anchor build

use anchor_lang::prelude::*; use anchor_spl::token::{self, Mint, Token, TokenAccount, Transfer, MintTo}; declare_id!("GTPh1tdHiMWVj3yBj2S2ZZftuLPEWPyQZ6Cy7g5ibM5K"); #[program] pub mod puj { ...
proyectosdev0623 xxx's user avatar
3 votes
1 answer
16 views

Interoperability/Bridging with Solana and other chains

I am conducting a study for the university that has to do with Solana and interoperability with other platforms. Could someone tell me where to find documentation to develop a simple transaction with ...
Santiago Pereira's user avatar
0 votes
0 answers
16 views

Recursively identify associated wallet addresses

I'm looking for guidance or tools to help with a project involving the recursive exploration of blockchain addresses. My goal is to trace all associated wallet addresses by following every transaction ...
nullnav's user avatar
0 votes
0 answers
9 views

Getting error when trying to implement geyser in my code "yellowstone-geyser-client"

I'm getting error when trying to implement geyser, my OS is windows 10, mentioning it because maybe it can be the issue. Anyone knows how I can implement it without getting those errors? Thanks Rustup ...
Daniel Kotlarov's user avatar
1 vote
1 answer
21 views

Error: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: custom program error: 0x2

Whats going wrong here between the local test and instruction that is causing this error? Its really making me stuck and it doesn't return a transaction Id so I can investigate further on the solana ...
vacbannedpirate's user avatar
1 vote
1 answer
29 views

Using `onAccountChange` in Rust

If I want to react to an account changing, I can use the onAccountChange function in web3.js, like described here for example. I'm building a client in rust though, does anchor_client or solana_sdk ...
Ahri's user avatar
  • 3,920
2 votes
0 answers
34 views

Solana call mint token from pda program: Cross-program invocation with unauthorized

I am come from evm to Solana so I have question in evm we have modifier call is_owner... so in Solana how it work, as I understand using cpi here is my code I create custom token create.rs use { ...
Peter Jack's user avatar
0 votes
0 answers
25 views

Protect against sandwich attack

In a scenario where i want to perform a trade on a DEX using high slippage, and i can perform the trade via my own program and then use CPI to do the swap, what checks can i add to my program to make ...
Blue's user avatar
  • 1
0 votes
0 answers
20 views

AccountNotFound when fetching an address with transactions

I have a bot that finds new pairs on raydium pool. When it finds the innitialize pool transaction, it fetches poolInfo. All is being done within milliseconds. But, when it comes to fetch base_vault ...
Someone1111's user avatar
2 votes
2 answers
106 views

How to Convert from Account<'info, TokenAccount> to UncheckedAccount<'info>

Please help me convert from -> #[account(mut)] pub user_token_source: Account<'info, TokenAccount>, into -> /// CHECK: Safe. user source token Account. user Account to swap from. #[...
att's user avatar
  • 151
1 vote
1 answer
32 views

Error Number: 2006. Error Message: A seeds constraint was violated

My rs part: #[derive(Accounts)] pub struct CreateLottery<'info> { #[account( init, payer = authority, space = 4 + 32 + 8 + 4 + 1 + 4 + 1 + 8, // 8 for account ...
mark's user avatar
  • 91
1 vote
1 answer
17 views

'invalid account data' error when using Immutable Owner extension and Non-transferable extensions together

Following guides, https://solana.com/developers/guides/token-extensions/non-transferable#build-instructions and https://solana.com/developers/guides/token-extensions/immutable-owner#conclusion They ...
AndrewZzzz's user avatar
0 votes
1 answer
30 views

Cost of creating Spl-Token is higher when I use my own rust code than using generator tools

We have been trying to creating SPL Token and found that if I want to create using Pink Sale the cost is 1 Sol, if we use CoinFactory its ~0.11912 SOL and using CoinTool is about ~0.02116 SOL. When we ...
user18222's user avatar
2 votes
1 answer
75 views

How to decode account data using Rust?

I'm trying to get the account data using Rust and the solana_sdk. I have the following code where account.data is a Vec. let pubkey = Pubkey::from_str("...
lifeInspection's user avatar
0 votes
0 answers
14 views

Hide transfers in solana program transfer rust

Hey i managed to create some proxy for sending spl tokens and sol tokens. However when you go to solscan you can see all of the transfers however i saw that it's possible to hide this transfers ...
youwish's user avatar
  • 33
0 votes
1 answer
32 views

How can I initialize an SPL token mint using anchor_client?

If I want to create an spl token without anchor in rust, I can do this like described here. How do I do it using the anchor_client crate?
Ahri's user avatar
  • 3,920
1 vote
0 answers
26 views

The trait `borsh::de::BorshDeserialize` is not implemented for `T`

having this issue for the past 2 days with no way of resolving it.. Cargo.toml : name = "mint-nft" version = "0.1.0" description = "Created with Anchor" edition = "...
XLLAA's user avatar
  • 11
2 votes
1 answer
48 views

Why does TypeScript throw a warning for ResolvedAccounts for my PDA in my Anchor tests?

Solana CLI 1.18, Anchor 0.30. I have an existing basic Rust program that sets some attributes (a favorite number, a favorite color, and some hobbies) inside a PDA. // Generate the PDA for the user's ...
mikemaccana's user avatar
  • 2,031
0 votes
0 answers
8 views

Getting error that I am using an older version of rust, but --version shows I am using latest

Although my Rust is version 1.78.0 I constantly am getting this error when I do an anchor build: error: package toml_edit v0.21.1 cannot be built because it requires rustc 1.69 or newer, while the ...
Hossein Jalali's user avatar
1 vote
0 answers
18 views

How to create an instruction from an anchor program with rust client?

Hi I have a simple contract testing slots pasted below. I have a question is there a way I can create an instruction for check_slot that passes in the 2 arguments? I read that anchor-client in rust ...
solfan123's user avatar
0 votes
1 answer
37 views

L2 blockchain on solana

I wanted to create an L2 solution for community platform using Solana. Can anyone tell me how should,I begin and suggest any resources for this if possible.
Shubhankar Banerjee's user avatar
0 votes
1 answer
21 views

Escrow program help

I want to implement a Escrow service on Solana using the Anchor framework but I'm having huge difficulties on understanding how it works... Even by starting from the creation of the Escrow, I cannot ...
Francesco's user avatar
0 votes
1 answer
30 views

"failed: An account required by the instruction is missing" transfer within contract

This is the entire source code of the smart contract use solana_program::{ account_info::{next_account_info, AccountInfo}, entrypoint, entrypoint::ProgramResult, msg, program_error:...
Odette Taylor's user avatar
2 votes
1 answer
55 views

Investigating "Access violation in unknown section at address 0xffffffffffffffff of size 32"

After reading: How to investigate access violation errors, I feel like this error is different from a variety of reasons: I'm modifying an existing (working) Anchor project, and strictly using less ...
Winston Zhao's user avatar
1 vote
2 answers
27 views

How to resolve 'Collection Must Be a Unique Master Edition v2' error?

I am trying to perform collection verification using Solana on-chain (Rust) code. let verify_collection_ix = VerifyCollection { metadata: *metadata_account.key, collection_authority: *...
StarPJ's user avatar
  • 21
0 votes
1 answer
102 views

Raydium swap with rust

Does anyone have some practical examples of swapping on Raydium using Rust? If you have any examples you can share please
Eric vinicius's user avatar
2 votes
1 answer
26 views

|RUST| link Error:1169 Solana Transaction Contract

Here is my entire main.rs,, mod utils; use actix_cors::Cors; use actix_web::{web, App, HttpServer, Responder, HttpResponse, HttpRequest}; use serde::{Deserialize, Serialize}; use reqwest::Client; use ...
Keola's user avatar
  • 73
1 vote
4 answers
62 views

"anchor build" wont generate my "../target/types/program_name" file

I am using the Anchor Framework to build Solana Programs. I haven't had this issue until now: When running anchor build to generate my ../target folder, usually, my ../tests/program-name.ts file is ...
TheLazySol's user avatar
2 votes
2 answers
44 views

Anchor Test has Transaction simulation failed: Error processing Instruction 0: custom program error: 0x0

So if I anchor build and then anchor deploy on the devnet and then use anchor test --skip-build --skip-deploy since I already built and deployed everything before, I find the first time around the all ...
Mark's user avatar
  • 43
0 votes
0 answers
28 views

Advice for developing multiuser enterprise dApp with encrypted data on-chain?

I am exploring the possibility of using Solana to develop an enterprise dApp where-by a single entity would subscribe and pay for the service but allow for multiple user accounts to interact with the ...
P-Rod's user avatar
  • 103
2 votes
1 answer
48 views

Transaction failed to sanitize accounts offsets correctly

I am using Solana Playground to write Solana code.I have written a simple Greeting struct with rust that has a counter field. When I try to interact with the contract using typescript I get this error ...
xyzkal's user avatar
  • 31
2 votes
1 answer
71 views

Difference between C and Rust in development Solana

I know C and Rust for Solana development. Difference between C and Rust in development Solana? When should we use C or Rust.
RichardPhan's user avatar
0 votes
0 answers
14 views

Is it not possible to verify NFT collections with the set_and_verify_collection function in the current version?

Please understand that the meaning may not be conveyed properly due to the use of Google Translator. To get straight to the point, we are trying to verify the collection set using the ...
StarPJ's user avatar
  • 21
1 vote
1 answer
30 views

Program log: AnchorError occurred. Error Code: InstructionFallbackNotFound. Error Number: 101. Error Message: Fallback functions are not supported

I'm trying to interact with an smart contract to borrow SOL as a flash loan. I'm getting this error: Failed to send transaction: ClientError { request: Some(SendTransaction), kind: RpcError(...
Culebrilio's user avatar
1 vote
1 answer
44 views

Error:Deploying program failed transaction simulation failed: Error processing Instruction 0: account data too small for instruction [3 log messages]

Getting this error white deploying the program on devnet using anchor deploy. I am writing the program for minting the tokens:- Recover the intermediate account's ephemeral keypair file with solana-...
Aditya's user avatar
  • 157
1 vote
1 answer
19 views

How to use spl_token account with solana-program-test crate?

I am trying to write a test with the solana-program-test crate for a solana program. This program makes a CPI to a token program: let ix = Instruction { program_id: *token_program.key, ...
S.Rivas's user avatar
  • 11
0 votes
3 answers
73 views

Error Deploying Solana Nodes on OVH Machines: QUIC Connection Timed Out

I've been deploying 2 solana nodes (1 RPC and 1 Validator) on OVH machines, but I've encountered the following error: 2024-05-14T11:06:39.244108182Z WARN solana_perf] CUDA is disabled [2024-05-14T11:...
dariusjvc's user avatar
0 votes
1 answer
23 views

Resolve error i want to import " instruction as token_instruction,"

use anchor_lang::prelude::; use { anchor_lang::{ prelude::, solana_program::program::invoke, system_program, }, anchor_spl::{ associated_token, token, }, mpl_token_metadata::{ ID as TOKEN_METADATA_ID, ...
Usama Khalid's user avatar
0 votes
0 answers
9 views

How to verify the signature in anchor that i created using nacl in js

use anchor_lang::prelude::*; use ed25519_dalek::{ Signature, PublicKey, Verifier }; declare_id!("bHPU6ehyAy6ywvVkmVwV1XUx4DQzymwL4DoqYcgYnuK"); #[program] pub mod demo { use super::*; ...
Nishant Shah's user avatar
0 votes
1 answer
14 views

in tweetnacl-rust Is there a way to Verify(detached_verify) signature on contract side in rust?

i saw TweetNacl-js library in Solana-Coookbook and if i want to sign signature in client side and sign the transaction and send it to solana smart contract. Is there a way? if i consider to use ...
Tushar Sharma's user avatar
4 votes
0 answers
119 views

Error: Reached maximum depth for account resolution

I have a instruction create_like, on calling it from the client I get the following error Error: Reached maximum depth for account resolution Code For the instruction - use anchor_lang::{prelude::...
Yash Patil's user avatar
0 votes
0 answers
28 views

How there are transactions that are immediately being confirmed/proceed?

I have made bot on NodeJS and also on Rust that they both are doing the same, Tried both with the nodes that are considered the best at the market that first block guys are using. The bots are ...
Daniel Kotlarov's user avatar
0 votes
0 answers
7 views

Solidity ZombiCrypto like game on Solana with anchor - zombie owership

I'm learning Solana and as a first project I'm trying to rewrite cryptozombie smart contract in Anchor. Thats what I came up so far use anchor_lang::prelude::*; use anchor_lang::solana_program::clock::...
Arek S's user avatar
  • 101
0 votes
0 answers
13 views

Is there any other way to store the merkle tree as global variables are not recommended in solana like static?

use { borsh::{BorshDeserialize, BorshSerialize}, merkletreers::{tree::MerkleTree, utils::hash_it}, solana_program::{entrypoint::ProgramResult, msg, program_error::ProgramError,}, }; #[...
Aditya's user avatar
  • 157
0 votes
0 answers
26 views

Here i am not able to access the tree in native rust. It shows symbol name is longer than 16 bytes

Here in processor in instruction pre_sale i want to use Tree struct from whitelist. but this error comes Error: ELF error: ELF error: Failed to parse ELF file: Section or symbol name .bss._ZN3ico12in ...
Aditya's user avatar
  • 157
1 vote
1 answer
25 views

Here i want to serialize and deserialize the Tree struct but the not able to do

This error comes in the picture :- the trait bound MerkleTree: BorshSerialize is not satisfied the following other types implement trait BorshSerialize: bool i8 i16 i32 i64 i128 usize u8 and 110 ...
Aditya's user avatar
  • 157
0 votes
1 answer
96 views

Comparing Performance: Python/JavaScript vs. Rust for Solana API Interaction

I am exploring the performance differences between Python/JavaScript and Rust when interacting with the Solana blockchain. I understand that Rust, being a low-level language without a garbage ...
Nerevaine's user avatar
  • 159
0 votes
0 answers
12 views

I want to use tree struct in presale instructions. But it takes more memory than 16 bytes please suggest a way to access Tree Struct form white list

Whitelist :- use { borsh::{BorshDeserialize, BorshSerialize}, merkletreers::{tree::MerkleTree, utils::hash_it}, solana_program::{entrypoint::ProgramResult, msg, program_error::ProgramError}...
Aditya's user avatar
  • 157

1
2 3 4 5
10