Solidity development bug summary

Compiler and code version inconsistency problem

More blockchain technology and application classification:

Blockchain applicationBlockchain     development

Ethernet Square | Fabric | BCOS | cryptography | consensus algorithm | bitcoinOther chain

Token EconomyTraditional Financial Scenarios | Decentralized Finance | Anti-counterfeiting Traceability | Data Sharing | Trusted Deposit

 

(Code version pragma solidity ^0.4.25), the following error is generated:

{ "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" }

solve:

Change to pragma solidity ^0.4.2

^0.4.25 means a version above 0.4.25 and below 0.5, so it is incompatible with the current compiler version, resulting in an error.


Original link: Summary of Solidity development bugs

Guess you like

Origin blog.csdn.net/JonasErosonAtsea/article/details/109236216