-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Set Sepolia as default testnet instead of Goerli * Chainlink Keepers is now Chainlink Automation
- Loading branch information
1 parent
f5a7516
commit 9547384
Showing
8 changed files
with
76 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
> NOTE: With Rinkeby and Kovan being deprecated, the new default is goerli. | ||
> NOTE: The new default is Sepolia. | ||
# chainlink-mix | ||
|
||
|
@@ -28,7 +28,7 @@ You can also check out the more advanced Chainlink tutorials there as well. | |
- [Chainlink Price Feeds](#chainlink-price-feeds) | ||
- [Chainlink VRF](#chainlink-vrf) | ||
- [Chainlink API Call](#chainlink-api-call) | ||
- [Chainlink Keeper Deployment](#chainlink-keeper-deployment) | ||
- [Chainlink Automation Deployment](#chainlink-automation-deployment) | ||
- [Local Development](#local-development-1) | ||
- [Testing](#testing) | ||
- [To test development / local](#to-test-development--local) | ||
|
@@ -43,8 +43,8 @@ You can also check out the more advanced Chainlink tutorials there as well. | |
|
||
Please install or have installed the following: | ||
|
||
- [nodejs and npm](https://nodejs.org/en/download/) | ||
- [python](https://www.python.org/downloads/) | ||
- [nodejs and npm](https://nodejs.org/en/download/) | ||
- [python](https://www.python.org/downloads/) | ||
|
||
## Installation | ||
|
||
|
@@ -86,7 +86,7 @@ Set your `WEB3_INFURA_PROJECT_ID`, and `PRIVATE_KEY` [environment variables](htt | |
|
||
You 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. If you get lost, you can [follow this guide](https://ethereumico.io/knowledge-base/infura-api-key-guide/) to getting a project key. You can find your `PRIVATE_KEY` from your ethereum wallet like [metamask](https://metamask.io/). | ||
|
||
You'll also need testnet ETH and LINK. You can get LINK and ETH into your wallet by using the [faucets located here](https://faucets.chain.link/). If you're new to this, [watch this video.](https://www.youtube.com/watch?v=P7FX_1PePX0). Look at the `goeli` section for those specific testnet faucets. | ||
You'll also need testnet ETH and LINK. You can get LINK and ETH into your wallet by using the [faucets located here](https://faucets.chain.link/). If you're new to this, [watch this video.](https://www.youtube.com/watch?v=P7FX_1PePX0). Look at the `sepolia` section for those specific testnet faucets. | ||
|
||
You can add your environment variables to a `.env` file. You can use the [.env.exmple](https://github.com/smartcontractkit/chainlink-mix/blob/master/.env.example) as a template, just fill in the values and rename it to '.env'. Then, uncomment the line `# dotenv: .env` in `brownie-config.yaml` | ||
|
||
|
@@ -134,19 +134,25 @@ This mix provides a simple template for working with Chainlink Smart Contracts. | |
|
||
> NOTE: It's highly encouraged that you work with a local chain before testing on a testnet. You'll be a much faster developer! | ||
If Sepolia network is not added to brownie by default, run: | ||
|
||
``` | ||
brownie networks add Ethereum sepolia host=https://sepolia.infura.io/v3/$WEB3_INFURA_PROJECT_ID chainid=11155111 explorer=https://sepolia.etherscan.io/ | ||
``` | ||
|
||
### Chainlink Price Feeds | ||
|
||
This will deploy a smart contract to goerli and then read you the latest price via [Chainlink Price Feeds](https://docs.chain.link/docs/get-the-latest-price). | ||
This will deploy a smart contract to Sepolia and then read you the latest price via [Chainlink Price Feeds](https://docs.chain.link/docs/get-the-latest-price). | ||
|
||
``` | ||
brownie run scripts/price_feed_scripts/01_deploy_price_consumer_v3.py --network goerli | ||
brownie run scripts/price_feed_scripts/02_read_price_feed.py --network goerli | ||
brownie run scripts/price_feed_scripts/01_deploy_price_consumer_v3.py --network sepolia | ||
brownie run scripts/price_feed_scripts/02_read_price_feed.py --network sepolia | ||
``` | ||
|
||
Or, you can use [ENS](https://docs.chain.link/docs/ens) | ||
|
||
``` | ||
brownie run scripts/price_feed_scripts/02_read_price_feed_with_ens.py --network goerli | ||
brownie run scripts/price_feed_scripts/02_read_price_feed_with_ens.py --network sepolia | ||
``` | ||
|
||
Otherwise, you can fork mainnet and use that in a local ganache development environment. | ||
|
@@ -165,39 +171,39 @@ You can also use [ENS](https://docs.chain.link/docs/ens) to get prices. See the | |
|
||
### Chainlink VRF | ||
|
||
This will deploy a smart contract to goerli and get a Random number via [Chainlink VRF](https://docs.chain.link/docs/get-a-random-number). | ||
This will deploy a smart contract to Sepolia and get a Random number via [Chainlink VRF](https://docs.chain.link/docs/get-a-random-number). | ||
|
||
If you haven't created and funded a subscription on [vrf.chain.link](https://vrf.chain.link/) you can do so on the UI, or by running: | ||
|
||
``` | ||
brownie run scripts/vrf_scripts/create_subscription.py --network goerli | ||
brownie run scripts/vrf_scripts/create_subscription.py --network sepolia | ||
``` | ||
|
||
Before running the next scripts. Running `01_deploy_vrf` will also add your consumer contract to the registry. | ||
|
||
``` | ||
brownie run scripts/vrf_scripts/01_deploy_vrf.py --network goerli | ||
brownie run scripts/vrf_scripts/02_request_randomness.py --network goerli | ||
brownie run scripts/vrf_scripts/03_read_random_number.py --network goerli | ||
brownie run scripts/vrf_scripts/01_deploy_vrf_consumer.py --network sepolia | ||
brownie run scripts/vrf_scripts/02_request_randomness.py --network sepolia | ||
brownie run scripts/vrf_scripts/03_read_random_number.py --network sepolia | ||
``` | ||
|
||
### Chainlink API Call | ||
|
||
This will deploy a smart contract to goerli and then make an API call via [Chainlink API Call](https://docs.chain.link/docs/make-a-http-get-request). | ||
This will deploy a smart contract to Sepolia and then make an API call via [Chainlink API Call](https://docs.chain.link/docs/make-a-http-get-request). | ||
|
||
``` | ||
brownie run scripts/chainlink_api_scripts/01_deploy_api_consumer.py --network goerli | ||
brownie run scripts/chainlink_api_scripts/02_request_api.py --network goerli | ||
brownie run scripts/chainlink_api_scripts/03_read_data.py --network goerli | ||
brownie run scripts/chainlink_api_scripts/01_deploy_api_consumer.py --network sepolia | ||
brownie run scripts/chainlink_api_scripts/02_request_api.py --network sepolia | ||
brownie run scripts/chainlink_api_scripts/03_read_data.py --network sepolia | ||
``` | ||
|
||
### Chainlink Keeper Deployment | ||
### Chainlink Automation Deployment | ||
|
||
This is just to show you how to deploy the Keepers, you can learn more about registering them in the [Chainlink Keeper](https://docs.chain.link/docs/chainlink-keepers/compatible-contracts/) documentation. | ||
This is just to show you how to deploy the Automation Compatible contracts, you can learn more about registering & using them in the [Automate Contracts](https://docs.chain.link/chainlink-automation/compatible-contracts/) section of the Chainlink documentation. | ||
|
||
``` | ||
brownie run scripts/keeper_scripts/01_deploy_keeper_counter.py --network goerli | ||
brownie run scripts/keeper_scripts/02_check_upkeep.py --network goerli | ||
brownie run scripts/automation_scripts/01_deploy_automation_counter.py --network sepolia | ||
brownie run scripts/automation_scripts/02_check_upkeep.py --network sepolia | ||
``` | ||
|
||
### Local Development | ||
|
@@ -232,10 +238,10 @@ brownie test --network mainnet-fork | |
|
||
### To test a testnet | ||
|
||
Goerli is currently supported. Please check the Chainlink docs for which products are supported on which chains. | ||
Sepolia is currently supported. Please check the Chainlink docs for which products are supported on which chains. | ||
|
||
```bash | ||
brownie test --network goerli | ||
brownie test --network sepolia | ||
``` | ||
|
||
## Adding additional Chains | ||
|
@@ -265,10 +271,10 @@ If you're using [vscode](https://code.visualstudio.com/) and the [solidity exten | |
|
||
```json | ||
{ | ||
"solidity.remappings": [ | ||
"@chainlink/=[YOUR_HOME_DIR]/.brownie/packages/smartcontractkit/[email protected]", | ||
"@openzeppelin/=[YOUR_HOME_DIR]/.brownie/packages/OpenZeppelin/[email protected]" | ||
] | ||
"solidity.remappings": [ | ||
"@chainlink/=[YOUR_HOME_DIR]/.brownie/packages/smartcontractkit/[email protected]", | ||
"@openzeppelin/=[YOUR_HOME_DIR]/.brownie/packages/OpenZeppelin/[email protected]" | ||
] | ||
} | ||
``` | ||
|
||
|
@@ -278,11 +284,11 @@ This will quiet the linting errors it gives you. | |
|
||
To get started with Brownie: | ||
|
||
- [Chainlink Documentation](https://docs.chain.link/docs) | ||
- Check out the [Chainlink documentation](https://docs.chain.link/docs) to get started from any level of smart contract engineering. | ||
- 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. | ||
- ["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. | ||
- For more in-depth information, read the [Brownie documentation](https://eth-brownie.readthedocs.io/en/stable/). | ||
- [Chainlink Documentation](https://docs.chain.link/docs) | ||
- Check out the [Chainlink documentation](https://docs.chain.link/docs) to get started from any level of smart contract engineering. | ||
- 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. | ||
- ["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. | ||
- For more in-depth information, read the [Brownie documentation](https://eth-brownie.readthedocs.io/en/stable/). | ||
|
||
Any questions? Join our [Discord](https://discord.gg/2YHSAey) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,10 @@ autofetch_sources: true | |
compiler: | ||
solc: | ||
remappings: | ||
- "@chainlink=smartcontractkit/chainlink-brownie-contracts@0.4.0" | ||
- "@chainlink=smartcontractkit/chainlink-brownie-contracts@0.6.1" | ||
- "@openzeppelin=OpenZeppelin/[email protected]" | ||
dependencies: | ||
- smartcontractkit/chainlink-brownie-contracts@0.4.0 | ||
- smartcontractkit/chainlink-brownie-contracts@0.6.1 | ||
- OpenZeppelin/[email protected] | ||
networks: | ||
default: development | ||
|
@@ -23,25 +23,25 @@ networks: | |
keyhash: "0x6c3699283bda56ad74f6b855546325b68d482e983852a7a82979cc4807b641f4" | ||
update_interval: 60 | ||
verify: false | ||
goerli: | ||
eth_usd_price_feed: "0xD4a33860578De61DBAbDc8BFdb98FD742fA7028e" | ||
fee: 100000000000000000 | ||
fund_amount: 5000000000000000000 | ||
gas_lane: "0x79d3d8832d904592c0bf9818b621522c988bb8b0c05cdc3b15aea1b6e8db0c15" | ||
jobId: ca98366cc7314957b8c012c72f05aeeb | ||
keyhash: "0x79d3d8832d904592c0bf9818b621522c988bb8b0c05cdc3b15aea1b6e8db0c15" | ||
link_token: "0x326C977E6efc84E512bB9C30f76E30c160eD06FB" | ||
oracle: "0xCC79157eb46F5624204f47AB42b3906cAA40eaB7" | ||
update_interval: 60 | ||
subscription_id: 1562 | ||
verify: false | ||
vrf_coordinator: "0x2Ca8E0C643bDe4C2E08ab1fA0da3401AdAD7734D" | ||
mumbai: | ||
eth_usd_price_feed: "0x0715A7794a1dc8e42615F059dD6e406A6594651A" | ||
fee: 1000000000000000000 | ||
keyhash: "0x6e75b569a01ef56d18cab6a8e71e6600d6ce853834d4a5748b720d06f878b3a4" | ||
link_token: "0x326C977E6efc84E512bB9C30f76E30c160eD06FB" | ||
vrf_coordinator: "0x8C7382F9D8f56b33781fE506E897a4F1e2d17255" | ||
sepolia: | ||
eth_usd_price_feed: "0x694AA1769357215DE4FAC081bf1f309aDC325306" | ||
fee: 100000000000000000 | ||
fund_amount: 5000000000000000000 | ||
gas_lane: "0x474e34a077df58807dbe9c96d3c009b23b3c6d0cce433e59bbf5b34f823bc56c" | ||
jobId: ca98366cc7314957b8c012c72f05aeeb | ||
keyhash: "0x474e34a077df58807dbe9c96d3c009b23b3c6d0cce433e59bbf5b34f823bc56c" | ||
link_token: "0x779877A7B0D9E8603169DdbD7836e478b4624789" | ||
oracle: "0x6090149792dAAeE9D1D568c9f9a6F6B46AA29eFD" | ||
subscription_id: 20 | ||
update_interval: 60 | ||
verify: false | ||
vrf_coordinator: "0x8103B0A8A00be2DDC778e6e7eaa21791Cd364625" | ||
reports: | ||
exclude_contracts: | ||
- SafeMath | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters