简体   繁体   English

如何在不使用市场/交易所的情况下在我的网站上为 sol 出售自定义 spl-token

[英]How to sell custom spl-token for sol on my website without the use of a market/exchange

I have made a custom SPL token and minted it to a wallet.我制作了一个自定义 SPL 代币并将其铸造到钱包中。 I have an X amount of this custom-token minted on my phantom wallet.我在我的幻影钱包上铸造了 X 数量的这种定制代币。

We have a website for the custom-token and we want to launch a presale on our website, user connects wallet and purchase directly from website (its a meme coin).我们有一个自定义令牌的网站,我们希望在我们的网站上启动预售,用户连接钱包并直接从网站购买(它是一个 meme 硬币)。

The process is (user connects wallet, user enters amount of custom-token to buy, sol transferred to our wallet, custom-token transferred from our wallet to user)过程是(用户连接钱包,用户输入要购买的自定义令牌数量,sol转移到我们的钱包,自定义令牌从我们的钱包转移到用户)

How do we go about this?我们该怎么做呢?

Do I have to make my own smart contract for this?我必须为此制定自己的智能合约吗?

Can this be done via web3?这可以通过web3完成吗?

You need some sort of separate smart contract to do the transfers, since you need to have one instruction which moves the user's SOL and your tokens all at once.您需要某种单独的智能合约来进行转移,因为您需要有一条指令可以同时移动用户的 SOL 和您的代币。 With just web3, you won't be able to guarantee these movements.仅使用 web3,您将无法保证这些动作。

You can look at a few options in the Solana Program Library:您可以查看 Solana 程序库中的一些选项:

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何通过“@solana/web3.js”和“@solana/sol-wallet-adapter”传输自定义 SPL 令牌 - How to transfer custom SPL token by '@solana/web3.js' and '@solana/sol-wallet-adapter' 令牌不是从 @solana/spl-token 导入的 - Token is not imported from the @solana/spl-token 如何使用@Solana\web3.js 转移自定义 SPL 代币 (USDC)(金额问题) - How to transfer custom SPL Token (USDC) using @Solana\web3.js (amount issues) Solana,如何使用 javascript/wallets 将 NFT(spl 代币)发送到另一个钱包 - Solana, how to send a NFT (spl token) to another wallet using javascript/wallets 从即将过期的访问令牌中更新(或交换)访问令牌(无管理员用户交互) - Renew (or Exchange )access token (without admin user interaction) from the access token which is about to expire 来自我网站的令牌真实同步 - Token real synchronization from my website 如何在VSTS的网站SetParameters.xml文件中使用包含XML字符串的令牌? - How to use token which contains XML strings in a website SetParameters.xml file on VSTS? 如何使用我自己的自定义令牌系统保护我的 Java Spring 启动 API? - How can I protect my Java Spring Boot API with my own Custom Token System? 如何存储服务器令牌并在我的第二个活动 webview 中使用它? - How to store server TOKEN and use it on my 2nd activity webview? Jmeter 如何仅提取令牌 1 次并将其用于对我的 api 的 do x 请求 - Jmeter how I can extract token only 1 time and use it for do x request to my api
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM