当我编写代码时,我在代码的第 10 行收到警告。谁能告诉我这个警告是什么意思?
我的代码
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.5.0 < 0.9.0;
contract PracticeTest // It's a class
{
string name ;
uint256 age;
constructor() public
{
name = "Ali";
age = 21 ;
}
}
Run Code Online (Sandbox Code Playgroud)
这是警告
Warning: Visibility for constructor is ignored. If you want the contract to be non-deployable, making it "abstract" is sufficient.
--> contracts/PracticeTest.sol:10:5:
|
10 | constructor() public
| ^ (Relevant source part starts here and spans across multiple lines).
Run Code Online (Sandbox Code Playgroud)