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.
- 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.
Ensure you have the following installed:
-
Clone the repository:
git clone https://github.com/andrei2308/Nft-app.git cd Nft-app
-
Install dependencies:
forge install
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.
Compile the smart contracts:
forge build
Execute the test suite:
forge test
-
Start a local Ethereum node:
anvil
-
Deploy the Basic NFT contract:
forge script script/DeployBasicNft.s.sol:DeployBasicNft --rpc-url http://localhost:8545 --private-key $PRIVATE_KEY --broadcast
-
Deploy the Mood NFT contract:
forge script script/DeployMoodNft.s.sol:DeployMoodNft --rpc-url http://localhost:8545 --private-key $PRIVATE_KEY --broadcast
-
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
-
Flip the mood of a Mood NFT:
forge script script/Interactions.s.sol:FlipMoodNft --rpc-url http://localhost:8545 --private-key $PRIVATE_KEY --broadcast
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.
This project draws inspiration from the foundry-nft-cu repository.
This project is licensed under the MIT License. See the LICENSE file for details.
For more information on Foundry, refer to the Foundry Book.