简体   繁体   English

如何仅使用 dApp 限制 NFT 铸造

[英]How to restrict NFT minting using the dApp only

I'm building a dApp using React and node.js which would allow my NFT collection tokens(ERC721) to be minted.我正在使用 React 和 node.js 构建一个 dApp,这将允许我的 NFT 集合令牌(ERC721)被铸造。 I want to restrict so that users can only mint token using my Built dApp and not allowed to mint interacting directly with smart contract.我想限制用户只能使用我的内置 dApp 铸造代币,并且不允许铸造直接与智能合约交互。

I'm aware I need to sign the mint transaction request and verify it in the contract to make sure the mint transaction request was done by the contract owner.我知道我需要签署铸币交易请求并在合同中进行验证,以确保铸币交易请求是由合约所有者完成的。

However I'm unclear how to exactly sign the request in React Dapp and then verify it in the Solidity contract function.但是我不清楚如何在 React Dapp 中准确地签署请求,然后在 Solidity 合约函数中对其进行验证。

So you want your user to sign a mint transaction request through you dApp to then be able to mint an NFT?所以你希望你的用户通过你的 dApp 签署一个铸币交易请求,然后才能铸币 NFT? But if you check that the mint request comes from the contract owner, then only you will be able to mint a new token, is that what you want?但是,如果您检查铸币请求是否来自合约所有者,那么只有您可以铸币,这是您想要的吗? But even if you impose an intermediary mint request before the actual mint, this won't prevent users from making a mint request by interacting directly with the smart contract and not your dApp.但即使你在实际铸币之前强加了中间铸币请求,这也不会阻止用户通过直接与智能合约而不是你的 dApp 交互来发出铸币请求。 I'm not sure what you are looking for is feasible, to be honest.老实说,我不确定您要寻找的东西是否可行。

我不知道这是否可行,但你可以尝试在你的 dApp 中使用一些私钥,并在铸造时将其传递给合约。在合同中,您可以验证该密钥以检查您的 dApp 或其他人是否调用了 mint 函数。确保隐藏该密钥。

"

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

相关问题 铸造 nft 后 NFT 合约余额没有增加 - NFT contract balance not increasing after minting nft Minting dapp 没有连接到手机上的 metamask 应用程序? - Minting dapp does not Connecting to metamask app on mobile? 如何使用 balanceOf() 在合同上创建铸币限制 - How to create a limit in minting using balanceOf() over contract MetaMask - RPC 错误:执行恢复,简单的 NFT 迷你 Dapp - MetaMask - RPC Error: execution reverted, Simple NFT Miniting Dapp 如何将 metamask 连接到 dapp? - How to connect metamask to dapp? 如何使用 web3-react 将 WalletConnect 集成到您的 Dapp 中? - How to integrate WalletConnect in your Dapp using web3-react? 在 Solana devnet Metaplex v1.2.0 candy-machine-ui 上铸造 NFT 时收到错误 - Receiving error when minting NFT on Solana devnet Metaplex v1.2.0 candy-machine-ui 如何限制下拉列表使用角度仅选择一个值? - How to restrict dropdown to choose only one value using angular? 如何限制文本框仅使用javascript接受10个字母字符? - How to restrict a textbox to accept 10 alphabetic characters only using javascript? 如何限制仅使用javascript或jQuery上传视频? - How to restrict only video upload using javascript or Jquery?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM