Matic Contract: https://explorer-mainnet.maticvigil.com/address/0x7e039939FEA5a979e6366cb905d407C4bc92FB59/transactions
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
brownie bake nft-mix
cd nft
npm install -g ganache-cli
If you want to be able to deploy to testnets, do the following.
- Set your environment variables
Set your WEB3_INFURA_PROJECT_ID
, and PRIVATE_KEY
environment variables.
You can get a WEB3_INFURA_PROJECT_ID
by getting a free trial of Infura. At the moment, it does need to be infura with brownie. You can find your PRIVATE_KEY
from your ethereum wallet like metamask.
You'll also need testnet rinkeby ETH and LINK. You can get LINK and ETH into your wallet by using the rinkeby faucets located here. If you're new to this, watch this video.
Pinata keys can be found on Pinata.
You can add your environment variables to the .env
file:
export WEB3_INFURA_PROJECT_ID=<PROJECT_ID>
export PRIVATE_KEY=<PRIVATE_KEY>
export PINATA_API_KEY=<KEY>
export PINATA_API_SECRET=<KEY>
AND THEN RUN source .env
TO ACTIVATE THE ENV VARIABLES
(You'll need to do this everytime you open a new terminal, or learn how to set them easier)
Or you can run the above in your shell.
brownie run scripts/1_deploy_pokemon.py --network rinkeby
Optional:
brownie run scripts/2_add_base_pokemon_stats.py --network rinkeby
Then:
brownie run scripts/3_create_pokemon.py --network rinkeby
brownie run scripts/4_create_metadata.py --network rinkeby
brownie run scripts/5_set_tokenuri.py --network rinkeby
There are some helpful scripts in helpful_scripts.py
.
After running the last script, you'll see output like:
Awesome! You can view your NFT at https://testnets.opensea.io/assets/0x25F955AA3B6Ad6A3cd47Abd6FB55a277F751B7A0/0
Please give up to 20 minutes, and hit the "refresh metadata" button
brownie test
pip install black
pip install autoflake
autoflake --in-place --remove-unused-variables -r .
black .
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.
Shoutout to TheLinkMarines on twitter for the puppies!
Any questions? Join our Discord
This project is licensed under the MIT license.