Skip to content

JMariadlcs/NFT-IPFS-VRF

Repository files navigation

NFT with IPFS and CHAINLINK VRF

This is a random NFT collection creation from a Chainlink Hackaton Spring 2022 workshop which is implemented by using IPFS for decentralize images storage and Chainlink VRF for make it actually random.

NOTICE: we are working with Chainlink VRF V2 which is not still implemented on Polygon Network.

The workshop followed to complete this repo is this one.


NFT Pug NFT Shiba NFT St.Bernard


Objetives

  1. Create NFT Collection ✅
  2. Each NFT has a "rarity" ✅
  3. Users pay for minting random NFTs ✅

Requirements for creating similar projects from scratch

  • Start hardhat project:
npm init -y
npm install --save-dev hardhat
npx hardhat
  • Add .gitignore file containing:
node_modules
.env
coverage
coverage.json
typechain

#Hardhat files
cache
artifacts
  • Install dependencies:
yarn add --dev @nomiclabs/hardhat-ethers@npm:hardhat-deploy-ethers ethers @nomiclabs/hardhat-etherscan @nomiclabs/hardhat-waffle chai ethereum-waffle hardhat hardhat-contract-sizer hardhat-deploy hardhat-gas-reporter prettier prettier-plugin-solidity solhint solidity-coverage dotenv @chainlink/contracts

or

npm install --save-dev @nomiclabs/hardhat-ethers@npm:hardhat-deploy-ethers ethers
npm install @nomiclabs/hardhat-ethers
npm install @chainlink/contracts
npm install dotenv --save

How to deploy

  • Rinkeby network:
npx hardhat deploy --network rinkeby 

or

yarn hardhat deploy --network rinkeby
  • Mint:
npm hardhat deploy --tags mint --network rinkeby

or

yarn hardhat deploy --tags mint --network rinkeby

Add Chainlink VRF Consumers

IMPORTAR: In order that our Contract works correctly with Chainlink VRF we need to add our Smart Contract Address as VRF consumer. To do so:

  1. Go to Chainlink VRF
  2. Create a 'Subscription' or use an existing one
  3. Add 'consumer': Smart Contract Address NOTICE: check that Subscription has enough funds (LINK)

Resources

About

NFT using IPFS and Chainlink VRF workshop from Chainlink Hackathon Spring 2022

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published