New answers tagged

0

As you might know the constructor is executed once the smart contract is deployed thus when you deploy with value you need to define a payable constructor as follows: constructor() public { m_ReceivedWei += msg.value; } .


0

There is no constructor, so you can't fund the contract in the deploy because by default constructor is not payable. You can add the following line: constructor() public payable {} About Constructor: A constructor is an optional function declared with the constructor keyword which is executed upon contract creation, and where you can run contract ...


Top 50 recent answers are included