This is a decentralized application (DApp) built with React that allows users to mint NFTs by uploading images, vote for their favorite NFTs, and select a winner. The images are uploaded to IPFS via Pinata, and the metadata is stored on the blockchain using a smart contract.
-
Connect to MetaMask wallet
-
Upload and validate image files
-
Upload images to IPFS via Pinata
-
Mint NFTs using a smart contract
-
Vote for minted NFTs
-
Select and reward the winner
-
mintnft(string tokenUri)
- Mints a new NFT and stores metadata on IPFS.
- Payable function.
-
vote(uint256 tokenId, uint256 amount)
- Votes for a specific NFT by donating ETH.
- Payable function.
-
selectwinner()
- Returns the ID of the NFT with the highest votes.
-
sendwinningamount()
- Sends the reward pool to the winner's address.
-
returncurrentrewardpool()
- Retrieves the current reward pool amount.
-
getAllMintedNFTs()
- Returns all minted NFTs with their details (owner, votes, token URI).
-
voterinfo(address)
- Provides voting details for a specific user.
-
rewardpool()
- Displays the total reward pool.
- Allows users to connect their Ethereum wallet using MetaMask.
- Validates and uploads NFT images (JPEG/PNG, max size 5MB).
- Displays remaining time for voting.
- Displays messages for invalid actions or errors (e.g., incorrect file type).
- Automatically fetches all minted NFTs and the reward pool upon wallet connection.
Before you begin, ensure you have met the following requirements:
- Node.js and npm installed
- MetaMask installed in your browser
- Pinata account and API keys
- Clone the repository:
git clone https://github.com/Aditya41205/NFT-MINTING.git cd NFT-MINTING
- Install the dependencies:
npm install
- Configuration Create a .env file in the root directory and add your Pinata API credentials:
REACT_APP_PINATA_API_KEY=your_pinata_api_key
REACT_APP_PINATA_SECRET_KEY=your_pinata_secret_key
4 Running the App Start the development server:
npm start
- Connect your MetaMask wallet by clicking the "Connect Wallet" button.
- Upload a valid PNG or JPEG image under 5MB.
- Click "Mint NFT" to upload the image to IPFS and mint an NFT.
- Enter the Token ID and amount to vote for an NFT and click "Vote".
- Click "Select Winner" to select a winner (only accessible by the contract owner).
- Click "Send Winning Amount" to send the reward to the winner (only accessible by the contract owner).
6 License
This project is licensed under the MIT License.
updated.mp4
Stay tuned more updates are underway to make nft minting process gasless
Contributions, issues, and feature requests are welcome! Feel free to open an issue or submit a pull request.