{"id":19498090,"url":"https://github.com/patrickalphac/vrf_pizza","last_synced_at":"2025-08-20T18:59:56.382Z","repository":{"id":104134889,"uuid":"345451548","full_name":"PatrickAlphaC/vrf_pizza","owner":"PatrickAlphaC","description":"lol","archived":false,"fork":false,"pushed_at":"2021-03-12T17:16:29.000Z","size":88,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-25T22:35:12.196Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-03-07T20:57:47.000Z","updated_at":"2023-01-25T07:37:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"dff8f014-4e00-4053-9c45-0fe1ea4423cb","html_url":"https://github.com/PatrickAlphaC/vrf_pizza","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PatrickAlphaC/vrf_pizza","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickAlphaC%2Fvrf_pizza","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickAlphaC%2Fvrf_pizza/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickAlphaC%2Fvrf_pizza/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickAlphaC%2Fvrf_pizza/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PatrickAlphaC","download_url":"https://codeload.github.com/PatrickAlphaC/vrf_pizza/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickAlphaC%2Fvrf_pizza/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271369329,"owners_count":24747793,"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","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-10T21:49:11.894Z","updated_at":"2025-08-20T18:59:56.354Z","avatar_url":"https://github.com/PatrickAlphaC.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chainlink-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/smartcontractkit/chainlink-mix/master/img/chainlink-brownie.png\" width=\"225\" alt=\"Chainlink Brownie logo\"\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\u003cbr/\u003e\n\n[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/smartcontractkit/chainlink-mix.svg)](http://isitmaintained.com/project/smartcontractkit/chainlink-mix \"Average time to resolve an issue\")\n[![Percentage of issues still open](http://isitmaintained.com/badge/open/smartcontractkit/chainlink-mix.svg)](http://isitmaintained.com/project/smartcontractkit/chainlink-mix \"Percentage of issues still open\")\n\nThis is a repo to work with and use Chainlink smart contracts in a python environment. If you're brand new to Chainlink, check out the beginner walkthroughs in remix to [learn the basics.](https://docs.chain.link/docs/beginners-tutorial)\n\nYou can also check out the more advanced Chainlink tutorials there as well. \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```\n\n2. [Install ganache-cli](https://www.npmjs.com/package/ganache-cli)\n\n```bash\nnpm install -g ganache-cli\n```\n\n3. Download the mix. \n\n```bash\nbrownie bake chainlink-mix\ncd chainlink-mix\n```\n\nThis will open up a new Chainlink project. Or, you can clone from source:\n\n```bash\ngit clone https://github.com/PatrickAlphaC/chainlink-mix\ncd chainlink-mix \n```\n\nIf you want to be able to deploy to testnets, do the following. \n\n1. Set your `WEB3_INFURA_PROJECT_ID`, and `PRIVATE_KEY` [environment variables](https://www.twilio.com/blog/2017/01/how-to-set-environment-variables.html). You can get this by getting a free trial of [Infura](https://infura.io/). At the moment, it does need to be infura. You can find your `PRIVATE_KEY` from your ethereum wallet like [metamask](https://metamask.io/). \n\nOtherwise, you can build, test, and deploy on your local environment. \n\n## Chainlink Price Feeds\n\nThis mix provides a simple template for working with Chainlink Smart Contracts. The easiest way to start is to fork the mainnet chain to a local ganache chain. This will allow you to deploy local smart contracts to interact with the [Chainlink Price Feeds](https://docs.chain.link/docs/get-the-latest-price). \n\n### Running Scripts\n\nThis will deploy a smart contract to kovan and then read you the latest price via [Chainlink Price Feeds](https://docs.chain.link/docs/get-the-latest-price). \n```\nbrownie run scripts/price_feed_scripts/deploy_price_consumer_v3.py --network kovan\nbrownie run scripts/price_feed_scripts/read_price_feed.py --network kovan\n```\n\nOtherwise, you can fork mainnet and use that in a local ganache development environment.\n```bash\nbrownie console --network mainnet-fork\n\u003e\u003e\u003e price_feeds = PriceFeed.deploy('0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419', {'from': accounts[0]})\n.\n.\n\u003e\u003e\u003e latest_price = price_feeds.getLatestPrice()\n\u003e\u003e\u003e latest_price\n59169208540\n```\n\n## Chainlink VRF\n\nThis will deploy a smart contract to kovan and get a Random number via [Chainlink VRF](https://docs.chain.link/docs/get-a-random-number). \n```\nbrownie run scripts/price_feed_scripts/deploy_vrf.py --network kovan\nbrownie run scripts/price_feed_scripts/fund_vrf.py --network kovan\nbrownie run scripts/price_feed_scripts/request_randomness.py --network kovan\nbrownie run scripts/price_feed_scripts/read_random_number.py --network kovan\n```\n\n## Chainlink API Call\n\n\nThis will deploy a smart contract to kovan and then make an API call via [Chainlink API Call](https://docs.chain.link/docs/make-a-http-get-request). \n```\nbrownie run scripts/price_feed_scripts/deploy_api_consumer.py --network kovan\nbrownie run scripts/price_feed_scripts/fund_chainlink_api.py --network kovan\nbrownie run scripts/price_feed_scripts/request_api.py --network kovan\nbrownie run scripts/price_feed_scripts/read_api.py --network kovan\n```\n\n## Testing\n\n```\nbrownie test\n```\n\nFor more information on effective testing with Chainlink, check out [Testing Smart Contracts](https://blog.chain.link/testing-chainlink-smart-contracts/)\n\nTests are really robust here! They work for local development and testnets. There are a few key differences between the testnets and the local networks. We utilize mocks so we can work with fake oracles on our testnets. \n\nThere is a `test_unnecessary` folder, which is a good exersize for learning some of the nitty-gritty of smart contract development. It's overkill, so pytest will skip them intentionally. It also has a `test_samples` folder, which shows an example Chainlink API call transaction receipt. \n\n\n### To test development / local\n```bash\nbrownie test\n```\n### To test mainnet-fork\nThis will test the same way as local testing, but you will need a connection to a mainnet blockchain (like with the infura environment variable.)\n```bash\nbrownie test --network mainnet-fork\n```\n### To test a testnet\nKovan and Rinkeby are currently supported\n```bash\nbrownie test --network kovan\n```\n\n## Adding additional Chains\n\nIf the blockchain is EVM Compatible, adding new chains can be accomplished by something like:\n\n```\nbrownie networks add Ethereum binance-smart-chain host=https://bsc-dataseed1.binance.org chainid=56\n```\nor, for a fork: \n\n```\nbrownie networks add development binance-fork cmd=ganache-cli host=http://127.0.0.1 fork=https://bsc-dataseed1.binance.org accounts=10 mnemonic=brownie port=8545\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\n\nAny questions? Join our [Discord](https://discord.gg/2YHSAey)\n\n## License\n\nThis project is licensed under the [MIT license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickalphac%2Fvrf_pizza","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrickalphac%2Fvrf_pizza","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickalphac%2Fvrf_pizza/lists"}