我们在实际开发过程中可同时使用remix和vscode,两者各有互补。
如语法学习01中使用vscode编程时,因本地编译环境为0.6.12,remix使用的0.5.1
同样的代码vscode会有SPDX警告,需要因为soliidity 0.6.8 引入了SPDX,使用时要在文件第一句加上SPDX-License-Identifier:格式的语句,SPDX许可列表网址:https://spdx.org/licenses/
{
"resource": "/f:/sol/test/solidity/contracts/helloword.sol",
"owner": "_generated_diagnostic_collection_name_#0",
"severity": 4,
"message": "SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: <SPDX-License>\" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information.",
"startLineNumber": 1,
"startColumn": 1,
"endLineNumber": 1,
"endColumn": 1
}