首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >源文件编译错误

源文件编译错误
EN

Ethereum用户
提问于 2021-03-14 15:27:10
回答 1查看 289关注 0票数 0
代码语言:javascript
复制
...
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
...

在块菌配置中,我设置了

代码语言:javascript
复制
...
  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"
      // }
    }
  },
...

但是当我做松露测试时我会出错。

代码语言:javascript
复制
  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)
...
EN

回答 1

Ethereum用户

发布于 2021-03-15 01:25:01

你需要改变:

编译器:{ solc:{版本:"0.8.2",

..。

票数 0
EN
页面原文内容由Ethereum提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://ethereum.stackexchange.com/questions/94630

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档