truffle-box / react-box

Truffle, Webpack and React boilerplate.
https://truffle-box.github.io/
MIT License
736 stars 251 forks source link

Use constructor in Migrations.sol:11:3: #57

Closed ghost closed 6 years ago

ghost commented 6 years ago

This pull request solves issue https://github.com/truffle-box/react-box/issues/58 which is about compilation failure due to this deprecation warning:

Warning: Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.
  function Migrations() public {
  ^ (Relevant source part starts here and spans across multiple lines).

Solution

Fix Migrations.sol:11:3: from this

function Migrations() public {

to this

constructor() public {