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);
itemsForSale[id].seller.transfer(msg.value);
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