Whitepaper
Search
K
💡

Blockchain Source

Powered by Chainlink
✅ Market Data
✅ Weather Data
✅ Sports Data
✅ Automation
✅ Randomness
function getThePrice() public view returns (int) {
(
uint80 roundID,
int price,
uint startedAt,
uint timeStamp,
uint80 answeredInRound
) = priceFeed.latestRoundData();
return price;
}
function requestAvgTemp(
) external {
Chainlink.Request memory req = buildChainlinkRequest(
avgTempJobId,
address(this),
this.fulfillAvgTemp.selector
);
sendChainlinkRequest(req, fee);
}
function requestScore(
) external {
Chainlink.Request memory req = buildChainlinkRequest(
sportScoreJobId,
address(this),
this.fulfillWinner.selector
);
sendChainlinkRequest(req, fee);
}
function checkUpkeep(
bytes calldata checkData
)
external
returns (
bool upkeepNeeded,
bytes memory performData
);
unit256 public randomResult;
function fulfillRandomness(uint256 requestId, unit256[] randomness) internal override {
randomResult = (randomness[0] % 50) + 1;
}