An NFT Contract will mint one of the four Houses of Hogwarts. This smart contract is develop whit web3.py on Goerli Testnet.
- For interact with the contract you will need some Ethers ($ETH) and some Link (LINK) to be able to pay the gas fees. You can get $ETH for free via a faucet. (Chainlink)
- Solidity
- Python
- Brownie
- OpenZeppelin - A library for secure smart contract development.
- ChainLink VRFConsumerbase - Smart Contract for extract randomly a number betwen 0 and 3.
- Install Brownie, if you haven't already. Here is a simple way to install brownie.
pip install eth-brownie
Or, if that doesn't work, via pipx
pip install --user pipx
pipx ensurepath
# restart your terminal
pipx install eth-brownie
npm install -g ganache-cli
- Set your environment variables, if you want deploy to testnets
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 can add your environment variables to the .env
file:
export WEB3_INFURA_PROJECT_ID=<PROJECT_ID>
export PRIVATE_KEY=<PRIVATE_KEY>
Then, make sure your brownie-config.yaml
has:
dotenv: .env
brownie run scripts/deploy_and_create.py --network goerli
brownie run scripts/create_collectible.py --network goerli
Then:
brownie run scripts/create_metadata.py --network goerli
brownie run scripts/set_tokenuri.py --network goerli
Go to the folder called frontend
and go to the file index.html
and start the UI