This project is a decentralized application that allows users to mint NFTs. The project is built using the following technologies:
React, NextJS, TailwindCSS, Solidity, Hardhat, web3.js, Alchemy API, IPFS, Etherscan, and Metamask.
To see the project in action, visit the following link:
To better understand watch my presentation on loom:
Clone the repo:
git clone https://github.com/ahmetenesdur/nft-contract-mint-dapp.git
Navigate to the project directory:
cd nft-contract-mint-app
Install the dependencies:
npm install
# or
yarn install
Start the development server:
npm run dev
# or
yarn dev
Change the .env variables. Update the dapp.config.js
file according to your needs.
.env file:
NEXT_PUBLIC_ALCHEMY_API=
NEXT_PUBLIC_BLOCKNATIVE_API=
METAMASK_PRIVATE_KEY=
ETHERSCAN_API_KEY=
If you want to make changes to the Patika smart contract, you can find Patika.sol in the /contracts
folder. Remove /artifacts
folder using npx hardhat clean
. After making the changes, recompile your smart contract using the npx hardhat compile
command.
You need to update the scripts/whitelist.js
file with your whitelisted user accounts and deploy and verify your smart contract on the blockchain. For this, you can find the deploy & verify scripts in the /scripts
folder. You can run these scripts using the commands npx hardhat run scripts/deployContract.js
and npx hardhat run scripts/verifyContract.js
.
If you want to use a different network, change the Alchemy API. Make sure you configure it in the hardhat.config.js
file. You can find the Configuration here.
networks: {
hardhat: {},
goerli: {
url: `${process.env.NEXT_PUBLIC_ALCHEMY_API}`,
accounts: [`0x${process.env.METAMASK_PRIVATE_KEY}`]
}
},
Update the /utils/interact.js
file to use the relevant functions from your updated contract. Replace the contract address in this file and the imported ABI with your distributed contract. You can find the ABI in the /artifacts/contracts/Patika.sol/Patika.json
file.