0

I started getting this error...

Source file requires different compiler version (current compiler is 0.7.3+commit.9bfce1f6.Emscripten.clang) - note that nightly builds are considered to be strictly less than the released version

...a few days ago on the following line of code only:

pragma solidity ^0.8.17;  

Anyway, this seems to be compiling without issues.

Anybody knows what may be causing this and how I can get rid of it?

8
  • What environment are you working on ? Commented May 23, 2023 at 12:55
  • What do you mean with environment? I am using Visual Studio Code with solidity extension. Commented May 23, 2023 at 23:42
  • Environment refers to the tools you are using to write the code. Like remix, hardhat, truffle, foundry. I assume you are using hardhat. This error might be coming from the hardhat config file because of different pragma versions in your smart contract and the config file. Commented May 24, 2023 at 5:08
  • Yes, I am using hardhat for compilation. Commented May 24, 2023 at 6:35
  • What version of of Solidity do you have specified inside hardhat.config file?
    – 0xkornel
    Commented May 24, 2023 at 12:27

1 Answer 1

0

To get rid of these annoying warnings, the best way is to disable the solidity extension by Juan Blanco and enable the Solidity extension by Nomic Foundation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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