无法更改VSCODE中的Solc编译器版本
在尝试使用布朗尼进行编译时,我会在VScode中遇到此错误。我知道这个错误来自我的一个文件中的一个与编译器不同的Pragma solidity版本:
PS C:\Users\me\Documents\Code\Blockchain\brownie_fundme> brownie compile
INFO: Could not find files for the given pattern(s).
Brownie v1.18.1 - Python development framework for Ethereum
Compiling contracts...
Solc version: 0.8.13
Optimizer: Enabled Runs: 200
EVM Version: Istanbul
CompilerError: solc returned the following errors:
ParserError: Source file requires different compiler version (current compiler is 0.8.13+commit.abaa5c0e.Windows.msvc) - note that nightly builds are considered to be strictly less than the released version
--> C:/Users/me/.brownie/packages/smartcontractkit/[email protected]/contracts/src/v0.6/vendor/SafeMathChainlink.sol:2:1:
|
2 | pragma solidity ^0.6.0;
| ^^^^^^^^^^^^^^^^^^^^^^^
我尝试使用Juan Blanco的'Solidity'Vscode Extension更改编译器版本到“ 更改Global/Workspace Compiler版本(远程) )“选择0.6.0版本。 (我确认了“ solidity.compilesusingremoteversion”:“ v0.6.0+commit.6c089d02”
到我的settings.json)。
但是,当我运行布朗尼编译
时,我仍然会遇到相同的错误:
“ ... ParserError:源文件需要不同的编译器版本(当前编译器为 0.8.13 +commit.abaa5c0e.windows.msvc)... ”,表明我的编译器版本保持不变。
(我将默认的编译器设置为远程,并且在进行这些更改后也尝试重新启动任何开放终端。)
我已经使用PIP安装了Solcx,并且在我的“ C:/users/Me”目录中也有一个.solcx文件夹,其中包含一个文件夹“ solc-v0.8.13”。我尝试删除该文件夹并再次编译,但布朗尼自动下载了相同的v0.8.13。
我很喜欢如何更改全局或工作区编译器版本。 Solc的版本可以从我的VSCODE设置以外的其他地方覆盖吗?
I am getting this error in VSCode while trying to compile using brownie. I understand this error is from the pragma solidity version in one of my files being different from my compiler:
PS C:\Users\me\Documents\Code\Blockchain\brownie_fundme> brownie compile
INFO: Could not find files for the given pattern(s).
Brownie v1.18.1 - Python development framework for Ethereum
Compiling contracts...
Solc version: 0.8.13
Optimizer: Enabled Runs: 200
EVM Version: Istanbul
CompilerError: solc returned the following errors:
ParserError: Source file requires different compiler version (current compiler is 0.8.13+commit.abaa5c0e.Windows.msvc) - note that nightly builds are considered to be strictly less than the released version
--> C:/Users/me/.brownie/packages/smartcontractkit/[email protected]/contracts/src/v0.6/vendor/SafeMathChainlink.sol:2:1:
|
2 | pragma solidity ^0.6.0;
| ^^^^^^^^^^^^^^^^^^^^^^^
I have attempted to change my compiler version using Juan Blanco's 'Solidity' VSCode extension to "Change global/workspace compiler version (Remote)", selecting version 0.6.0. (I confirmed this adds "solidity.compileUsingRemoteVersion": "v0.6.0+commit.6c089d02"
to my settings.json).
But when I run brownie compile
again I still get the same error:
"...ParserError: Source file requires different compiler version (current compiler is 0.8.13+commit.abaa5c0e.Windows.msvc)...", showing that my compiler version remains unchanged.
(I have the default compiler set to remote, and I also tried restarting any open terminals after making these changes.)
I had installed solcx with pip, and also have a .solcx folder in my "C:/Users/me" directory, which contains a folder "solc-v0.8.13". I tried deleting that folder and compiling again, but brownie automatically downloaded the same v0.8.13.
I'm stumped on how to change the global or workspace compiler version. Could the version of solc be getting overridden from somewhere other than my VSCode settings?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
添加以下
Brownie-Config.yaml
文件添加到您的项目:当您
编译
时,Brownie将从配置下载SOLC
版本。Add following
brownie-config.yaml
file to your project:When you
compile
, brownie will downloadsolc
version from config.