NFT CONTRACTS research

in #nft3 years ago

HOW TO CREATE NFT CONTRACTS

This is my research in the this NFT JOURNEY

I will share some links in process of my research

NFT CONTRACTS AND ONE SAMPLE STUDY

GOLD STANDARD FOR NFT CONTRACTS IS
https://github.com/OpenZeppelin/openzeppelin-contracts/tree/master/contracts/token/ERC721

There are many tools for deploying smart contracts, but for this post I will share web3 CLI tool maybe it’s the quickest and easiest tool to compile and deploy NFT contracts. Share some comments on this

https://github.com/gochain/web3

PROJECT SETUP

Lets go

  1. Install the CLI tool

liner will install the tool so you can start using it right away
read the install.sh code if you are learning

curl -LSs https://raw.githubusercontent.com/gochain/web3/master/install.sh | sh

Screenshot 2021-12-27 162728.png

  1. Set the network

Try to use GoChain here so we don’t have to pay high $xyz to deploy the contract then after $50 to mint every NFT.
With GoChain, have to pay a small fraction of a penny and it’s 100% Ethereum compatible
check gas fee and other fees before you setup network at the present time
NOTE: we can use the same way we would with Eth.
ANY TIME one can change the line below to point to Eth and pay extra fee if desired

https://gochain.io/

image credit link

Screenshot 2021-12-27 163231.png

export WEB3_NETWORK=gochain

for ethereum:

export WEB3_NETWORK=ethereum

Screenshot 2021-12-27 163345.png

WE HAVE TO ADD GAS FOR FEES
add same token for some gas for these transactions
you can create a new one and send gas to it.
it is $GO on GoChain and or $ETH for Eth depending on your choice

This will print:

new account run will be created

web3 account create

Screenshot 2021-12-27 163703.png

Print will come out as

Screenshot 2021-12-27 165435.png

Transfer some Go Tokens to public address

You can get some Go Tokens here https://gochain.io/go

next, Copy save you the “Private key”
Now run this

Screenshot 2021-12-27 164238.png

Now Deploy Contract

all setup with network set
our private key is set with some gas in it
and now

Creating the Contract

now web3 CLI has built in code generators for common contracts such as ERC20 and ERC721’s.
now run:

web3 generate contract erc721 --symbol SKYART --name "Crypto SKYART" --base-uri https://cruptoskyart.com/skyart/

This will generate a file called SKYART.sol which is the solidity program for your new NFT contract.

The base-uri argument should point to a server you control so that you can then deliver the NFT metadata when someone queries it . We’ll cover the metadata and image/video files below.

Deploy the Contract

From here we just need to compile and deploy it. Again, the web3 CLI makes this part easy:
web3 contract build SKYART.sol
web3 contract deploy SKYART.bin

Now we will print out your new contract address.
This is deployed an NFT new contract

I will try all of this and keep you posted how it works

Coin Marketplace

STEEM 0.20
TRX 0.15
JST 0.029
BTC 64512.68
ETH 2615.54
USDT 1.00
SBD 2.82