<p><span style="font-size: 11pt; color: #000000;">Non-fungible tokens (NFTs) are quite popular. They are cryptographic assets on a blockchain and NFTs have unique identification codes that distinguish them from each other. NFTs represent real-world objects such as art, in-game items, music, etc. NFTs are bought and sold online and have the same underlying software as cryptos.</span></p>
<p><span style="font-size: 11pt; color: #000000;">In 2021, the market for NFTs was <span style="color: #e67e23;"><a style="color: #e67e23;" title="$41 billion" href="https://markets.businessinsider.com/news/currencies/nft-market-41-billion-nearing-fine-art-market-size-2022-1" target="_blank" rel="nofollow,noopener">$41 billion</a></span>, which is impressive! NFTs can&rsquo;t be exchanged or traded at equivalency. For instance, if you give 1 bitcoin to someone and take 1 from him, you still have 1 bitcoin of the same value, but that&rsquo;s not the case with NFTs, each NFT is unique. <span style="color: #e67e23;"><a style="color: #e67e23;" title="NFT marketplace development services" href="../../nft-development-services">NFT marketplace development services</a></span> are provided by many companies, which helps in increasing the popularity of NFTs.&nbsp;</span></p>
<p><span style="font-size: 11pt; color: #000000;">NFTs have many use cases; they can digitally represent real estate and artwork. The great thing about NFTs is that they are based on blockchains, and can remove intermediaries, therefore helping artists to connect with the audience.&nbsp;</span></p>
<h2>&nbsp;</h2>
<h2><span style="font-size: 18pt;">How Do NFTs Work?&nbsp;</span></h2>
<p>&nbsp;</p>
<p><span style="font-size: 18pt;"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://mooglelabs165918662.files.wordpress.com/2022/07/5394659.jpg" alt="How Do NFTs Work? " width="500" height="400" /></span></p>
<p>&nbsp;</p>
<p><span style="color: #000000;"><span style="font-size: 11pt;">NFTs exist on blockchain; <span style="color: #e67e23;"><a style="color: #e67e23;" title="blockchain services" href="../../blockchain-services">blockchain services</a></span> is a distributed public ledger that records transactions made in cryptocurrencies. Typically, NFTs are held on Ethereum blockchain. Tangible and intangible items represented on NFTs are:&nbsp;</span></span></p>
<ul>
<li><span style="color: #000000;"><span style="font-size: 11pt;">Music&nbsp;</span><span style="font-size: 11pt;"><br /></span></span></li>
<li><span style="color: #000000;"><span style="font-size: 11pt;">Graphic Art&nbsp;</span><span style="font-size: 11pt;"><br /></span></span></li>
<li><span style="color: #000000;"><span style="font-size: 11pt;">Virtual Avatars and Video Game Skins&nbsp;</span><span style="font-size: 11pt;"><br /></span></span></li>
<li><span style="color: #000000;"><span style="font-size: 11pt;">Designer Sneakers&nbsp;</span><span style="font-size: 11pt;"><br /></span></span></li>
<li><span style="color: #000000;"><span style="font-size: 11pt;">GIFs&nbsp;</span><span style="font-size: 11pt;"><br /></span></span></li>
<li><span style="font-size: 11pt; color: #000000;">Collectibles, etc.&nbsp;</span></li>
</ul>
<p><span style="color: #000000;"><span style="font-size: 11pt;">Do you know even tweets count? The co-founder of Twitter, Jack Dorsey sold his first-ever tweet as an NFT at $2,915,835.47. The tweet was first posted by Dorsey on March 21, 2006. Tech entrepreneur Justin Sun and Bridge Oracle CEO Sina Estavi had a bidding war over the NFT of Dorsey&rsquo;s tweet, ultimately, Estavi won by bidding over $2.9 million.&nbsp;</span></span></p>
<p><span style="font-size: 11pt; color: #000000;">NFTs are physical collector&rsquo;s items, the only difference is that they are digital. The buyer gets a digital file and exclusive ownership rights. They can have only one owner at a time and blockchain makes it easy to verify ownership.&nbsp;</span></p>
<h2>&nbsp;</h2>
<h2><span style="font-size: 18pt;">Uses of NFTs&nbsp;</span></h2>
<p><span style="font-size: 14.6667px; color: #000000;">NFTs and blockchain provide content creators and artists to monetize their work. Artists, without relying on galleries can sell their art directly to consumers as an NFT, hence they can keep more profits. Art is not the only way one can make money with NFTs, Taco Bell and Charmin have auctioned off themed NFT art to raise money for charity. A 2011 GIF of a cat, called Nyan Cat sold for nearly <span style="color: #e67e23;"><a style="color: #e67e23;" title="$600,000" href="https://www.nytimes.com/2021/02/22/business/nft-nba-top-shot-crypto.html" target="_blank" rel="nofollow,noopener">$600,000</a></span>.&nbsp;</span></p>
<h2>&nbsp;</h2>
<h2><span style="font-size: 18pt;">The Importance of NFTs&nbsp;</span></h2>
<p><span style="font-size: 14.6667px; color: #000000;">NFTs are an evolution of the concept of cryptocurrencies. Today&rsquo;s finance systems have loan and trading systems for different assets; on the other hand, NFTs are a step forward by providing digital representation of physical assets. NFTs, when combined with the advantages of tamper-resistant blockchain of smart contracts, is a great force for change. <span style="color: #e67e23;"><a style="color: #e67e23;" title="Market efficiency" href="https://www.investopedia.com/terms/m/marketefficiency.asp" target="_blank" rel="nofollow,noopener">Market efficiency</a></span> is one of the most well-known benefits of NFTs. Identity management is one aspect that NFTs are excellent in. For instance, physical passports need to be produced at every entry and exit. When passports are converted into NFTs, it&rsquo;s possible to streamline the entry and exit processes for jurisdictions. Expanding the use case, NFTs can be used for the purpose of identity management within the digital realm also.&nbsp;</span></p>
<h2>&nbsp;</h2>
<h2><span style="font-size: 18pt;">NFTs: Real and Virtual World&nbsp;</span></h2>
<p><span style="color: #000000;"><span style="font-size: 14.6667px;">NFTs can be used in the real and digital world. It can fractionalize physical assets, such as real estate and makes it easier to divide the digital real estate among several users. It&rsquo;s not constrained to real estate; it can extend to artwork as well. A digital paginating need not have a single owner; it can have multiple owners with each owner responsible for a fraction of the painting.&nbsp;&nbsp;</span></span></p>
<p><span style="font-size: 14.6667px; color: #000000;">NFTs can help in creating new markets and different forms of investment.; there is a drastic increase in <a title="NFT marketplace development companies" href="../../"><span style="color: #e67e23;">NFT marketplace development companies</span></a>. NFTs are readily used in gaming. The gaming industry is huge and while hundreds of billions are generated in games, players get little lasting value. They invest in expensive gaming consoles, and they have to spend money to access in-game content and other exclusive features. Blockchain-enabled games focus on generating value for players. It allows players to better capture the value of assets acquired. For instance, in traditional games, when a player purchases an armor, he can utilize it in that game only. However, a gaming ecosystem that utilizes cross-platform NFTs, the player can use the same armor in other games that support cross-platform NFTs. Since NFTs are unique and possess value beyond the game in which they originated, players are in for a treat.&nbsp;</span></p>
<h2>&nbsp;</h2>
<h2><span style="color: #000000;"><span style="font-size: 18pt;">Features of NFTs&nbsp;</span></span></h2>
<p><span style="color: #000000;"><span style="font-size: 14.6667px;">There are three distinct characteristics of NFTs:&nbsp;</span></span></p>
<h3><strong><span style="color: #000000;"><span style="font-size: 12pt;">Non-fungibility&nbsp;</span></span></strong></h3>
<p><span style="color: #000000;"><span style="font-size: 14.6667px;">Each NFT is unique; it&rsquo;s not interchangeable with another NFT. The metadata inside every NFT is permanent and remains unaltered on the blockchain; the record describes what the token represents, its ownership history and transaction record.&nbsp;</span></span></p>
<h3><strong><span style="color: #000000;"><span style="font-size: 12pt;">Rarity&nbsp;</span></span></strong></h3>
<p><span style="color: #000000;"><span style="font-size: 14.6667px;">The scarcity of each NFT is an important component and makes them desirable. The <a style="color: #000000;" title="Cryptokitties game" href="https://www.gemini.com/cryptopedia/cryptokitties-nft-crypto-ethereum-token" target="_blank" rel="nofollow,noopener">Cryptokitties game</a> allows users to collect and breed digital cats and are designated NFT. Some of these are considered rare collectibles, and are expensive. In 2018, Dragon cryptokitty was sold for 600ETH, which was equivalent to $170k.&nbsp;</span></span></p>
<h3><strong><span style="color: #000000;"><span style="font-size: 12pt;">Indivisibility&nbsp;</span></span></strong></h3>
<p><span style="font-size: 14.6667px; color: #000000;">NFTs are bought, sold, and held as a whole unit, which means they are indivisible. Cryptocurrencies are divisible into smaller units as they are fungible, but that&rsquo;s not the case with NFTs.&nbsp;</span></p>
<h2>&nbsp;</h2>
<h2><span style="font-size: 18pt; color: #000000;">Benefits of NFTs&nbsp;</span></h2>
<p><span style="font-size: 18pt;"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://mooglelabs165918662.files.wordpress.com/2022/07/benefits-of-nfts-1.png" alt="Benefits of NFTs " width="600" height="350" /></span></p>
<p>&nbsp;</p>
<p><span style="font-size: 11pt; color: #000000;">Some of the best benefits of NFTs are:&nbsp;</span></p>
<h3><strong><span style="font-size: 12pt;">Authenticity&nbsp;</span></strong></h3>
<p><span style="font-size: 11pt; color: #000000;">NFTs are unique, they are created on the blockchain and have unique records on them. The authenticity of NFTs makes them reliable. Immutability of the blockchain on which they are stored acts as an assurance of authenticity.&nbsp;</span></p>
<h3><strong><span style="font-size: 12pt;">Transferability&nbsp;</span></strong></h3>
<p><span style="font-size: 11pt; color: #000000;">There are a range of options for trading NFTs, and they can be traded freely on particular markets. Games issue in-game items to improve the gaming experience of players, but they can&rsquo;t use them anywhere else. Also, when the game goes out of fashion, players lose their in-game collectibles. In the case of NFTs, players can hold in-game items in their digital wallets. Players can use them outside the game and can even sell them to earn profit.&nbsp;</span></p>
<h3><span style="font-size: 12pt;"><strong>Economic Opportunity</strong>&nbsp;</span></h3>
<p><span style="font-size: 11pt; color: #000000;">NFTs have wide-ranging applications in the digital content domain as well. Content creators often face issues such as other platforms copying their work and earning profit from it. NFTs can lead to the development of a completely new creator economy. The ownership of the content is integrated into the content only, which means funds go directly to the owner when the creator sells the content.&nbsp;</span></p>
<h3><strong><span style="font-size: 12pt;">Inclusive Growth&nbsp;</span></strong></h3>
<p><span style="font-size: 11pt; color: #000000;">NFTs support inclusive growth. They bring content creators from diverse fields into one ecosystem. It facilitates inclusive growth. Buyers and sellers can directly interact with each other, and buyers have the option of liquidity in different assets with NFTs. Royalty rewards are another huge benefit of NFTs; by setting up smart contracts while developing NFTs, the original creator can receive royalties for each re-sale. With the increase in the popularity of NFTs, there is an increase in NFT marketplace development.&nbsp;</span></p>
<h2>&nbsp;</h2>
<h2><span style="font-size: 18pt;">How to Buy NFTs?&nbsp;</span></h2>
<p><span style="font-size: 14.6667px; color: #000000;">If you wish to start your NFT collection, you first need a digital wallet in which you can store NFTs. Most likely, you will need to purchase some cryptocurrency; ensure to check which cryptocurrency your NFT provider accepts. You can utilize platforms like Coinbase, eToro, and Kraken to buy cryptocurrency using your debit card. Check the fees of all these platforms; most of them charge a percentage of your transaction.&nbsp;</span></p>
<h2>&nbsp;</h2>
<h2><span style="font-size: 18pt;">NFT Marketplaces&nbsp;</span></h2>
<p><span style="font-size: 14.6667px; color: #000000;">After setting up your wallet, you can explore NFT sites to shop. Some of the popular NFT marketplaces are:&nbsp;</span></p>
<p><span style="font-size: 14.6667px; color: #000000;"><span style="color: #e67e23;"><a style="color: #e67e23;" title="Opensea.io" href="https://opensea.io/" target="_blank" rel="nofollow,noopener">Opensea.io</a></span>: To get started, you need to create an account, and then you can browse NFT collections.&nbsp;</span></p>
<p><span style="font-size: 14.6667px; color: #000000;"><span style="color: #e67e23;"><a style="color: #e67e23;" title="Rarible" href="https://rarible.com/" target="_blank" rel="nofollow,noopener">Rarible</a></span>: It&rsquo;s an open marketplace where artists can issue and sell NFTs. It is one of the most popular NFT marketplaces out there.&nbsp;</span></p>
<p><span style="font-size: 14.6667px; color: #000000;"><span style="color: #e67e23;"><a style="color: #e67e23;" title="Foundation" href="https://foundation.app/" target="_blank" rel="nofollow,noopener">Foundation</a></span>: Foundation is different from OpenSea and Rarible as here, artists need to receive upvotes or an invitation from fellow creators; only then they can post their art. It&rsquo;s an exclusive community and has a cost of entry; artists have to purchase &ldquo;gas&rdquo; to mint NFTs. Nyan Cat was sold on the foundation platform by its creator Chris Torres.&nbsp;</span></p>
<p><span style="font-size: 14.6667px; color: #000000;">It&rsquo;s advised to do your research before buying to save yourself from any scam.&nbsp;</span></p>
<h2>&nbsp;</h2>
<h2><span style="font-size: 18pt;">Should You Invest in NFTs?&nbsp;</span></h2>
<p><span style="font-size: 14.6667px; color: #000000;">NFTs are a hot trend, but they are risky as they are new, and we don&rsquo;t have history to judge their performance. One can invest small amounts to try them out. Since the value of NFT is based on what someone else is willing to pay, the demand for NFTs drives the price and not economic and technical indicators.&nbsp;</span></p>
<h2><span style="font-size: 18pt;">&nbsp;</span></h2>
<h2><span style="font-size: 18pt;">Prerequisite to generate the NFT&rsquo;s in Node JS</span></h2>
<ul>
<li><span style="font-size: 14.6667px; color: #000000;">NodeJs&nbsp; &gt; 12 version</span></li>
<li><span style="font-size: 14.6667px; color: #000000;">Truffle or Hardhat&nbsp; (for this tutorial will use truffle)</span></li>
<li><span style="font-size: 14.6667px; color: #000000;">SmartContract (ERC-20,ERC-721)</span></li>
<li><span style="font-size: 14.6667px; color: #000000;">Ganache (check&nbsp; the block data of transactions)</span></li>
<li><span style="font-size: 14.6667px; color: #000000;">Infura (Create a account for dApps) with Ropston</span></li>
<li><span style="font-size: 14.6667px; color: #000000;">MetaMask (wallet)</span></li>
</ul>
<p><span style="font-size: 11pt; color: #000000;">Above are some requirements to minting the NFT&rsquo;s for marketplace. Firstly, we start with creating the infura account using the link - <span style="color: #e67e23;"><a style="color: #e67e23;" title="https://infura.io" href="https://infura.io" target="_blank" rel="nofollow,noopener">https://infura.io</a></span></span></p>
<p>&nbsp;</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="https://mooglelabs165918662.files.wordpress.com/2022/07/picture-1.png" alt="NFT&rsquo;s for marketplace" width="800" height="399" /></p>
<p>&nbsp;</p>
<p><span style="font-size: 11pt; color: #000000;">Proceed with Create a new Project with your choice name and follow the option by select the Ethereum option with kovan network, the project id and project secret will be generated for further use. Now we done with our testing network. If you want there should be other option like Rinkeby and Ropsten.&nbsp;&nbsp;</span></p>
<p><span style="font-size: 11pt; color: #000000;">Now Moving forward, we need a wallet which should interact with the previous created network, Metamask is the wallet that you should you and install the extension for your browser. Goto this link <a style="color: #000000;" title="https://metamask.io" href="https://metamask.io" target="_blank" rel="nofollow,noopener"><span style="color: #e67e23;">https://metamask.io</span></a> and install the meta mask with signup project.&nbsp; Here metamask will provide the secret aplhabet key. That should be the secret key for your wallet, note one thing don&rsquo;t share that key with any one and password that you have created. If you will lost, your control on wallet should be&nbsp;&nbsp;</span></p>
<p>&nbsp;</p>
<p><span style="font-size: 11pt; color: #000000;"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://mooglelabs165918662.files.wordpress.com/2022/07/metamask.png" alt="MetaMask" width="800" height="399" /></span></p>
<p>&nbsp;</p>
<p><span style="font-size: 11pt; color: #000000;">gone, so save these value somewhere for your ease.&nbsp; After signup install the Meta mask in browser</span></p>
<p>&nbsp;</p>
<p><span style="font-size: 11pt; color: #000000;"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://mooglelabs165918662.files.wordpress.com/2022/07/metamask-signup.png" alt="MetaMask SignUp" width="800" height="449" /></span></p>
<p>&nbsp;</p>
<p><span style="font-size: 11pt; color: #000000;">Let's add Optimistic Ropsten to your list of available networks to your MetaMask wallet. To do so, open up the MetaMask extension, click on the network, and then click Add Network. Then, fill out the network properties (you can copy your Infura idf from your Infura project):</span></p>
<ul>
<li><span style="font-size: 11pt; color: #000000;">&nbsp; &nbsp; Network Name: Ropston</span></li>
<li><span style="font-size: 11pt; color: #000000;">&nbsp; &nbsp; New RPC URL: <a title="https://ropsten.infura.io/v3/INFURA_PROJECT_ID&nbsp;" href="https://ropsten.infura.io/v3/INFURA_PROJECT_ID" target="_blank" rel="nofollow,noopener">https://ropsten.infura.io/v3/INFURA_PROJECT_ID&nbsp;</a></span></li>
<li><span style="font-size: 11pt; color: #000000;">&nbsp; &nbsp; Network ID: 3</span></li>
<li><span style="font-size: 11pt; color: #000000;">&nbsp; &nbsp; Currency Symbol: ETH&nbsp;</span></li>
<li><span style="font-size: 11pt; color: #000000;">&nbsp; &nbsp; Block Explorer URL: <a title="https://ropsten.etherscan.io/" href="https://ropsten.etherscan.io/" target="_blank" rel="nofollow,noopener">https://ropsten.etherscan.io/</a></span></li>
</ul>
<p><span style="font-size: 11pt; color: #000000;">After done all the steps we are moving with code base on local machine.&nbsp; Create a directory with name sever or any name you will like.&nbsp; Before that make sure the node and npm installed on the system.&nbsp; Check through terminal by type these commands.&nbsp;</span></p>
<ul>
<li><span style="font-size: 11pt; color: #000000;">node -v</span></li>
<li><span style="font-size: 11pt; color: #000000;">npm -v&nbsp;</span></li>
<li><span style="font-size: 11pt; color: #000000;">cd&nbsp; server&nbsp; &nbsp;press enter</span></li>
<li><span style="font-size: 11pt; color: #000000;">npm init&nbsp; (it will create the json file with basic structure in directory and initiate project)&nbsp;</span></li>
<li><span style="font-size: 11pt; color: #000000;">npm install -g truffle (to install truffle with help of which create smart contract and deploy in blockchain network.&nbsp;</span></li>
<li><span style="font-size: 11pt; color: #000000;">truffle init&nbsp; (this is the default command for set up the project for truffle)</span></li>
<li><span style="font-size: 11pt; color: #000000;">npm i dotenv (hold the variables for app)</span></li>
<li><span style="font-size: 11pt; color: #000000;">npm i @truffle/hdwallet-provider (package to interact with wallet for test net ethereum)</span></li>
<li><span style="font-size: 11pt; color: #000000;">npm install&nbsp; @openzeppelin /contracts</span></li>
<li><span style="font-size: 11pt; color: #000000;">Project structure with files and folder&nbsp;</span></li>
</ul>
<p><span style="font-size: 14.6667px;">├──<span style="color: #000000;"> README.md</span></span></p>
<p><span style="font-size: 14.6667px; color: #000000;">├── client</span></p>
<p><span style="font-size: 14.6667px; color: #000000;">├── contracts</span></p>
<p><span style="font-size: 14.6667px; color: #000000;">├── migrations</span></p>
<p><span style="font-size: 14.6667px; color: #000000;">├── node_modules</span></p>
<p><span style="font-size: 14.6667px; color: #000000;">├── package-lock.json</span></p>
<p><span style="font-size: 14.6667px; color: #000000;">├── package.json</span></p>
<p><span style="font-size: 14.6667px; color: #000000;">├── test</span></p>
<p><span style="font-size: 14.6667px; color: #000000;">├── truffle-config.js</span></p>
<p><span style="font-size: 14.6667px; color: #000000;">└── truffle-config.ovm.js</span></p>
<p><span style="font-size: 11pt; color: #000000;">Now we start with our code work in contracts/ethereum&nbsp; create a new solidity file with name Nftminting.sol&nbsp;</span></p>
<p><span style="font-size: 11pt; color: #000000;"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://mooglelabs165918662.files.wordpress.com/2022/07/nftminting.sol_.png" alt="Nftminting.sol " width="800" height="450" /></span></p>
<p>&nbsp;</p>
<p><span style="font-size: 14.6667px; color: #000000;">In the above code first we have import the ECR721 standard packages and extend in file to achieve the standarize token.</span></p>
<p><span style="font-size: 14.6667px; color: #000000;">import "@openzeppelin/contracts/token/ERC721/ERC721.sol";</span></p>
<p><span style="font-size: 14.6667px; color: #000000;">import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";</span></p>
<p><span style="font-size: 14.6667px; color: #000000;">import "@openzeppelin/contracts/utils/Counters.sol";</span></p>
<p>&nbsp;</p>
<p><strong><span style="font-size: 14.6667px; color: #000000;">Another Marketplace.sol Smart contract Code is given below:</span></strong></p>
<p><code><code></code></code></p>
<pre>// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

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

contract Marketplace is ReentrancyGuard {
using Counters for Counters.Counter;
Counters.Counter private _nftsSold;
Counters.Counter private _nftCount;
uint256 public LISTING_FEE = 0.0001 ether;
address payable private _marketOwner;
mapping(uint256 =&gt; NFT) private _idToNFT;
struct NFT {
address nftContract;
uint256 tokenId;
address payable seller;
address payable owner;
uint256 price;
bool listed;
}
event NFTListed(
address nftContract,
uint256 tokenId,
address seller,
address owner,
uint256 price
);
event NFTSold(
address nftContract,

uint256 tokenId,
address seller,
address owner,
uint256 price
);

constructor() {
_marketOwner = payable(msg.sender);
}

// List the NFT on the marketplace
function listNft(address _nftContract, uint256 _tokenId, uint256 _price) public payable nonReentrant {
require(_price &gt; 0, "Price must be at least 1 wei");
require(msg.value == LISTING_FEE, "Not enough ether for listing fee");

IERC721(_nftContract).transferFrom(msg.sender, address(this), _tokenId);

_nftCount.increment();

_idToNFT[_tokenId] = NFT(
_nftContract,
_tokenId, 
payable(msg.sender),
payable(address(this)),
_price,
true
);

emit NFTListed(_nftContract, _tokenId, msg.sender, address(this), _price);
}

// Buy an NFT
function buyNft(address _nftContract, uint256 _tokenId) public payable nonReentrant {
NFT storage nft = _idToNFT[_tokenId];
require(msg.value &gt;= nft.price, "Not enough ether to cover asking price");

address payable buyer = payable(msg.sender);
payable(nft.seller).transfer(msg.value);
IERC721(_nftContract).transferFrom(address(this), buyer, nft.tokenId);
_marketOwner.transfer(LISTING_FEE);
nft.owner = buyer;
nft.listed = false;

_nftsSold.increment();
emit NFTSold(_nftContract, nft.tokenId, nft.seller, buyer, msg.value);
}

// Resell an NFT purchased from the marketplace
function resellNft(address _nftContract, uint256 _tokenId, uint256 _price) public payable nonReentrant {
require(_price &gt; 0, "Price must be at least 1 wei");
require(msg.value == LISTING_FEE, "Not enough ether for listing fee");

IERC721(_nftContract).transferFrom(msg.sender, address(this), _tokenId);

NFT storage nft = _idToNFT[_tokenId];
nft.seller = payable(msg.sender);
nft.owner = payable(address(this));
nft.listed = true;
nft.price = _price;

_nftsSold.decrement();
emit NFTListed(_nftContract, _tokenId, msg.sender, address(this), _price);
}

function getListingFee() public view returns (uint256) {
return LISTING_FEE;
}

function getListedNfts() public view returns (NFT[] memory) {
uint256 nftCount = _nftCount.current();
uint256 unsoldNftsCount = nftCount - _nftsSold.current();

NFT[] memory nfts = new NFT[](unsoldNftsCount);
uint nftsIndex = 0;
for (uint i = 0; i &lt; nftCount; i++) {
if (_idToNFT[i + 1].listed) {
nfts[nftsIndex] = _idToNFT[i + 1];
nftsIndex++;
}
}
return nfts;
}

function getMyNfts() public view returns (NFT[] memory) {
uint nftCount = _nftCount.current();
uint myNftCount = 0;
for (uint i = 0; i &lt; nftCount; i++) {
if (_idToNFT[i + 1].owner == msg.sender) {
myNftCount++;
}
}

NFT[] memory nfts = new NFT[](myNftCount);
uint nftsIndex = 0;
for (uint i = 0; i &lt; nftCount; i++) {
if (_idToNFT[i + 1].owner == msg.sender) {
nfts[nftsIndex] = _idToNFT[i + 1];
nftsIndex++;
}
}
return nfts;
}

function getMyListedNfts() public view returns (NFT[] memory) {
uint nftCount = _nftCount.current();
uint myListedNftCount = 0;
for (uint i = 0; i &lt; nftCount; i++) {
if (_idToNFT[i + 1].seller == msg.sender &amp;&amp; _idToNFT[i + 1].listed) {
myListedNftCount++;
}
}

NFT[] memory nfts = new NFT[](myListedNftCount);
uint nftsIndex = 0;
for (uint i = 0; i &lt; nftCount; i++) {
if (_idToNFT[i + 1].seller == msg.sender &amp;&amp; _idToNFT[i + 1].listed) {
nfts[nftsIndex] = _idToNFT[i + 1];
nftsIndex++;
}
}
return nfts;
}
}
</pre>
<p><span style="font-size: 11pt; color: #000000;">To deploy the Smart Contracts locally, we'll need to modify migrations/1_deploy_contracts.js. Because Nftminting requires the Marketplace contract address, order matters here Truffle allows you to deploy contracts in order using Promise or await/async. (Note that previously, Truffle also required a separate Migrations.sol contract, but that is no longer the case)</span></p>
<p>&nbsp;</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="https://mooglelabs165918662.files.wordpress.com/2022/07/picture-2.png" alt="Migrations.sol contract" width="800" height="450" /></p>
<p>&nbsp;</p>
<p><span style="font-size: 11pt; color: #000000;"><strong>Note :</strong> For this deployment there should be use another contract name Marketplace which should be require to add the NFT feature on ethereum network.&nbsp; Clickhere to access the file</span></p>
<p>&nbsp;</p>
<p><strong><span style="font-size: 11pt; color: #000000;">Now proceeding with Ganache tool -</span></strong></p>
<p>&nbsp;</p>
<p><span style="font-size: 11pt; color: #000000;"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://mooglelabs165918662.files.wordpress.com/2022/07/ganache-tool.png" alt="" width="800" height="450" /></span></p>
<p>&nbsp;</p>
<p><span style="font-size: 14.6667px; color: #000000;">This creates a running Ganache instance at HTTP://127.0.0.1:7545. Now, just run &ldquo;truffle migrate --network development&rdquo; in the CLI from the root folder. This will compile and deploy your contracts.&nbsp;</span></p>
<p><span style="font-size: 14.6667px; color: #000000;">After the successfull compilation and deployment receive the address for both contract.&nbsp;</span></p>
<p><span style="font-size: 14.6667px; color: #000000;">You should be able to find your compiled contracts under ./build/contract receive the specific json files.&nbsp;</span></p>
<h2>&nbsp;</h2>
<h2><span style="font-size: 18pt;">Wrapping Up&nbsp;</span></h2>
<p>&nbsp;</p>
<p><a title="Contact enterprise blockchain consulting company" href="../../contact-us" target="_blank" rel="noopener"><span style="font-size: 18pt;"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://mooglelabs165918662.files.wordpress.com/2022/07/ai-600-c397-90-px-700-c397-90-px.png" alt="Contact enterprise blockchain consulting company" width="700" height="90" /></span></a></p>
<p>&nbsp;</p>
<p><span style="font-size: 11pt; color: #000000;">NFTs have massive popularity, and the blog highlighted various reasons for the fame of NFTs. NFTs are the next big thing when it comes to online commerce. The advantages of NFTs clearly depict the promising selling points for various users. NFTs use cases like the ones mentioned above can shape the virtual reality future where people interact digitally. There is a scope for development when it comes to NFT use cases; not only gamers but regular people can use NFTs in their day-to-day lives, even in <a style="color: #000000;" title="blockchain-powered LMS" href="../../blockchain-application"><span style="color: #e67e23;">blockchain-powered LMS</span></a>. It will help in enhancing transparency when it comes to ownership of physical properties. When it comes to investing in NFTs, approach them as any other investment, do your research, and calculate risks.&nbsp;</span></p>
<p>&nbsp;</p>