Welcome to the NFTMint-TokenSale-TokenStake repository! This repository contains three smart contracts developed using Foundry, a library for testing smart contracts. Additionally, it includes a web3 integration with an "app" folder and a tool for generating Merkle tree hashes for wallets used in these contracts, located in the "merkletree-tool" folder with JavaScript code.
The NFT Contract enables users to mint NFTs through three different minting methods:
- Free Mint: Allows users to mint NFTs for free.
- Whitelist Mint: Permits whitelisted users to mint NFTs.
- Public Mint: Allows anyone to mint NFTs.
The Token Sale Contract facilitates the sale of created tokens through various methods, including:
- Airdrop: Distributes tokens to specified addresses.
- Seed Sale: Conducts token sales at seed stage.
- Presale: Manages token sales during the presale phase.
- Public Sale: Facilitates token sales to the public.
Please note that a "TokenStake.sol" contract is planned but has not been implemented yet.
To set up this project, follow these steps:
-
Install Foundry by following the instructions here.
-
Run the installation script to install necessary packages:
./install.sh
- Add the required environment variables to both the root and "./app" folders by editing the ".env" files. "./.env":
AVALANCHE_FUJI_RPC_URL="https://api.avax-test.network/ext/bc/C/rpc"
PRIVATE_KEY=<YOUR_PRIVATE_KEY>
ETHERSCAN_API_KEY=<YOUR_ETHERSCAN_API_KEY>
"./app/.env":
REACT_APP_WALLET_CONNECT_ID=<YOUR_WALLET_CONNECT_PROJECT_ID>
- Before deploying a contract script, load the environment variables into memory:
source .env
Deploy the contract to the network using the following command:
forge script script/<CONTRACT_SCRIPT_FILE>.s.sol:<SCRIPT_NAME> --rpc-url $AVALANCHE_FUJI_RPC_URL --broadcast -vvvv
- To verify a contract, use the following command:
forge verify-contract --chain-id 43113 --watch <CONTRACT-ADDRESS> <CONTRACT_NAME>
- For the contracts requiring Merkle roots, update the appropriate JSON file in the "merkletree-tool" folder with the required wallet addresses. While in the "merkletree-root" directory, execute the following commands:
yarn create-proof
yarn release-proof
This will generate proofs for wallet addresses and save them in the "app" folder.
-
Locate and edit the necessary
Info.ts
file in "./app/src/helpers" with the contract address. -
Navigate to the "app" folder in the terminal and run the following command to start the web interface:
yarn start
Feel free to contribute to this project by opening issues, providing feedback, or submitting pull requests.
This project is licensed under the MIT License. Bu README.md dosyasını kullanarak projenizin kullanıcılarına kolayca kurulum yapma ve projeyi anlama konusunda yardımcı olabilirsiniz. Unutmayın ki bu sadece bir öneri olduğu için projenizin gereksinimlerine ve yapısına uygun şekilde özelleştirebilirsiniz.