Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lesson 7: Compiler Version Error -> 10:43.16 [SOLVED] #227

Closed
DorianDaSilva opened this issue Jun 9, 2022 · 1 comment
Closed

Lesson 7: Compiler Version Error -> 10:43.16 [SOLVED] #227

DorianDaSilva opened this issue Jun 9, 2022 · 1 comment

Comments

@DorianDaSilva
Copy link

$ /home/ionmind/hardhat-fundme-fcc/node_modules/.bin/hardhat deploy --network rinkeby
Error HH606: The project cannot be compiled, see reasons below.

These files import other files that use a different and incompatible version of Solidity:

  * contracts/test/MockV3Aggregator.sol (^0.8.12) imports @chainlink/contracts/src/v0.6/tests/MockV3Aggregator.sol (^0.6.0)

To learn more, run the command again with --verbose

Read about compiler configuration at https://hardhat.org/config

After getting this error I modified the hardhat.config.js file as instructed on the video

module.exports = {
  //solidity: "0.8.12",
  solidity: {
    compilers: [{ version: "0.8.12" }, { version: "0.6.0" }],
  },

But still getting the error, so I also modified the compiler version in solhint.js file

{
  "extends": "solhint:recommended",
  "rules": {
    "compiler-version": ["error", "^0.8.12", "^0.6.0"],
    "func-visibility": ["warn", { "ignoreConstructors": true }],
    "var-name-mixedcase": "off",
    "avoid-low-level-calls": "off"
  }
}

But still getting the error.

I created a separate AggregatorV2V3Interface file in test folder, locally imported into MockV3Aggregator.sol & also declared solidity version ^0.8.12 for each of the files

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

interface AggregatorInterface {
        //Code Here//
}

interface AggregatorV3Interface {
       //Code Here//
}

interface AggregatorV2V3Interface is AggregatorInterface, AggregatorV3Interface {}
//SPDX-License-Identifier:MIT
pragma solidity ^0.8.12;

import "./AggregatorV2V3Interface.sol";

There are no errors or warnings in the code but I still get the same error when trying to compile. I don't get why I seem to be the only person having this compiler issue.

Any help is appreciated. Thank you!

@DorianDaSilva DorianDaSilva changed the title Lesson 7: Compiler Version Error -> 10:43.16 Lesson 7: Compiler Version Error -> 10:43.16 [SOLVED] Jun 9, 2022
@DorianDaSilva
Copy link
Author

AggregatorV3Interface import in fundme.sol & priceConverter.sol was causing the error so I had to create a new file in contracts and remove the ^ from the solidity version in hardhat.config & solhin.json. Now it compiles perfectly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant