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() {}
}