/pokemon-nft

Pokémon NFTs

Primary LanguageSolidityMIT LicenseMIT

Pokemon NFTs

Matic Contract: https://explorer-mainnet.maticvigil.com/address/0x7e039939FEA5a979e6366cb905d407C4bc92FB59/transactions


NFT Pokemon


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
brownie bake nft-mix
cd nft
  1. Install ganache-cli
npm install -g ganache-cli

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

  1. 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.

Useage

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

Misc

There are some helpful scripts in helpful_scripts.py.

Viewing on OpenSea

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

Testing

brownie test

Linting

pip install black 
pip install autoflake
autoflake --in-place --remove-unused-variables -r .
black .

Resources

To get started with Brownie:

Shoutout to TheLinkMarines on twitter for the puppies!

Any questions? Join our Discord

License

This project is licensed under the MIT license.