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.
Please install or have installed the following:
- Install Brownie, if you haven't already. Here is a simple way to install brownie.
pip install eth-brownie
- Clone this repo
git clone https://github.com/PatrickAlphaC/nft-mix
cd nft-mix
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.
There are 2 types of NFTs here.
SimpleCollectibles.sol
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.
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.
brownie run scripts/simple_collectible/deploy_simple.py
brownie run scripts/simple_collectible/create_collectible.py
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
brownie test
(Tests are weak at the moment)
To get started with Brownie:
- Chainlink Documentation
- Check out the Chainlink documentation to get started from any level of smart contract engineering.
- Check out the other Brownie mixes that can be used as a starting point for your own contracts. They also provide example code to help you get started.
- "Getting Started with Brownie" is a good tutorial to help you familiarize yourself with Brownie.
- For more in-depth information, read the Brownie documentation.
Any questions? Join our Discord
This project is licensed under the MIT license.