Giter Club home page Giter Club logo

nft-collection-contract's Introduction

Crypto Devs NFT Project

This project lets you deploy a whitelist contract and an NFT contract where whitelisted users can mint NFTs for free while others need to pay.

Features

  • Whitelist system with a maximum number of allowed addresses.
  • An NFT (ERC-721) contract with the following functionalities:
    • Limited total supply (20 NFTs).
    • 1 NFT per transaction rule.
    • Whitelisted users can mint for free.
    • Non-whitelisted users must pay 0.01 ETH to mint.

Environment Setup

  1. Clone this repository.
  2. Navigate to the hardhat directory.
  3. Set up environment variables by creating a .env file with the following entries:
PRIVATE_KEY="your_metamask_private_key"
RPC_URL="your_quicknode_http_provider_link"
ETHERSCAN_API_KEY="your_etherscan_api_key"

Deployment

  1. Install the required npm packages:
npm install
npm install @openzeppelin/contracts
npm install dotenv
  1. Deploy the Whitelist contract:
npx hardhat run scripts/deploy.js --network sepolia
  1. Take note of the contract address of the deployed Whitelist.

  2. Replace the placeholder address in deploy-nft.js with your Whitelist contract address.

  3. Deploy the NFT contract:

npx hardhat run scripts/deploy-nft.js --network sepolia
  1. Interact with the contracts via Etherscan (Sepolia Testnet) or programmatically through web3 or ethers.js libraries.

Testing

For Whitelisted Addresses

  1. Use Sepolia Etherscan to connect your wallet and interact with the Whitelist contract's "addAddressToWhitelist" function.
  2. Now, interact with the NFT contract's mint function without sending any ETH.

For Non-Whitelisted Addresses

  1. Use Sepolia Etherscan to connect your wallet and interact with the NFT contract's mint function.
  2. You'll need to send exactly 0.01 ETH for the minting to succeed.

Important Notes

  • Always ensure you're using a testnet account for deployment to avoid any loss of real funds.
  • Keep your private key and other environment variables confidential. Avoid publishing or sharing your .env file.

nft-collection-contract's People

Contributors

lukman-01 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.