Skip to main content

Questions tagged [smart-contract]

The tag has no usage guidance, but it has a tag wiki.

Filter by
Sorted by
Tagged with
0 votes
1 answer
15 views

How can I know the mint address of NFT of candy machine?

I am preparing a project of NFT. I am going to give rewards to owner of my NFTs so I need to make smart contract for that. But my NFTs are in Candy Machine so it has not minted yet. How can I know the ...
1 vote
2 answers
399 views

How would you go about cloning Pump.fun smart contracts?

I want to make a pump.fun clone, how would I go about rewriting the smart contracts that pump.fun uses, ie the token minting, bonding curve, adding and removing liquidity etc. How would I go about ...
1 vote
1 answer
31 views

anchor_lang::Owner` is not implemented for `anchor_spl::token_interface::Mint

use anchor_lang::prelude::*; use anchor_spl::token::Token; use anchor_spl::token_interface::Mint; declare_id!("FtUL5xL7oZasB5zaDUETbeHs9jcf9gopQD3Z1V92YyKv"); pub mod constants { pub ...
2 votes
1 answer
48 views

Unable to deploy solana smart contract on mainnet

Deploying the solana smart contract on devnet works well, but if I try to deploy the smart contract on mainnet it doesnt work. I got this error so many times. I tried it with so many solana versions. ...
1 vote
1 answer
78 views

Solana - Rust, Error Number: 4100 - The declared program id does not match the actual program id

I have this simple smart contract in Rust for Solana. When I run the tests, I encounter this error as if the wrong program_id was inserted. Can you tell me what I’m doing wrong? Thanks The encountered ...
0 votes
1 answer
69 views

Make build fail due to typedef redefinition with different types

I was trying build this example https://github.com/solana-labs/solana-program-library/tree/master/examples/c I was trying build it using make and i am facing this error error: typedef redefinition ...
0 votes
0 answers
11 views

What’s the best way to ensure player hand privacy in a Solana card game DApp?

I'm working on a Solana DApp for a card game where protecting player hand privacy is essential. I've come across Multi-Party Computation (MPC) and Zero-Knowledge Proofs (ZKP) as potential solutions. ...
0 votes
0 answers
25 views

how calculate the discriminator by the struct to resolve the command in the anchor project?

i got the discriminator by the command : anchor build. but i wonder how can i got this discriminator without the command. i search the source code and it use ${namespace}:${context} and hash-sha256. ...
0 votes
2 answers
49 views

How to create a mapping on solana using PDA?

What's the solidity equivalent to implement a mapping(address => bool) in anchor for solana? I figured out the way to go is PDA, but I was only able to figure out how to generate a PDA using ...
0 votes
0 answers
9 views

Sudenly Error "Already Initialized" when invoke Mint New Edition from Master Edition Via Token in cpi mpl token metadata

im try to create nft with print from master edition, previously my contract its working for 3months, but now I often encounter this error sudenly, this error say "Already initialized" when ...
1 vote
0 answers
11 views

Introducing typified addresses to avoid sending funds to void

I have sent SOL to a contract address by mistake thinking that I was buying the token, that caused me to loss all the SOL. After few days of investigation I end up to know that this did happen to many ...
0 votes
0 answers
62 views

ambiguity inside solana's GetAccountInfo rpc

I'm confused while using rpc getAccountInfo because the value of the answer will always be null when the Solana balance is 0. This happens even when the address is new and the account has multiple ...
4 votes
1 answer
146 views

Handle big vector containing ton of structs

I'm looking for a way to handle a big struct. I want to understand how to create an account storing more than 10_000 structs inside is possible. Is there a simple way to do it? Or should I have to ...
0 votes
1 answer
96 views

How to create meme coin with some conditions on solana without cli

I want to create a meme coin on solana without cli and wanna use a smart contract to develop the meme coin and implement some conditions for example , no one can own more than 1% of the liquidity pool ...
1 vote
0 answers
137 views

anchor-spl v0.30.1 solana-spl 1.18.17 error[E0308]: mismatched types

I'm building solana smart contract with anchor. anchor version is 0.30.1 solana-cli version is 1.18.17 first time, I built and deploy smart contract without any issue. But after I add this two lines, ...
1 vote
1 answer
137 views

how do I use the anza-xyz/wallet-adapter with my create-react-app?

currently I have a css/react.js widget made in C:\Users\Keola\Desktop\MyToken-ICOWidget\Project\React-Widget\ico_widget which looks like this: (so far) I want to tie in the wallet adapter to the ...
1 vote
1 answer
103 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 { ...
0 votes
0 answers
96 views

I cant use my sol in my wallet

There’s a smart contract in the wallet to send any funds out of the wallet , I asked a different dev to do it for me because the wallet was compromised , what I can do boys? I cant send my sol it's ...
2 votes
1 answer
42 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 ...
0 votes
1 answer
41 views

Can users pass Dummy State Accounts in Solana Program?

I'm working with a Solana program and I have the following code: #[derive(Accounts)] pub struct SomeStruct<'info> { #[account()] pub state: Account<'info, State>, .... } I'm ...
0 votes
0 answers
68 views

Can't deploy a smart contract: cli 'solana program show --programs' returns nulls

For those who've been following this, I been dealing with ISSUES trying to make a solana-token ICO widget, basically I finally got around both the, error: package `solana-program v1.18.2` cannot be ...
1 vote
0 answers
34 views

Solana Smart contract automatic audit tool

I used soteria before to audit solana programs. But it was not updated and does not support latest anchor versions. If anyone knows automatic audit tool, hope to share your experience and knowledge ...
0 votes
0 answers
220 views

What does isMutable : 0/1 mean?

I always see this on solana smart contract's Metadata & I know for a fact that 0 means FALSE, and 1 is TRUE as i've researched regarding this question, the owner can alter changes/settings if its ...
1 vote
1 answer
30 views

How is the keypair for every contract generated?

When we build a smart contract e.g., program-examples/basics/hello-solana there are two files in the target/so directory hello_solana_program-keypair.json hello_solana_program.so How is the ...
0 votes
0 answers
30 views

Is this possible or ChatGPT is telling me rubbish

Ability to mint after mint authority is gone. Design the Emergency Minting Logic: Define the conditions under which emergency minting should be triggered. This could include scenarios such as the burn ...
0 votes
1 answer
306 views

Solana Rust - Failed to serialize or deserialize account data: Unknown

I am creating simple contract for storing ipfs hashes (see in attachment). When trying to call instruction 1 (AddIpfsHash) from python via solana-py and solders I get following error: "...
0 votes
1 answer
145 views

How to access SPL token data in our Solana smart contract

I have created SPL token. I want to access this token data in my rust smart contract so that I can get information about which user has how many tokens? How can I do that?
2 votes
1 answer
108 views

Signer issues with anchor tests

i'm getting a weird signer error when running my tests; Error: Signature verification failed. Missing signature for public key [`6jAudYFBbfQS59oPNjYcMkqr9MqBf312T7oP6WSYRjsg`]. In this case, ...
2 votes
2 answers
321 views

Does Solana have a strategy for erasing immoral (and illegal) metadata?

For instance, if someone uploaded (FBI level) bad (immoral, illegal, etc.) stuff into the metadata of an NFT, are there any moderation pools that are capable of erasing the metadata? Or is that ...
3 votes
1 answer
226 views

Sol contract analysis

Hey I come from ethereum. Im conducting contract audits for adding new tokens to our platform. I can't seem to find the source code for a lot of these SPLs and token2022. like on ethscan the contract ...