Skip to content

Latest commit

 

History

History
139 lines (92 loc) · 3.14 KB

README.md

File metadata and controls

139 lines (92 loc) · 3.14 KB

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.