-
Notifications
You must be signed in to change notification settings - Fork 2.9k
-
I'm using Solidity 0.8.17, the video was using 0.6.x. So, when copying the code for the "MockV3Aggregator" I needed to change some things from version 0.6 to version 0.8. Changes:
pragma solidity >=0.6.6 <0.9.0;
--> it was "^0.6.0"import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV2V3Interface.sol";
--> it was importing from "v0.6"
I was still having some issues running brownie compile
. When I would try to run brownie compile
, it would initially download Solidity version 0.6.12. Then, it would say:
"CompilerError: solc returned the following errors:
contracts/test/MockV3Aggregator.sol:6:1: ParserError: Source file requires different compiler version (current compiler is 0.6.12+commit.27d51765.Windows.msvc) - note that nightly builds are considered to be strictly less than the released version
pragma solidity ^0.8.0;"
I couldn't figure out exactly why it kept trying to compile using Solidity 0.6.12. I tried changing the compiler version in Visual Studio Code but that didn't work. Ultimately, to fix the issue and allow the code to be compiled without error, I added a version specification of 0.8.17 in the brownie-config.yaml
file. To specify version, you should already have a hierarchy built out from earlier in the video that looks something like this "compiler >> "solc" >> "remappings". Subordinated to (underneath) the "solc" section, where "remappings" is, add a new section "version" and specify the version.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
Hello @itgav
Please follow this steps and let us know if it works for you:
- Delete the build folder on your project. (Try compiling again).
- If it does not work, go to your home folder (in windows C:\Users\YourUser) and delete the .brownie folder, which is a hidden one.
- Change the compiler version from remote to local and backwards on the Solidity extension for vscode, sometimes that help to refresh the compiler version which is taken.
Does any of this help? Please let us know.
Beta Was this translation helpful? Give feedback.