0

I am new to blockchain application development and trying to create a smart contract in ERC 721. Currently, I implement a system with the help of a database where minting is only possible by the owner. In that case, I take the fee from the user and save the transaction hash to the database. If the owner thinks all information is correct then the owner will mint this NFT from the owner's wallet to the user's wallet. But the problem, in this case, is that gas fee has to be paid twice.

As far as I know, minting can be done from that address if the owner approves it beforehand. But I want to do it a little differently. Eg - I wanted to implement an authorization system for each minting. That is, when the user mints an NFT, it will wait for the approval. It will be minted if the owner approves it. Is it really possible?

Any suggestions would be highly appreciated!Thank you

Muhammad Minhaj
  • 109
  • 1
  • 7
  • why do you want to implement this way? – Yilmaz Nov 22 '22 at 18:39
  • Thank you, Yilmaz. I have an NFT builder, where user can create their NFT. Each NFT contains some information that is input by the user. Every time before minting their information needs to be verified. I have verified their information programmatically and have to manually verify it to be sure it is correct. – Muhammad Minhaj Nov 23 '22 at 06:40
  • I was thinking of a whitelisting method but once users are whitelisted they can generate NFTs without verifying their information. Because each NFT will be created with different data. I have already implemented this way in my approach. In that case, the transaction has to be completed twice. Once the user sends the fee to the owner's wallet, the administrator will mint the NFT from the owner's wallet to the user's wallet if the administrator sees fit. I wanted to do this in a smart contract with a transaction. – Muhammad Minhaj Nov 23 '22 at 06:40
  • Note: From the user's point of view, they need to come once to generate NFT. If there is a discrepancy, they will see it directly. Is it possible to pause before minting NFTs via smart contract? – Muhammad Minhaj Nov 23 '22 at 06:40
  • 1
    maybe you could create a timelock functionality. user sends the transaction into a queue for a certain time that you define, or maybe you give option to the user and in that time period admin can check the queued transactions and execute them – Yilmaz Nov 24 '22 at 05:59

1 Answers1

0

I think you could use a whitelist approach

Maybe you could achieve the same user flow by creating a database where each time a user request a mint you store their wallet address.

Then your 721 contract can have a whitelist logic where the owner would add all the "approved" user wallet addreses.

And finally the user will need to interact with your 721 contract to mint their token.

This solution still does not fix the gas being paid twice.

Hope it helps

  • Thanks, I knew about it. But, in my case, the NFT will be built according to the user's given information and then it will request for minting. And before minting his information should be verified by the admin. Then if the admin confirms it will be minted. Basically, I need to verify the information before minting each NFT and from the user's point of view, the NFT minting process should be completed at once, so that the user does not have to go to the website a second time for minting. – Muhammad Minhaj Nov 22 '22 at 08:28
  • Previously I thought as per your suggestion. But in that case, the problem is that if the admin puts the user's wallet address in the whitelist, then the user can build and mint NFT with any wrong information. Where user information cannot be verified. Which can damage the reputation of the company. – Muhammad Minhaj Nov 22 '22 at 08:28
  • My goal is that many people will come to the website and mint their NFTs. Users should not visit the website a second time for minting. They will just send a minting request and it will be minted when the admin does the disparity. – Muhammad Minhaj Nov 22 '22 at 08:28
  • Currently, I have implemented the system. But in that case, the gas fee has to be paid twice due to two transactions. Which I mentioned in my question. if you have any more ideas, feel free to share me, that would be helpful. Thank you – Muhammad Minhaj Nov 22 '22 at 08:28