Skip to content

chauhan-varun/foundry-nft-crafter

Repository files navigation

Foundry NFT Project

This project contains two NFT smart contracts built with Foundry:

  • PrimeNft: Simple ERC721 NFT that allows minting NFTs with custom URIs
  • VibeNft: On-chain SVG NFT that can switch between two states (Smile and Wink)

Author

Varun Chauhan

Project Structure

  • src/: Smart contract source files
    • PrimeNft.sol: Basic NFT with custom URI
    • VibeNft.sol: On-chain SVG NFT with switchable states
  • test/:
    • unit/: Unit tests for contracts
    • interactions/: Tests for deployment and interaction scripts
  • script/: Deployment and interaction scripts
  • img/: SVG images used for the VibeNft

Features

PrimeNft

  • Simple ERC721 implementation
  • Mint NFTs with custom URIs
  • Standard ERC721 functionality

VibeNft

  • On-chain SVG NFT
  • SVG data stored directly in the contract
  • "Vibe" can be changed between Smile and Wink states
  • Token metadata generated on-chain with Base64 encoding

Getting Started

Prerequisites

Installation

# Clone the repository
git clone https://github.com/chauhan-varun/foundry-nft
cd foundry-nft

# Install dependencies
forge install

Usage

Build

forge build

Test

Run all tests:

forge test

Run specific tests:

# Run unit tests
forge test --match-path test/unit/**

# Run interaction tests
forge test --match-path test/interactions/**

Deploy

Deploy PrimeNft:

forge script script/DeployPrimeNft.s.sol:DeployPrimeNft --rpc-url <your_rpc_url> --broadcast --private-key <your_private_key>

Deploy VibeNft:

forge script script/DeployVibeNft.s.sol:DeployVibeNft --rpc-url <your_rpc_url> --broadcast --private-key <your_private_key>

Interact with NFTs

To mint a PrimeNft:

forge script script/Interactions.s.sol:Interactions --rpc-url <your_rpc_url> --broadcast --private-key <your_private_key>

Foundry Documentation

For more information about Foundry:

Tools

  • Forge: Ethereum testing framework
  • Cast: CLI for interacting with EVM smart contracts
  • Anvil: Local Ethereum node
  • Chisel: Solidity REPL

About

A smart contract project using Foundry, featuring two NFTs: PrimeNft: A simple ERC721 contract enabling users to mint NFTs with customizable URIs. VibeNft: An on-chain SVG NFT that visually switches between "Smile" and "Wink" states, with metadata generated fully on-chain.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors