小编Ali*_*san的帖子

Solidity 中这个警告的含义是什么?

当我编写代码时,我在代码的第 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)

blockchain solidity remix

3
推荐指数
1
解决办法
2948
查看次数

标签 统计

blockchain ×1

remix ×1

solidity ×1