The warning is from running sample code from Mastering Ethereum, I get the above error and it says
Use "constructor(…) { … }" instead.
function Migrations() public {
go-ethereummastering-ethereumsoliditytruffletruffle-migration
The warning is from running sample code from Mastering Ethereum, I get the above error and it says
Use "constructor(…) { … }" instead.
function Migrations() public {
Best Answer
This is because of a deprecated standard. In the file, Migrations.sol, replace the line:
with:
The line of code shown just above is a constructor, it runs on a contract's deployment, and it is used(as in the file in context) to save the contract owner's address(msg.sender varies based on who interacts with the contract).
This replaces the existing implementation of using a function with the same name as the contract to act as a constructor with a seperate constructor function.