You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-11Lines changed: 13 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,9 @@
1
1
# 🏃 Speedrun Chainlink
2
2
3
-
A beginner's guide to implimenting chainlink products in your smart contracts. Learn about how to get price feeds on chain, how to get a varifiably random number (VRF) on chain, and how to set up chainlink automation so that keeper nodes trigger your contract.
3
+
A beginner's guide to implimenting chainlink products with smart contracts. Dive into simplified examples that will teach you how to:
4
+
- Access price quotes for a variety of assets on a wide range of networks
5
+
- Generate veriably random numbers using the VRF Coordinator
6
+
- Configure Chainlink automation to execute transactions based on time intervals or conditional logic
4
7
5
8
## Table of Contents
6
9
@@ -33,7 +36,7 @@ yarn start
33
36
34
37
## 📈 Price Feeds
35
38
36
-
Chainlink price feeds offer a decentralized data source that provides price information for a range of assets pairs depending on the network. The price feeds are powered by a decentralized network of independent, security-reviewed, and Sybil-resistant oracle nodes. The `AggregatorV3Interface`is fixed to the price feed address used during instantiation, but the `FeedRegistry` is more flexible although it is only avaible on mainnet.
39
+
Chainlink price feeds bring off chain price quotes on chain using a decentralized network of oracles. The `FeedRegistry` contract is only avaible on mainnet, but the price feed addresses that power the `AggregatorV3Interface` are available on a wide range of networks.
37
40
38
41
### Steps
39
42
@@ -45,19 +48,18 @@ Chainlink price feeds offer a decentralized data source that provides price info
45
48
46
49
### Details
47
50
48
-
- The price returned by the price feed contract has a specified number of decimals that can be fetched from the price feed contract using the `decimals()` method
49
-
- The answer returned by the price feed contract is only updated if the price deviates beyond a specified threshold or if a certain amount of time has passed since the last update
50
-
-`FeedRegistry` is only available on Ethereum Mainnet, but `AggregatorV3Interface` is available on a variety of networks.
51
+
- The quote returned by the price feed contract has a specified number of decimals
52
+
- The quote returned by the price feed contract is only updated if the price deviates beyond a specified threshold or if a certain amount of time has passed since the last update
51
53
52
54
## 🎲 VRF (Verifiable Random Function)
53
55
54
-
Chainlink VRF provides access verifiably random numbers on chain. Each request for a random number costs LINK and the reponse is delivered on chain after requestConfirmations number of blocks. The VRFConsumer example uses the Direct Funding method, but you may prefer the Subscription method depending on your use case.
56
+
Chainlink VRF provides access to verifiably random numbers on chain. Each request for a random number costs LINK and the reponse is delivered after requestConfirmations number of blocks. The VRFConsumer example uses the Direct Funding method, but you may prefer the Subscription method depending on your use case.
55
57
56
58
### Steps
57
59
58
60
1. Set up your contract to inherit VRFV2WrapperConsumerBase
59
-
2. Impliment a function that triggers request for random number by calling the requestRandomness function which is inhereted from VRFV2WrapperConsumerBase
60
-
3. You must override the fullFillrandomWords function
61
+
2. Impliment a function that triggers request for random number by calling the requestRandomness function inhereted from VRFV2WrapperConsumerBase
62
+
3. You must override the fullFillrandomWords function inhereted from VRFV2WrapperConsumerBase
61
63
62
64
### Details
63
65
@@ -67,13 +69,13 @@ Chainlink VRF provides access verifiably random numbers on chain. Each request f
67
69
68
70
## 🤖 Automation
69
71
70
-
Chainlink Automation calls a smart contract function if a specified set of criteria are met. The time-based trigger calls a target function on a target contract every specified interval. The custom logic trigger allows your contract to use on-chain state to determine when to call a target function. The log trigger allows your contract to use event log data as both a trigger and an input.
72
+
Chainlink Automation calls a smart contract function if a specified set of criteria are met. The time-based trigger calls a target function on a target contract every specified interval. The custom logic trigger allows your contract to use on-chain state to determine when to call a target function. The log trigger allows your contract to use event log data as both a trigger and an input
71
73
72
74
### Steps
73
75
74
76
1. Decide which trigger fits best for your use case
75
-
2.Register a new upkeep with chainlink
76
-
3.Provide your target contract and target function
77
+
2.Import the appropriate interface and override the checkUpkeep and performUpkeep functions inhereted from the interface
78
+
3.Register a new upkeep with chainlink by providing your target contract address and depositing LINK tokens
0 commit comments