How to Simply Create NFTs (ERC-721) with Truffle & Ganache
Table of contents
Intro
This post will be a simple introduction to developing NFTs (ERC-721) locally with Truffle and Ganache. Following along will give you a good idea of where to get started if you haven't tried developing NFTs before.
I'll assume you've heard of what NFTs are and dive straight into dev prep and coding.
Truffle
framework runs on nodejs and is useful when developing and testing Solidity. Let's start off with installing truffle globally if you don't have it yet.
npm install -g truffle
Truffle Docs: trufflesuite.com/docs/truffle/overview
And Ganache
helps you run your Solidity code on a local Ethereum network for testing. Please download and install Ganache from the website.
Init Project
Create a new folder to work on and init our project with the command truffle init
inside the folder. Afterwards use the command npm init
to manage our dependencies later on.
So now your project should look like this. (I've added a README for Github)
Configuring Truffle
Open up truffle-config.js
and modify solc
(Solidity Compiler) like below. Notice that I've changed the solc version and evmVersion.
And we'll be using Ganache as our local ethereum test network. So uncomment networks
and replace 'development' to 'ganache'.
(editing post...)