...
Source file requires different compiler version (current compiler is 0.8.2+commit.661d1103.Emscripten.clang) - note that nightly builds are considered to be strictly less than the released version
...在块菌配置中,我设置了
...
compilers: {
solc: {
version: "0.5.16", // Fetch exact version from solc-bin (default: truffle's version)
// docker: true, // Use "0.5.1" you've installed locally with docker (default: false)
// settings: { // See the solidity docs for advice about optimization and evmVersion
// optimizer: {
// enabled: false,
// runs: 200
// },
// evmVersion: "byzantium"
// }
}
},
...但是当我做松露测试时我会出错。
TestFirst
1) testAge
> No events were emitted
0 passing (25s)
1 failing
1) TestFirst
testAge:
Error: Returned error: VM Exception while processing transaction: revert
at Context.<anonymous> (C:\Users\92311\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\testing\SolidityTest.js:92:1)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
...发布于 2021-03-15 01:25:01
你需要改变:
编译器:{ solc:{版本:"0.8.2",
..。
https://ethereum.stackexchange.com/questions/94630
复制相似问题