{"id":15065098,"url":"https://github.com/patrickalphac/nft-mix","last_synced_at":"2025-05-16T05:04:16.871Z","repository":{"id":40508706,"uuid":"343553753","full_name":"PatrickAlphaC/nft-mix","owner":"PatrickAlphaC","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-24T00:55:47.000Z","size":97,"stargazers_count":823,"open_issues_count":14,"forks_count":412,"subscribers_count":28,"default_branch":"main","last_synced_at":"2025-04-08T15:04:07.792Z","etag":null,"topics":["brownie","chainlink","nft","opensea","python","solidity"],"latest_commit_sha":null,"homepage":"","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PatrickAlphaC.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-03-01T20:53:15.000Z","updated_at":"2025-03-27T22:10:19.000Z","dependencies_parsed_at":"2022-09-13T11:50:41.759Z","dependency_job_id":"21decf85-3ab9-4bc5-8c92-1841ea5278e8","html_url":"https://github.com/PatrickAlphaC/nft-mix","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickAlphaC%2Fnft-mix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickAlphaC%2Fnft-mix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickAlphaC%2Fnft-mix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickAlphaC%2Fnft-mix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PatrickAlphaC","download_url":"https://codeload.github.com/PatrickAlphaC/nft-mix/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254471061,"owners_count":22076585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["brownie","chainlink","nft","opensea","python","solidity"],"created_at":"2024-09-25T00:34:01.841Z","updated_at":"2025-05-16T05:04:16.841Z","avatar_url":"https://github.com/PatrickAlphaC.png","language":"Solidity","readme":"\u003e Update: The code has been modified to use Sepolia as Rinkeby Testnet is not supported anymore.\n\n\u003e Update: You should use `ipfs://` instead of `https://ipfs.io/` for your tokenURI\n\n\n# nft-mix\n\n\u003cbr/\u003e\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://chain.link\" target=\"_blank\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/PatrickAlphaC/nft-mix/main/img/shiba-inu.png\" width=\"225\" alt=\"NFT Shiba Inu\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/PatrickAlphaC/nft-mix/main/img/pug.png\" width=\"225\" alt=\"NFT Pug\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/PatrickAlphaC/nft-mix/main/img/st-bernard.png\" width=\"225\" alt=\"NFT St.Bernard\"\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\u003cbr/\u003e\n\nThis is a repo to work with and use NFTs smart contracts in a python environment, using the Chainlink-mix as a starting point. \n\nIf you'd like to see another repo using random NFTs that are deployed to mainnet, check out the [D\u0026D package](https://github.com/PatrickAlphaC/dungeons-and-dragons-nft).\n\n## Prerequisites\n\nPlease install or have installed the following:\n\n- [nodejs and npm](https://nodejs.org/en/download/)\n- [python](https://www.python.org/downloads/)\n## Installation\n\n1. [Install Brownie](https://eth-brownie.readthedocs.io/en/stable/install.html), if you haven't already. Here is a simple way to install brownie.\n\n```bash\npip install eth-brownie\n```\nOr, if that doesn't work, via pipx\n```bash\npip install --user pipx\npipx ensurepath\n# restart your terminal\npipx install eth-brownie\n```\n\n2. Clone this repo\n```\nbrownie bake nft-mix\ncd nft\n```\n\n1. [Install ganache-cli](https://www.npmjs.com/package/ganache-cli)\n\n```bash\nnpm install -g ganache-cli\n```\n\nIf you want to be able to deploy to testnets, do the following. \n\n4. Set your environment variables\n\nSet your `WEB3_INFURA_PROJECT_ID`, and `PRIVATE_KEY` [environment variables](https://www.twilio.com/blog/2017/01/how-to-set-environment-variables.html). \n\nYou can get a `WEB3_INFURA_PROJECT_ID` by getting a free trial of [Infura](https://infura.io/). At the moment, it does need to be infura with brownie. You can find your `PRIVATE_KEY` from your ethereum wallet like [metamask](https://metamask.io/). \n\nYou'll also need testnet Sepolia ETH and LINK. You can get LINK and ETH into your wallet by using the [Sepolia faucets located here](https://faucets.chain.link/sepolia). If you're new to this, [watch this video.](https://www.youtube.com/watch?v=P7FX_1PePX0)\n\nYou can add your environment variables to the `.env` file:\n\n```\nexport WEB3_INFURA_PROJECT_ID=\u003cPROJECT_ID\u003e\nexport PRIVATE_KEY=\u003cPRIVATE_KEY\u003e\n```\n\nThen, make sure your `brownie-config.yaml` has:\n\n```\ndotenv: .env\n```\n\nYou can also [learn how to set environment variables easier](https://www.twilio.com/blog/2017/01/how-to-set-environment-variables.html)\n\n\nOr you can run the above in your shell. \n\n\n# Usage\n\nThere are 2 types of NFTs here. \n1. `SimpleCollectibles.sol`\n2. `AdvancedCollectibles.sol`\n\nThey each deploy unique dogs. The advanced version gives you a random breed (out of a Pug, Shiba Inu, and St. Bernard).\n\nThe advanced collection uses a [Chainlink VRF](https://docs.chain.link/docs/get-a-random-number) to deploy the random dog. \n\nYou can 100% use the Sepolia testnet to see your NFTs rendered on opensea, but it's suggested that you test and build on a local development network so you don't have to wait as long for transactions. \n\n### Running Scripts\n\nThe simple collectibles work on a local network, however the advanced requires a testnet. When the video tutorial was launched, Rinkeby was used, but ever since it was discontinued we have switched to Sepolia as it is the testing standard for NFT platforms. You will need testnet Sepolia ETH and testnet Sepolia LINK. You can find faucets for both in the [Chainlink documentation](https://docs.chain.link/resources/link-token-contracts). \n\n# For the Simple ERC721\n```\nbrownie run scripts/simple_collectible/deploy_simple.py --network sepolia\nbrownie run scripts/simple_collectible/create_collectible.py --network sepolia\n```\n\n# For the Advanced ERC721\n\nYou'll need [testnet ETH](https://sepoliafaucet.com/) and [testnet LINK](https://faucets.chain.link/sepolia/) in the wallet associated with your private key. \n\n```\nbrownie run scripts/advanced_collectible/deploy_advanced.py --network sepolia\nbrownie run scripts/advanced_collectible/create_collectible.py --network sepolia\n```\nThen:\n```\nbrownie run scripts/advanced_collectible/create_metadata.py --network sepolia\nbrownie run scripts/advanced_collectible/set_tokenuri.py --network sepolia\n```\n\n# Verify on Etherscan\n\nThe simple contract and the advanced contract can be verified if you just set your `ETHERSCAN_TOKEN`. \n\n## Misc\nThere are some helpful scripts in `helpful_scripts.py`.\n\n# Viewing on OpenSea\nAfter running the scripts from the `For the Advanced ERC721` section\n\n1. Create the metadata\n\nMetadata is the URI needed to upload data. You can either:\n- Upload to IPFS yourself\n- Use the metadata already created when you cloned this repo. \n\n### If you want to upload to IPFS yourself\n\nDownload [IPFS](https://ipfs.io/) \nSet `export IPFS_URL=http://127.0.0.1:5001` and `export UPLOAD_IPFS=true` environment variables\nRun the IPFS daemon: `ipfs daemon`\nThen Run\n```\nbrownie run scripts/advanced_collectible/create_metadata.py --network sepolia\n```\n\nAlternatively, you could upload the uri manually:\nAdd the file created in `metadata/sepolia/NAME.json` to [IPFS](https://ipfs.io/) or [Pinata](https://pinata.cloud/). \n### If you want to use the metadata from this repo\n\nJust run:\n```\nbrownie run scripts/advanced_collectible/create_metadata.py --network sepolia\n```\n\n2. Set the tokenURI \nRun\n```\nbrownie run scripts/advanced_collectible/set_tokenuri.py --network sepolia\n```\nAnd after some time, (you may have to wait up to 20 minutes for it to render on opensea), you should see your NFT on opensea! [It'll look something like this.](https://testnets.opensea.io/assets/0x8acb7ca932892eb83e4411b59309d44dddbc4cdf/0)\n\n## *NEW* Pinata\n\nIf you want to auto-upload to pinata instead of IPFS automatically, you can do so by getting a [Pinata API Key.](https://pinata.cloud/documentation#GettingStarted)\n\nYou'll need the following environment variables (you can get them from Pinata)\n```\nPINATA_API_KEY\nPINATA_API_SECRET\n```\nThen run:\n```\npython scripts/upload_to_pinata.py\n```\n\n## Testing\n\n```\nbrownie test\n```\n\n## Linting\n\n```\npip install black \npip install autoflake\nautoflake --in-place --remove-unused-variables -r .\nblack .\n```\n\n## Resources\n\nTo get started with Brownie:\n\n* [Chainlink Documentation](https://docs.chain.link/docs)\n* Check out the [Chainlink documentation](https://docs.chain.link/docs) to get started from any level of smart contract engineering. \n* Check out the other [Brownie mixes](https://github.com/brownie-mix/) that can be used as a starting point for your own contracts. They also provide example code to help you get started.\n* [\"Getting Started with Brownie\"](https://medium.com/@iamdefinitelyahuman/getting-started-with-brownie-part-1-9b2181f4cb99) is a good tutorial to help you familiarize yourself with Brownie.\n* For more in-depth information, read the [Brownie documentation](https://eth-brownie.readthedocs.io/en/stable/).\n\nShoutout to [TheLinkMarines](https://twitter.com/TheLinkMarines) on twitter for the puppies!\n\nAny questions? Join our [Discord](https://discord.gg/2YHSAey)\n\n## License\n\nThis project is licensed under the [MIT license](LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickalphac%2Fnft-mix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrickalphac%2Fnft-mix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickalphac%2Fnft-mix/lists"}