嗨,伙计们,当我尝试用松露开发编译时,我得到了这个错误。
truffle(develop)> compile
Compiling your contracts...
Compiling ./contracts/StarNotary.sol
/mnt/d/Blockchain/Project2Test/node_modules/openzeppelin-solidity/contracts/token/ERC721/ERC721.sol:3:1: ParserError: Source file requires different compiler version (current compiler is 0.5.16+commit.9c3226ce.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version
pragma solidity ^0.6.0;
^---------------------^
Error: Truffle is currently using solc 0.5.16, but one or more of your contracts specify "pragma solidity ^0.6.0".
Please update your truffle config or pragma statement(s).
(See https://truffleframework.com/docs/truffle/reference/configuration#compiler-configuration for information on
configuring Truffle to use a specific solc compiler version.在the 721中,我将语用转换为语用稳健性>=0.4.24 < 0.7.0;solidity openzeppelin-。
在那之后,我得到了一个错误
truffle(develop)> compile
Compiling your contracts...
Compiling ./contracts/StarNotary.sol
/mnt/d/Blockchain/Project2Test/node_modules/openzeppelin-solidity/contracts/token/ERC721/ERC721.sol:106:51: ParserError: Expected '{' but got reserved keyword 'override'
function balanceOf(address owner) public view override returns (uint256) {发布于 2020-07-02 16:23:14
OpenZeppelin的合同所要求的坚固版本与在The中配置的版本不匹配。
您可以升级Tru显以使用solc 0.6,也可以将OpenZeppelin降级到使用Solcv0.5的2.5版本。
https://ethereum.stackexchange.com/questions/84721
复制相似问题