NFT
Launch Non-fungible Token On GEMNODE
A Non-Fungible Token (NFT) is used to identify something or someone in a unique way. This type of Token is perfect to be used on platforms that offer collectible items, access keys, lottery tickets, numbered seats for concerts and sports matches, etc.
ERC-721
The concept of NFT (ERC-721) was officially introduced in the EIP-721, proposed by William Entriken, Dieter Shirley, Jacob Evans, Nastassia Sachs, January, 2018, and wildly adopted in the last few years. Its mechanism allows users to store images remotely on IPFS with customized metadata and unique IDs verified by Blockchain.
In short, ERC-721 is a Non-Fungible Token standard that implements an API for tokens within Smart Contracts. This makes ERC-721 NFT impossible to replicate.
The standard provides functionalities like to transfer tokens from one account to another, to get the current token balance of an account, to get the owner of a specific token and also the total supply of the token available on the network. Besides, it also has some other functionalities like to approve that an amount of token from an account can be moved by a third party account.
If a Smart Contract implements the following methods and events it can be called an ERC-721 Non-Fungible Token Contract and, once deployed, it will be responsible to keep track of the created tokens on Ethereum.
ERC-4907
ERC-4907 is a new NFT standard developed on top of the ERC-721 standard, so called the NFT rental standard with a stronger foundation for developers to adopt, projects also incur fewer costs in comparison to the previous one. It was put forth by Double Protocol as a proposal and approved by the Ethereum development team. ERC-4907 adopts a dual role for “owner” and “user” (or "renter") at the application layer.
This new standard allows NFT owners to put their NFTs on an open market for rent. Specifically, “owners” and “users” have their rights and renting period clearly defined. This improves safety for the NFT lender. Also, this works very well for projects facilitating NFT rentals, they have a set of clear guidelines to work with.
NFT lenders do not have to execute a second on-chain transaction to claim their NFT. With the “expires” function, the NFT renter’s rights automatically expire after the rental period. This reduces effort and cost for the NFT lender. In turn, this incentivizes lending and improves liquidity in the NFT renting market.
Technically, NFT renters cannot transfer the NFT, nor alter the rental period. In turn, this reduces the costs of NFT renting.
On GEMNODE
GEMNODE network supports both mentioned standards for NFT. Developers can easily generate those two types of NFT directly on GEMNODE Client Interface without coding, or craft a smart contract by themselves.
Once created NFTs, developers can immediately list them on the native GEMNODE NFT Market for sale, or reach out to Samurai Guild Games for airdrop or private sale campaigns.
Please find an instruction for crafting an NFT smart contract below.
Prepare images
The first step of setting up an NFT smart contract is having your NFT files ready to use. Developers can try to upload images to Pinata, a pinning service that prevents files from being garbage collected on IPFS, to have NFT files ready.
Prepare metadata
The .json file below is an example of what the metadata should look like.
Now, we'll populate the values into the metadata file. You can choose any name
and description
that you want.
The tokenId
here will be 0
so that it corresponds to the image we just uploaded. If uploading multiple files, this needs to be incremented in each file.
The image
link is the URL we saved from the last step of the previous section. Paste that link here so the smart contract knows where to find the image file for your NFT. If uploading multiple files, the end of the URL (the specific image) needs to increment in each file.
The attributes
field isn't quite as important here, but if you were uploading NFTs with several layers, the attributes would be the information of those specific layers. This is often used when calculating the rarity of NFTs to be able to rank them by how frequently their layers appear throughout the entire collection.
Deploy NFT Smart Contract with Remix
Remix IDE is a solidity compiler that allows you to edit, compile, and deploy your smart contract. This will prevent you from needing to download any other coding environments at this stage.
Once you've imported your contract, the first thing you need to do is compile it. Hit the Compile
button on the left-hand side. You could also use the keyboard shortcut Ctrl / Command + S
.
Once completed, you'll get a green checkmark on the far left tab and will see options to Publish on Ipfs or Swarm. Those aren't important to our tutorial. Next, you'll click on the bottom tab on the left-hand side to move to the deployment page.
Now, we need to change the environment that Remix will try to use to deploy the smart contract. Click on the Environment
drop-down, and select Injected web3
.
Mint an NFT
Now that you've deployed the contract, you can mint the NFT. Go back to the Remix IDE tab and click on your contract to expand its information. A list of functions will appear that you can interact with.
The only function you're interested in is the safeMint
function. Click the drop-down arrow for the function to expand the address field.
Now, copy your address and paste it into this address field. This will send the NFT to your address when the mint function is called. After, hit transact
.
This will reopen MetaMask and ask you to verify the transaction. Click Confirm
to mint your NFT.
Once the transaction has been confirmed, you'll see a green checkmark in the terminal at the bottom of the Remix IDE.
By clicking on the Txn Hash, you see that your NFT was created!
Last updated