NFTs 101 -> Deploying Smart Contract

Alright! First milestone in creating the NFTs artwork checked! There are 2 more milestone, deploying the NFT smart contract and creating a minting dapp. Previous article stopped at generating the images and metadata. These data must live somewhere in order for the blockchain to refer to. Google drive or even IPFS, decentralised storage are good options.

Uploading to the Cloud

Pinata is a good choice for managing files on IPFS. Upload the images folder and copy the CID identifier. Update the link of the images into the metadata.json. Use the update metadata script within HashLips Art Engine to update all the metadata files.

– Edit config.js update BaseUri in line 10 to “ipfs:// {CID identifier copied}”;
– Open terminal and run npm utils/update_info.js
– Open up random metadata json files and check line 4. It should be like “ipfs://CID…/1.png”

Metadata update completed. Upload the metadata folder to Pinata and copy the CID identifier. This is for the smart contract to refer to the metadata.



Deploying the Smart Contract

Almost there… Open the solidity contract in Remix and get ready to deploy. In this case, it is a simple ERC721 NFT contract with the most default and basic functions.

– Under “Deploy and Run Transactions” tab, select “Injected Web3”.
– Set the correct network in Metamask and select the desired account.
– In the contract section, select the NFT contract. In this case, HelloWorld.sol.
– Set up the deployment parameters.
1. Name: name of the NFT
2. Symbol: abbreviation of the NFT (usually 3 to 5 characters)
3. InitBaseURI: ipfs://{CID of metadata}/
– Click on the “Transact” button

Done! Contract deployed to the blockchain! Do ensure there is enough ether/matic in Metamask before transacting.



Mint NFT and check on OpenSea

Let’s mint NFTs and check on OpenSea. Open up deployed contract in Remix.

– Under “Mint” function, enter desired NFT to mint and click on the red button.
– Copy contract address by clicking on the copy button.
– Go to OpenSea or Testnet OpenSea.
– Click on “My Collection”. If there is no collection, submit your collect by putting in the contract address.

Wait a few moments and the collection should appear!



NFTs are live and ready for minting. Let’s explore into making a minting page/dapp the next few days!

About

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

Leave a Reply

Your email address will not be published.

*