I am having an issue creating a contract on the Ethereum test net. I am getting the following warning statement:

sol:21:5: Warning: Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.

1 Answer 1


As of Solidity version 4.23, you should be using

constructor() {

Instead of

function MyContract() {

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.