Warning: Defining constructors as functions with the same name as the contract is deprecated

contract CtrtFactory {
  function makeCtrt() {
    address ctrtAddress = new Ctrt(...);
  }
}
contract Ctrt() {
  function Ctrt(..) {}
}

error :Defining constructors as functions with the same name as the contract is deprecated. Use “constructor(…) { … }” instead [duplicate]
解决方案:This is because of a deprecated standard. In the file, Migrations.sol, replace the line:

function Migrations() public {    
with:

constructor() public {

or

contract Ctrt {
   constructor() {}
}

你可能感兴趣的:(go,区块链)