This is my code. After deploying it to Kovan Test Net. Whenever I try to run the function getPrice() it returns :

call to PriceConsumerV3.getPrice errored: Error: VM execution error. Reverted 0x 
pragma solidity ^0.6.7;

import "@chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol";

contract PriceConsumerV3{
    AggregatorV3Interface internal priceFeed;
     * Aggregator : 1INCH/ETH 
    constructor() public{
        priceFeed = AggregatorV3Interface( 0x231e764B44b2C1b7Ca171fa8021A24ed520Cde10);
    function getPrice() public view returns(int){
            uint80 roundID,
        int price,
        uint startedAt,
        uint timeStamp,
        uint80 answeredInRound
        )= priceFeed.latestRoundData();
        return price;

0x231e764B44b2C1b7Ca171fa8021A24ed520Cde10 is the ADX / USD MAINNET price feed address. It looks like you're looking for a kovan price feed address.

Please view the kovan price feeds to get the correct address.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.