Skip to content

Latest commit

 

History

History
106 lines (72 loc) · 3.88 KB

README.md

File metadata and controls

106 lines (72 loc) · 3.88 KB

nft-mix


Chainlink Brownie logo


This is a repo to work with and use NFTs smart contracts in a python environment, using the Chainlink-mix as a starting point.

If you'd like to see another repo using random NFTs that are deployed to mainnet, check out the D&D package.

Prerequisites

Please install or have installed the following:

Installation

  1. Install Brownie, if you haven't already. Here is a simple way to install brownie.
pip install eth-brownie
  1. Clone this repo
git clone https://github.com/PatrickAlphaC/nft-mix
cd nft-mix
  1. Install ganache-cli and openzepplin contracts
npm install -g ganache-cli
npm install @openzeppelin/contracts

If you want to be able to deploy to testnets, do the following.

Set your WEB3_INFURA_PROJECT_ID, and PRIVATE_KEY environment variables. You can get this by getting a free trial of Infura. At the moment, it does need to be infura. You can find your PRIVATE_KEY from your ethereum wallet like metamask.

For those not familiar with environment variables, just run:

export WEB3_INFURA_PROJECT_ID=<PROJECT_ID>
export PRIVATE_KEY=<PRIVATE_KEY>

Just know, that when you restart your shell/terminal, these environment variables are removed.

Useage

There are 2 types of NFTs here.

  1. SimpleCollectibles.sol
  2. AdvancedCollectibles.sol

They each deploy unique dogs. The advanced version gives you a random breed (out of a Pug, Shiba Inu, and St. Brenard).

The advanced collection uses a Chainlink VRF to deploy the random dog.

Running Scripts

The simple collectibles work on a local network, however the advanced requires a testnet. We default to rinkeby since that seems to be the testing standard for NFT platforms.

For the Simple ERC721

brownie run scripts/simple_collectible/deploy_simple.py
brownie run scripts/simple_collectible/create_collectible.py

For the Advanced ERC721

You'll need testnet Rinkeby and testnet LINK in the wallet associated with your private key.

brownie run scripts/advanced_collectible/deploy_advanced.py --network rinkeby
brownie run scripts/advanced_collectible/fund_collectible.py --network rinkeby
brownie run scripts/advanced_collectible/create_collectible.py --network rinkeby

Testing

brownie test

(Tests are weak at the moment)

Resources

To get started with Brownie:

Any questions? Join our Discord

License

This project is licensed under the MIT license.