我尝试了您在此处的讨论中(在其他问题中)和https://github.com/smartcontractkit/full-blockchain-solidity-course-py/discussions/522中提到的所有内容,但是它并没有为我解决问题,我还注意到当前的编译器版本仍然存在(当前编译器是0.6.12+commit.27d51765.Windows.msvc)。但是当我右键单击并选择Solidty:编译器信息时,它显示0.8.0。
从输出:
Retrieving compiler information:
Compiler using remote version: 'v0.8.0+commit.c7dfd78e', solidity version: 0.8.0+commit.c7dfd78e.Emscripten.clang
Run Code Online (Sandbox Code Playgroud)
不确定这是否与我面临的问题有关。无论如何,从运行布朗尼编译时看到的问题开始。我收到以下错误:
终端错误:
PS D:\Python projects\Solidity dev\demo\smartcontract-lottery> brownie compile
INFO: Could not find files for the given pattern(s).
Brownie v1.17.2 - Python development framework for Ethereum
Compiling contracts...
Solc version: 0.6.12
Optimizer: Enabled Runs: 200
EVM Version: Istanbul
CompilerError: solc returned the following errors:
C:/Users/rosne/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.3.0/contracts/access/Ownable.sol:3: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 …Run Code Online (Sandbox Code Playgroud)