Skip to content

Created NFTs using the ERC-721 token standard, minted them and finally got them to show up in my Metamask wallet.

Notifications You must be signed in to change notification settings

alfheimrShiven/nft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NFTs 👻

About

In this project, I create my own NFTs using the ERC-721 token standard, minted them and finally got them to show up in my Metamask wallet!

Two types of NFT:

  1. Static NFT: This NFT will not change based on any action.

Note: The NFT is stored on IPFS, hence not 100% decentralised. The Token URI is mentioned below.

NFT Name: Dogie
NFT Symbol: DOG

Link to Dogie NFT contract on Etherscan

  1. Dynamic NFT: This NFT has the capability to change using a function call, hence it's dynamic. Isn't that cool!!😎

Note: This NFT is stored 100% on chain!

NFT Name: Mood NFT
NFT Symbol: MN

Link to Mood NFT contract on Etherscan

Usage

OpenZeppelin

OpenZeppelin Contracts Docs

OpenZeppelin GitHub Repo

Installing OpenZeppelin Contracts Package

forge install OpenZeppelin/openzeppelin-contracts --no-commit

Quickstart 🚀

git clone https://github.com/alfheimrShiven/nft.git
cd nft
forge build

Testing

forge test

or

forge test --fork-url $SEPOLIA_RPC_URL

Test coverage

forge coverage

Deploying Dogie NFT

Start a local node

make anvil

Deploy on local ANVIL chain ⛓️

make deployBasicNft

Deploy on Sepolia test net ⛓️

  1. Setup environment variables

You'll want to set your SEPOLIA_RPC_URL and PRIVATE_KEY as environment variables. You can add them to a .env file, similar to what you see in .env.example.

  • PRIVATE_KEY: The private key of your account (like from metamask). NOTE: FOR DEVELOPMENT, PLEASE USE A KEY THAT DOESN'T HAVE ANY REAL FUNDS ASSOCIATED WITH IT.
  • SEPOLIA_RPC_URL: This is url of the sepolia testnet node you're working with. You can get setup with one for free from Alchemy

Optionally, add your ETHERSCAN_API_KEY if you want to verify your contract on Etherscan.

  1. Get testnet ETH

Head over to faucets.chain.link and get some testnet ETH. You should see the ETH show up in your metamask.

  1. Deploy
make deployBasicNft ARGS="--network sepolia"

Now it's time to MINT your Dogie NFT 🐶

make mintBasicNft

Deploying Mood NFT

Start a local node

make anvil

Deploy on local ANVIL chain ⛓️

make deployMoodNft

Deploy on Sepolia test net ⛓️

  1. Setup environment variables

You'll want to set your SEPOLIA_RPC_URL and PRIVATE_KEY as environment variables. You can add them to a .env file, similar to what you see in .env.example.

  • PRIVATE_KEY: The private key of your account (like from metamask). NOTE: FOR DEVELOPMENT, PLEASE USE A KEY THAT DOESN'T HAVE ANY REAL FUNDS ASSOCIATED WITH IT.
  • SEPOLIA_RPC_URL: This is url of the sepolia testnet node you're working with. You can get setup with one for free from Alchemy

Optionally, add your ETHERSCAN_API_KEY if you want to verify your contract on Etherscan.

  1. Get testnet ETH

Head over to faucets.chain.link and get some testnet ETH. You should see the ETH show up in your metamask.

  1. Deploy
make deployMoodNft ARGS="--network sepolia"

Now it's time to MINT your Mood NFT 🎁

make mintMoodNft

Flip mood

make flipMoodNft

Importing your NFTs into Metamask

Once minted, import your NFT into your Metamask. Since you would be the first one minting the NFT, Token ID = 0. To learn how to import, refer this blog.

Thank you! 🤗

If you appreciated this, feel free to follow me:

Shivens LinkedIn

Shivens Twitter

About

Created NFTs using the ERC-721 token standard, minted them and finally got them to show up in my Metamask wallet.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published