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: https://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...)
Subscribe to my newsletter
Read articles from Jinwoo Cheon directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Jinwoo Cheon
Jinwoo Cheon
Former PO @ Naver Financial. Now working my way to become a pro Web3 Dev w/ Solidity and React. Passionate about NFTs.