Hello iam trying to get the latest price data using Chainlink Data Feeds but it throws this error :
pragma solidity 0.7.6;
// SPDX-License-Identifier: MIT
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
import "contracts/Token.sol";
contract DonateContract {
AggregatorV3Interface internal priceFeed;
address payable owner; // contract creator's address
constructor() {
priceFeed =
AggregatorV3Interface(0x2514895c72f50D8bd4B4F9b1110F0D6bD2c97526);
owner = payable(msg.sender); // setting the contract creator
}
function donate(uint256 _payAmount) public payable {
(bool success,) = owner.call{value: _payAmount}("");
require(success, "Failed to send money");
CRON token = CRON(0x2F718Bc4390F8662bB664D1FDd88494ac6bE71eC);
uint256 cost = _payAmount * 6 * priceFeed.latestRoundData ;
token.transfer(owner,cost);
}
}