Solidity开发bug汇总

编译器与代码版本不一致问题

更多区块链技术与应用分类:

区块链应用    区块链开发

以太坊 | Fabric | BCOS | 密码技术 | 共识算法 | 比特币其他链

通证经济传统金融场景 | 去中心化金融 | 防伪溯源 | 数据共享 | 可信存证

 

(代码版本pragma solidity ^0.4.25),产生如下报错:

{ "component": "general", "formattedMessage": "StringUtil.sol:1:1: SyntaxError: Source file requires different compiler version (current compiler is 0.4.25-develop.2019.12.3+commit.8f645f02.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version\npragma solidity ^0.4.25;\r\n^----------------------^\n", "message": "Source file requires different compiler version (current compiler is 0.4.25-develop.2019.12.3+commit.8f645f02.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version", "severity": "error", "sourceLocation": { "end": 24, "file": "StringUtil.sol", "start": 0 }, "type": "SyntaxError" }

解决:

改为pragma solidity ^0.4.2

^0.4.25表示0.4.25以上,0.5以下的版本,因此与当前编译器版本不兼容,导致错误。


原文链接:Solidity开发bug汇总

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值