Create a decentralized and unstoppable NFT marketplace

WP Smart Contracts
9 min readJun 13, 2021

Now you can easily create an NFT Marketplace in Ethereum, Binance Smart Chain, xDai chain and Matic using the WPSmartContracts.com WordPress plugin.

It has been a wild year for NFTs markets.

During the end of 2020 and 2021 the NFT market reached incredible levels of monetization in several areas including art, music, memes, tweets and all kinds of NFTs.

What are NFTs?

NFTs are a blockchain token standard, defined as ERC-721.

NFT stands for non-fungible tokens. An NFT is useful for representing digital or physical assets that cannot be divided, for example: a digital pet, a collectible, property, loans, etc.

NFTs can be securely stored in the blockchain and the “asset” representing the NFT, such as images, documents, videos, etc. can be transferred, sold or auctioned. It can be stored in a decentralized way using services such as InterPlanetary File System, in this way virtually no one can delete these assets safeguarding the rights of the owner.

Matcha NFT Marketplace

Matcha Smart Contract is the new WPSmartContracts flavor for NFT Marketplaces

Matcha is the name of the ERC721 Marketplace Smart Contract, available in WPSmartContracts and can be easily deployed to:

  • Ethereum
  • Binance Smart Chain
  • xDai Chain
  • Polygon (Matic)

In this tutorial we will show you step by step how to implement your NFT Marketplace.

What is WPSmartContracts?

WordPress wouldn’t be WordPress if there wasn’t a plugin for everything, right?

WPSmartContracts is the WordPress plugin to create, deploy and interact with Smart Contracts in Ethereum, Binance Smart Chain, xDai chain and Polygon.

Requirements

To follow this tutorial you will need:

  • A WordPress site
  • WPSmartContracts plugin installed
  • Metamask extension installed in your browser
  • Some funds on any mainnet or blockchain of your choice.

For more information on installation, see the WPSmartContracts documentation.

Settings

In order for your WordPress site to be able to interact with the blockchain and store assets in the IPFS service, you must configure some parameters, the basic ones are as follows:

  • To use IPFS, you must sign up for free storage for the IPFS account at nft.storage. This is a free decentralized storage and bandwidth for NFT providers.
  • If you plan to use the Ethereum network, you will need a PROJECT ID from Infura.

Once you have those keys, you need to configure your plugin.

For more information on settings, see the Settings Documentation.

Don’t fail to plan

Before deploying a Matcha NFT Marketplace you need to think about a few things:

  • What Blockchain do you want to use?
    It’s no secret that Ethereum fees are insane, Ethereum is still the most popular smart contract platform, but are your potential users willing to pay those fees? Think about it, if not, there are other networks available
  • What fee are you going to charge creators?
  • Who can mint the items in your market? Are you planning to sell your own collection? Or are you creating an open market for everyone?
  • What kind of users can mint NFT elements on your website?
    If your market is going to be open for “anyone to mint”, then you must allow registration on your website and users must have sufficient privileges to upload media files to your site. This is a complete topic in itself, and we cannot cover it in this tutorial. But be aware of all the security implications this has.

A word of advice

Alright, it looks like you are ready to do your first smart contract deployment on the Blockchain.

But, before hitting this button, a few words:

  • Deploy your first contracts on any testnet, if you plan to use Ethereum, you can fully test the contracts on Ropsten, Rinkeby, Kovan or Göerli for free. All blockchains have a testnet available, so the same applies to BSC, xDai and Matic
  • Once you decide to go live, remember that these smart contracts are still experimental and in beta phase, use them at your own risk.

Deploy your Smart Contract

Ready? Okay, fasten your seat belts Dorothy…

  • Go to your WordPress site
  • Click on NFT Collections
  • Define all the required attributes of your Smart Contract, like:

Flavor

The only available flavor at the moment is Matcha. Which is the fully featured NFT Marketplace, but we are planning to add more flavors in the future:

Contract flavor

In the Smart Contract section you can set:

  • The name and symbol of your contract, remember that ERC-721 is a token definition, similar to ERC-20, meaning that this collection has its own name and symbol, for instance: Symbol: DEMO, Name: My Collection
  • Commission that you are going to keep for every sale and auction done.
  • And the wallet to receive those commissions.
Smart Contract Options

Then you will see some security parameters, such as:

  • Who can mint? only you? someone else?
  • What is the WordPress user role of users who can coin ?, those are questions that need to be answered during your planning phase considering the security implications.
  • Finally, you can define who can edit an NFT on your site interface. By default, only authors can edit their own items, but if you are in a collaborative environment where the creator can change other creators’ items, click this option.
Security Options

Then you will see the Skin section, this is the appearance of your Marketplace. There are now four skins available. You can choose the one that best suits your site.

This is a global setting, so you need to go to settings section to change this. For more information on settings click here.

Look & Feel

The last option before implementing is related to the color of the box, this box will appear on your NFT items, once they have two or more sale or auction transactions. You can see an example here.

Graph colors setup

Now, it’s the moment of truth, now you can implement your contract:

  • First, choose the correct network where you want to implement your contract.
  • Second, click the deployment button, read the terms, if you agree, check the checkboxes and click “Yes, please proceed”
Ethereum deploy — Screen Cast
Binance Smart Chain deploy — Screen Cast

When the deployment is finished, you can:

  • Click on the your smart contract address to see all the Smart Contract information.
  • Click on the permalink of your NFT-Collection to see the UI of your collection and interact with it.

If you create different collections you can browse them all, and edit them if needed, in your wp-admin section:

NFT Collections in WordPress

Now you have a collection, but an empty collection is not fun at all, you need to create (mint) some NFT elements to be able to interact with your Marketplace.

Here are some examples of:

The smart contract in Ethereum mainnet:

https://etherscan.io/address/0x115ebf49c2536f54206540fa298a6c9d7bc0be7a#code

And a demo marketplace in Ropsten testnet:

https://demo.wpsmartcontracts.com/nft-collection/my-demo-collection/

For more information about NFT Collections go to:

https://wpsmartcontracts.com/docs/doc-nft-collection.php

Mint your NFT items

After you have deployed your collection, you or authorized users can create new items (NFTs) for your collection.

Mint from the front-end
The mint can be done in the front-end of your site, for this the process will be:

  • Go to your collection page in the interface
  • Click on “Mint a new item”
  • Fill in the form with all the attributes, images, categories, etc.
  • Upload the media file (can be an image, video, sound or document)
  • On the recipient specify the owner account of the minted item (you can scan the QR code of the address)
  • Click “Save and Mint”
  • Confirm your transaction in Metamask
Mint your items in the front-end

Mint from the back-end

  • Go to the wp-admin site
  • Click on “NFT” — “Add New NFT”
  • Fill all the data of the form, including categories, tags, description
  • Load the media of the NFT, this is the piece of the NFT itself. Can be an image, document, audio or video in any standar media format
  • Fill the address of the recipient of the new token (the owner address)
  • Choose the collection
  • Click on “Mint”
Mint your items in the back-end

Then as an admin of your WordPress site you can browse all items created:

NFT Items admin view on the Backend

For more information about minting your items go to:

https://wpsmartcontracts.com/docs/doc-item-mint.php

Store assets on the IPFS network

This is an optional but highly recommended option. If you want to store your assets on a decentralized system, you can store them on IPFS.

If you already setup the nft.storage API key on the first steps of this tutorial, then store your media to the InterPlanetary File System is really simple:

When you upload your media files you will have everywhere on your media gallery in WordPress a button “Upload to IPFS”.

Media library with IPFS

If your media is already uploaded to IPFS a URL link to ipfs.io will be shown, otherwise you will see a “Upload to IPFS” button. You can click on it to do so.

How to upload your media and store it on IPFS

For more information on setting up IPFS and uploading files to this network go to:

https://wpsmartcontracts.com/docs/doc-settings.php

https://wpsmartcontracts.com/docs/doc-item-ipfs.php

Use your Marketplace

Now that you have your NFT Marketplace ready with a few items, this is where the fun begins.

You can transfer the ownership of your item to any account:

Transfer a NFT Item

Sell your NFT item for a price.

When selling you need to specify:

  • The total price of the item. This price is defined in the native coin of the blockchain you choose, for example: Ether for Ethereum, BNB for BSC, etc.
  • The site owner commission will be discounted from this price. For example, if the price is 10 Ethers, and the site commission is 10% then the creator will receive 9 Ethers.
  • The wallet where the creator will receive the funds.
Sell a NFT Item

Buying is very simple, click Buy and confirm. That’s it. This NFT is yours forever on the Blockchain.

Buy a NFT item

Put your item up for auction, when doing this you must specify:

  • Reserve price: This is the minimum price you are willing to accept for your NFT. Remember that the site owner commission will be discounted from this price.
  • Auction End Date: All times and dates are in GMT format. This auction date cannot be changed and once you put your item up for auction, it will be blocked for transfer or sale until the auction ends. Be careful when setting a date.
Put up for auction

Bid on any auction, if you are outbid the funds are automatically refunded to your account.

Bid

And end an auction when it’s ready. “Finish” means that the highest bidder gets the item, at this point ownership of the NFT is transferred and the creator gets his commission and the site owner gets his share.

Finalize

For more information on transfer, auctions and sales please refer to:

https://wpsmartcontracts.com/docs/doc-item-transfer.php

https://wpsmartcontracts.com/docs/doc-item-sell.php

https://wpsmartcontracts.com/docs/doc-item-buy.php

https://wpsmartcontracts.com/docs/doc-item-auction.php

https://wpsmartcontracts.com/docs/doc-item-bid.php

https://wpsmartcontracts.com/docs/doc-item-finalize.php

https://wpsmartcontracts.com/docs/doc-item-withdraw.php

--

--