Since Solidity v0.4.23, Solidity has new constructor notation.
And The old one was deprecated.
Old
pragma solidity 0.4.23;
contract Foo {
function Foo() public {
// ...
}
}
New
pragma solidity 0.4.23;
contract Foo {
constructor() public {
// ...
}
}
Note
The old one raise below.
Warning: Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.
Top comments (2)
Quick and very well explained, Thanks!
😉