NFTs and Solidity Smart Contract

I’ve watched many videos and tried multiple ways of deploying NFTs’ smart contract. I’ve tried deploying through Remix, NFTport or via terminal command line. There are many way to deploy NFTs. It’s up to your personal preference or requirements of your project. Here is what we need to consider before deploying a NFT contract.

Choosing between ERC721 or ERC1155 contract. There are some differences between these two. ERC721 is a NFT and is only limited to one object only. ERC1155 can be a NFT or non-NFT contract. Brainstorming which is more beneficial for your project’s use cases before deciding. Below is a summary from 101blockchains.com which really sums up everything.



Once the type of contract is decided, in my case it is ERC721, it’s time to go through what functionality is required for the contract. This part is how you program how the contract behaves.

Here are some examples of the functions that can be included in the contract.

-Enable/Disable (Start/Pause) Function
This allow the admin or owner of the contract to control when the contract is available for minting. The contract can be deployed but disabled in order to generate hype so that people will wait for the date to try and mint before it runs out.

-Hide and Reveal Function
This function basically shows the NFT as a generic data/picture. The real data/picture will be reveal after some time or when after the sale period has ended. It adds more mystery and hype to the project making buyers unaware if they got a rare or normal NFT.

-Withdraw Function
This is one of the most important function. All the funds received by the contract will be stuck forever if there is no withdrawal function to send the funds out.



Once the functions are all clearly thought out, it needs to be written into the contract. There are many available contracts out there on Github. Youtube tutorials also provides contracts for the public to download and use. I’ve used HashLips ERC721 contract to deploy my NFT.

Remix is a fantastic place to test and deploy your smart contract. Always test and test before deploying to the mainnet. I’ve tested on remix today, deployed to the Rinkeby network and minted 5 NFTs. Luckily it was on a testnet, there are some issues here and there before i finally got it to work!



Let’s do a recap over the next few days so i can prepare my dapp before deploying my NFTs to the mainnet.

About

Middle-age uncle attempting a to migrate into the blockchain development industry. : )

Leave a Reply

Your email address will not be published.

*