简体   繁体   中英

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. 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.

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.

So you want your user to sign a mint transaction request through you dApp to then be able to mint an 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. I'm not sure what you are looking for is feasible, to be honest.

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

"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM