Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What is an Oracle in blockchain?
An Oracle is a service that provides external data to smart contracts, allowing them to interact with real-world information outside the blockchain.
Click to reveal answer
beginner
How does Chainlink provide data to smart contracts?
Chainlink uses decentralized nodes called oracles to fetch and verify data from external sources, then delivers this data securely to smart contracts on the blockchain.
Click to reveal answer
intermediate
What is the role of a Chainlink node?
A Chainlink node retrieves data from off-chain sources, processes it, and sends it to the blockchain, ensuring data accuracy and reliability.
Click to reveal answer
intermediate
Why is decentralization important in Chainlink oracles?
Decentralization prevents a single point of failure or manipulation by using multiple independent nodes to provide data, increasing trust and security.
Click to reveal answer
beginner
What is a Chainlink Request & Receive cycle?
It is the process where a smart contract sends a data request to Chainlink oracles, which then fetch and return the requested data back to the contract.
Click to reveal answer
What does a Chainlink oracle do?
AFetches and delivers external data to smart contracts
BCreates new cryptocurrencies
CMines blocks on the blockchain
DStores smart contract code
✗ Incorrect
Chainlink oracles fetch external data and deliver it to smart contracts to enable real-world interactions.
Why use multiple Chainlink nodes for data?
ATo store more data on-chain
BTo speed up mining
CTo reduce gas fees
DTo increase decentralization and data reliability
✗ Incorrect
Using multiple nodes avoids single points of failure and improves trustworthiness of data.
Which of these is NOT a function of Chainlink oracles?
AProviding off-chain data to smart contracts
BVerifying data accuracy
CExecuting smart contract code
DConnecting blockchain to external APIs
✗ Incorrect
Smart contracts execute code themselves; oracles only provide external data.
What triggers a Chainlink oracle to fetch data?
AA data request from a smart contract
BA new block mined
CA user sending cryptocurrency
DA change in gas price
✗ Incorrect
Chainlink oracles fetch data when a smart contract sends a request.
What is the main benefit of using Chainlink oracles?
ALower blockchain storage costs
BAccess to trusted real-world data for smart contracts
CFaster transaction speeds
DCreating new tokens
✗ Incorrect
Chainlink enables smart contracts to use reliable external data, expanding their usefulness.
Explain how Chainlink oracles connect smart contracts to real-world data.
Think about the request and response cycle between blockchain and outside world.
You got /4 concepts.
Describe why decentralization is important in Chainlink oracle networks.
Consider what happens if only one node provides data.
You got /4 concepts.
Practice
(1/5)
1. What is the main purpose of using Chainlink oracles in smart contracts?
easy
A. To encrypt data stored on the blockchain
B. To fetch real-world data securely into the blockchain
C. To create new tokens automatically
D. To speed up transaction processing on the blockchain
Solution
Step 1: Understand what oracles do
Oracles connect smart contracts to external data sources outside the blockchain.
Step 2: Identify the main use of Chainlink oracles
Chainlink oracles securely fetch real-world data like prices or weather into smart contracts.
Final Answer:
To fetch real-world data securely into the blockchain -> Option B
Quick Check:
Oracle purpose = fetch external data [OK]
Hint: Oracles bring outside data inside smart contracts [OK]
Common Mistakes:
Thinking oracles speed up blockchain transactions
Confusing oracles with token creation
Assuming oracles encrypt blockchain data
2. Which of the following is the correct way to declare a Chainlink request in Solidity?
easy
A. Chainlink.Request memory req = buildChainlinkRequest(jobId, address(this), this.fulfill.selector);
B. Chainlink.Request req = new Chainlink.Request(jobId, address(this), fulfill);
C. Request memory req = Chainlink.buildRequest(jobId, this, fulfill);
D. ChainlinkRequest req = buildRequest(jobId, this, fulfill.selector);
Solution
Step 1: Recall Chainlink request syntax
The correct syntax uses Chainlink.Request memory and buildChainlinkRequest function.
Step 2: Match the correct parameters
Parameters are jobId, contract address (address(this)), and fulfill function selector (this.fulfill.selector).
Final Answer:
Chainlink.Request memory req = buildChainlinkRequest(jobId, address(this), this.fulfill.selector); -> Option A
Hint: Use buildChainlinkRequest with memory and fulfill.selector [OK]
Common Mistakes:
Omitting 'memory' keyword
Using 'new' keyword incorrectly
Wrong function selector syntax
3. Given this Solidity snippet, what will be the value of data after fulfillment?
uint256 public data;
function fulfill(bytes32 _requestId, uint256 _value) public recordChainlinkFulfillment(_requestId) {
data = _value;
}
// Assume fulfill is called with _value = 42
medium
A. 0
B. RequestId bytes32 value
C. Compilation error
D. 42
Solution
Step 1: Understand fulfill function behavior
The fulfill function sets the contract's data variable to the passed _value.
Step 2: Apply given input value
Since fulfill is called with _value = 42, data becomes 42.
Final Answer:
42 -> Option D
Quick Check:
fulfill sets data = _value = 42 [OK]
Hint: fulfill sets data to passed _value parameter [OK]
Common Mistakes:
Confusing _requestId with _value
Assuming data stays zero
Thinking function causes error
4. Identify the error in this Chainlink oracle request code snippet: