Candid Crypto Releases Tutorial For Creating ERC721 Token

January 14, 2022
 - 

Candid Crypto released a 19-page document and instructional video on how to build and deploy ERC721 tokens on the Ethereum testnet with Rinkeby last week. The tutorial demonstrates how to construct completely unique NFTs from the ground up without relying on services or markups. The end goal is to teach crypto artists how to port their NFTs into the Ethereum main network before putting them up for sale on OpenSea. 

All details outlined below were taken directly from the OpenZeppelin ERC721 Token Deployment Tutorial. Links are posted at the end of this article. 

Objectives: 

  • Create development environment
  • Edit/customize token fields → add metadata to NFT
  • Deploy smart contract to Rinkeby testnet

Requirements:

Software:

  • npm - node package manager
  • Node - If installing from apt, ensure that you update npm and node to the latest versions
  • Truffle - Ethereum development tool
  • OpenZeppelin contracts - The contracts leveraged to deploy the ERC721 token
  • Metamask - Generate seed phrase → receive test network ether

Step 1: Create development environment

  • Ubuntu VM →  20.04
  • Npm
  • Node

Step 2a: Initialize project directory

$ mkdir helloNft && cd helloNft
$ npm init -y

// Install OpenZeppelin contracts
$ npm install –save-dev @openzeppelin/contracts
$ npm install truffle

Step 2b: Setup solidity project

$ npx truffle init
$ mkdir –p build/contracts/
$ cp node_modules/@openzeppelin/contracts/build/contracts/*
build/contracts/

Step 3: Adjust parameters for ERC721 token

Create migrations/2_deploy.js with the following content

const ERC721PresetMinterPauserAutoId = artifacts.require("ERC721PresetMinterPauserAutoId");
module.exports = function(deployer) {
  deployer.deploy(ERC721PresetMinterPauserAutoId, "Candid Crypto Goodie Test", "CCT", "https://candidcryptopodcast.com/api/tokens/");
};

Adjust the arguments to match your NFT info

Step 4a: Prep for testnet

npm install @truffle/hdwallet-provider
// Create secrets.json
touch secrets.json
nano secrets.json

Step 4b: Prep for Testnet, cont…

Configure truffle-config.js for Rinkeby network:

// Add HDWalletProvider
const HDWalletProvider = require('@truffle/hdwallet-provider’);

// Add Secrets
const secrets = require(“./secrets”);

Step 4c: Prep for Testnet, cont…

Configure truffle-config.js for Rinkeby network
Add Rinkeby network config

networks: {
rinkeby: {
provider: () => new HDWalletProvider(secrets.mnemonic, `https://rinkeby.infura.io/v3/${secrets.projectId}`),
network_id: 4,
gas: 8500000,
gasPrice: 1000000000,
confirmations: 2,
timeoutBlocks: 200,
skipDryRun: true
},

Step 5: Deploy

$ npx truffle console --network rinkeby
truffe(rinkeby)> migrate

Resources
Website: Candid Crypto Podcast
Video Link: Building NFTs from scratch: Part 1, Rinkeby testnet (YouTube) 
Tutorial Presentation: OpenZeppelin ERC721 Token Deployment (PDF)

Other Recent Posts

November 18, 2022
A Beginner's Guide To Polygon (MATIC)

The much talked about Polygon MATIC cryptocurrency platform is directed and discussed to provide a thorough guide to this relatively new kid on the block

Read More
November 16, 2022
The Ultimate Beginner’s Guide To Bitcoin

The ultimate guide to Bitcoin, its place in the cryptocurrency world, and how you can get involved should you wish. A comprehensive look at Bitcoin.

Read More
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram