Complete the code to import the Chainlink client interface.
import [1] from '@chainlink/contracts/src/v0.8/ChainlinkClient.sol';
The correct import is ChainlinkClient, which provides the functions to interact with Chainlink oracles.
Complete the code to set the Chainlink oracle address in the constructor.
constructor() {
setChainlinkOracle([1]);
}You need to pass the actual oracle address variable, usually named oracleAddress, to the setChainlinkOracle function.
Fix the error in the request function to correctly build the Chainlink request.
function requestData() public returns (bytes32 requestId) {
Chainlink.Request memory req = buildChainlinkRequest([1], address(this), this.fulfill.selector);
return sendChainlinkRequest(req, fee);
}The buildChainlinkRequest function requires the jobId as the first argument to specify the job to run on the oracle.
Fill both blanks to add a URL and a path to the Chainlink request.
req.add([1], [2]);
To request data, you add the 'get' key with the URL as value to the request.
Fill all three blanks to add the path and multiply the result in the Chainlink request.
req.add([1], [2]); req.addInt([3], 100);
You add the 'path' key with the JSON path string, then add an integer 'times' to multiply the result.