简体   繁体   中英

Approval system for each minting in smart contract

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

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

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