Lazy mint possible in ERC721? or IERC721?

Hi, I want to ask in CLONING RARIBLE series. This is the code to buy the item, and send item along with the payment from the Owner.

 function buyItem(uint256 id) payable external ItemExists(id) IsForSale(id) HasTransferApproval(itemsForSale[id].tokenAddress, itemsForSale[id].tokenId){
        require(msg.value >= itemsForSale[id].askingPrice, "Insufficient Funds");
        require(msg.sender != itemsForSale[id].seller);

        itemsForSale[id].isSold = true; 
        activeItems[itemsForSale[id].tokenAddress][itemsForSale[id].tokenId] == false;
        IERC721(itemsForSale[id].tokenAddress).safeTransferFrom(itemsForSale[id].seller, msg.sender, itemsForSale[id].tokenId);

        emit itemSold(id, msg.sender, itemsForSale[id].askingPrice);

I want to do a lazy minting. When they click the INSTANT buy, it will thenmint and send payment to the wallet address of us. Will that be possible with ERC721or I need to copy the function buyItem from IERC721

It should be possible to buy it with your address if you want, but you’ll have to handle it somehow server side in order to sign the transaction.
I had the impression that this isn’t the same thing as how opensea does it for lazy minting, I assumed that opensea saves the information in an internal db until someone transfers or buys that NFT and no interaction is done with the main blockchain until that moment.

1 Like