Reputation: 187
I have done with several price feed Aggregator using @chainlink. Now I am working on KCC and need the price feed as well.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
contract PriceTest {
AggregatorV3Interface internal priceFeed;
constructor() {
priceFeed = AggregatorV3Interface(0x0567F2323251f0Aab15c8dFb1967E4e8A7D42aeE); // for BSC Main Net
priceFeed = AggregatorV3Interface(0xcf0f51ca2cDAecb464eeE4227f5295F2384F84ED); // for Rinkeby
priceFeed = AggregatorV3Interface(0xd0D5e3DB44DE05E9F294BB0a3bEEaF030DE24Ada); // for mumbai tesnet
// KCC test Net and KCC Mainnet.....????
}
function getLatestPrice() public view returns (uint256) {
(,int price,,,) = priceFeed.latestRoundData();
return uint256(price);
}
}
Upvotes: 1
Views: 99
Reputation: 631
There are currently no data feeds supporting KCC pairs. Addresses for currently supported price pairs can be found in the Chainlink docs. If there is no data feed for a currency pair you can try the following steps:
Upvotes: 1