如何在我的代码中添加 <SPDX-License> 作为注释?
How do I add <SPDX-License> as a comment in my code?
pragma solidity >=0.6.0 <0.9.0;
contract SimpleStorage {
//this will get initialized to 0!
uint256 favoriteNumber;
function store(uint256 _favoriteNumber) public {
favoriteNumber = _favoriteNumber;
//<SPDX-License>
}
}
Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: " to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> SimpleStorage.sol
许可证标识符位于第一行,pragma
语句之前。
示例:
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.6.0 <0.9.0;
contract SimpleStorage {
pragma solidity >=0.6.0 <0.9.0;
contract SimpleStorage {
//this will get initialized to 0!
uint256 favoriteNumber;
function store(uint256 _favoriteNumber) public {
favoriteNumber = _favoriteNumber;
//<SPDX-License>
}
}
Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: " to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information. --> SimpleStorage.sol
许可证标识符位于第一行,pragma
语句之前。
示例:
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.6.0 <0.9.0;
contract SimpleStorage {