Skip to content

andrei2308/Nft-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NFT App

This project is an NFT (Non-Fungible Token) application developed using Foundry, a fast and portable toolkit for Ethereum application development written in Rust. The application includes functionalities for deploying and interacting with NFT smart contracts.

Features

  • NFT Deployment: Deploys ERC721-compliant NFT contracts to the Ethereum blockchain.
  • Minting: Allows users to mint new NFTs.
  • Mood NFTs: Implements NFTs with on-chain SVG images that can change mood.

Getting Started

Prerequisites

Ensure you have the following installed:

  • Foundry: Ethereum development toolkit.
  • Git: Version control system.

Installation

  1. Clone the repository:

    git clone https://github.com/andrei2308/Nft-app.git
    cd Nft-app
  2. Install dependencies:

    forge install

Configuration

Create a .env file in the root directory and add the following variables:

SEPOLIA_RPC_URL=<your_sepolia_rpc_url>
PRIVATE_KEY=<your_private_key>
ETHERSCAN_API_KEY=<your_etherscan_api_key>

Replace <your_sepolia_rpc_url>, <your_private_key>, and <your_etherscan_api_key> with your actual credentials.

Usage

Building the Project

Compile the smart contracts:

forge build

Running Tests

Execute the test suite:

forge test

Deploying Contracts

  1. Start a local Ethereum node:

    anvil
  2. Deploy the Basic NFT contract:

    forge script script/DeployBasicNft.s.sol:DeployBasicNft --rpc-url http://localhost:8545 --private-key $PRIVATE_KEY --broadcast
  3. Deploy the Mood NFT contract:

    forge script script/DeployMoodNft.s.sol:DeployMoodNft --rpc-url http://localhost:8545 --private-key $PRIVATE_KEY --broadcast

Minting NFTs

  • Mint a Basic NFT:

    forge script script/Interactions.s.sol:MintBasicNft --rpc-url http://localhost:8545 --private-key $PRIVATE_KEY --broadcast
  • Mint a Mood NFT:

    forge script script/Interactions.s.sol:MintMoodNft --rpc-url http://localhost:8545 --private-key $PRIVATE_KEY --broadcast

Interacting with Mood NFTs

  • Flip the mood of a Mood NFT:

    forge script script/Interactions.s.sol:FlipMoodNft --rpc-url http://localhost:8545 --private-key $PRIVATE_KEY --broadcast

Project Structure

Nft-app/
├── .github/
│   └── workflows/
├── img/
├── lib/
├── script/
├── src/
├── test/
├── .gitignore
├── .gitmodules
├── LICENSE
├── README.md
└── foundry.toml
  • script/: Contains deployment and interaction scripts.
  • src/: Houses the smart contract source code.
  • test/: Includes test files for the contracts.

Acknowledgements

This project draws inspiration from the foundry-nft-cu repository.

License

This project is licensed under the MIT License. See the LICENSE file for details.


For more information on Foundry, refer to the Foundry Book.

About

NFT application for basic and dynamic NFTs

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published