Implementing lazy mint contract in rarible clone series

pragma solidity ^0.8.0;

import "../node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "../node_modules/@openzeppelin/contracts/utils/Counters.sol";

contract NftiumToken is ERC721 {
    using Counters for Counters.Counter;
    Counters.Counter private _tokenIds;
    constructor() ERC721("NftiumToken","NFTM"){}

    struct Item {
        uint256 id;
        address creator;
        string  uri;

    mapping(uint256 => Item) public Items;

    function createItem(string memory uri) public returns (uint256){
        uint256 newItemId = _tokenIds.current();
        _safeMint(msg.sender, newItemId);

        Items[newItemId] = Item(newItemId, msg.sender, uri);

        return newItemId;

    function tokenURI(uint256 tokenId) public view override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

        return Items[tokenId].uri;



This is my token contract my question is can we add lazy mint contract init and in mint function what we need to change as I am very new to this I don’t know much.
It will be great if anyone helps

for me it looks like this smart contract works from what I tested in remix.
what do you mean by lazy minting in a smart contract?

can we create a mint and transfer function so when the user uploads the asset it will get the upload to IPFS but not get minted when someone buys that it will mint and transfer that to the buyer like open-sea it only designs the contract and when someone buys it get minted and transfer.

This could be something that is done outside the smart contract, and the smart contract createItem function could receive an uri and an itemId that you precompute it at lazy minting time. You will need a way to uniquely generate an itemId outside your smart contract.

ok, I am too new for this can you help with the example function code if possible so everyone can customize as they want or is anyone else interested in this?
it will be great if anyone volantierly contributes for us.