0

I saw a lot of issues on this same problem and tried them all but it still doesnt solve the callback issue for me.

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

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

contract FundMe {
    using SafeMathChainlink for uint256;

error message doesn't go away for me

this is my brownie-config.yaml file

dependencies:
  # -<organization/repo>@<version>
  - smartcontractkit/chainlink-brownie-contracts@1.1.1
compiler:
  solc:
    remappings:
      - "@chainlink=smartcontractkit/chainlink-brownie-contracts@1.1.1"

after that I compiled and it was successful but the errors wouldnt go away. brownie-compile

Any help on this would be EPIC. Thank you in advance

LockE404
  • 29
  • 3

4 Answers4

1

The compiler doesn't know where is the file so just create a new folder inside contracts folder named tests and then create a new file naming: AggregatorV3Interface.sol and then paste this code inside it :

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface AggregatorV3Interface {
  function decimals() external view returns (uint8);

  function description() external view returns (string memory);

  function version() external view returns (uint256);

  // getRoundData and latestRoundData should both raise "No data present"
  // if they do not have data to report, instead of returning unset values
  // which could be misinterpreted as actual reported values.
  function getRoundData(uint80 _roundId)
    external
    view
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    );

  function latestRoundData()
    external
    view
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    );
}

After this recompile the project and then run, it will run without any errors and you will get the result. For more information visit :: this question

Tanay
  • 561
  • 1
  • 3
  • 16
0

I had same issue. This is what solved the problem on my system :

  • i checked the solicity version i had installed through 'nmp -g list' in the terminal. It seemed that i had version 0.8.xx installed.
  • i downgraded to version 0.6.6 through 'npm install -g solc@0.6.6'
  • i rechecked the installed version and it gave me this : enter image description here
  • the i compiled throught 'brownie compile' and it worked, even though is still had the 'red lines' telling about an issue in the file. Json file was generated

Hope this helps, have been searching for a while.

0

I did fix this by asking the IDE I’m using (Visual Studio Code) to use the version of interface v0.7 as I wanted to import the v0.7 interface:

@chainlink/contracts/src/v0.7/interfaces/AggregatorV3Interface.sol

chaingingTheGlobalCompilerVersion

FYI: I am following a YouTube tutorial that tells you to remap the @chainlink to a git path from release 1.1.1, but the interface files are zipped now, hence I choose v0.7 where files are still available.

remappintToRelease0.3.0

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
0

I had the same issue just try changing solidity version to 0.8.7 and version of chainlink to 0.8

pragma solidity ^0.8.7;
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
Dhruva
  • 1
  • 1