How to Simply Create NFTs (ERC-721) with Truffle & Ganache

ยท

1 min read

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.

image.png

image.png

So now your project should look like this. (I've added a README for Github)

image.png

Configuring Truffle

Open up truffle-config.js and modify solc (Solidity Compiler) like below. Notice that I've changed the solc version and evmVersion.

image.png

And we'll be using Ganache as our local ethereum test network. So uncomment networks and replace 'development' to 'ganache'.

image.png

(editing post...)

ย