I'm unsure what identifier it is asking for, can anyone advise?

Error section

    constructor () public {
    owner = msg.sender;
  • how excatly did u solve the problem.still getting Expected identifier, got 'eth_compileSolidity' constructor () public { Commented Jul 5, 2018 at 7:37

2 Answers 2

pragma solidity ^0.4.11;

In the Solidity versions preceding 0.4.22, the constructor is defined as the function having the same name than the contract.

Example :

contract Test {
    function Test() {...}

So, if you want to use the keyword constructor for your constructor, you have to, at least, use the 0.4.22 version of Solidity.

  • 2
    i've changed to pragma solidity ^0.4.24; and am still receiving the same error Commented Jun 23, 2018 at 11:15

I am attaching an image which contains your code and is working absolutely fine without any Warnings. I have checked it on remix browser . Please check it out.

enter image description here

  • my code worked perfectly with remix, but not with mist. Commented Jun 23, 2018 at 11:36
  • can i see the screenshot?
    – Shwet
    Commented Jun 23, 2018 at 11:39
  • I don't have it any more, I solved the issue. Commented Jun 23, 2018 at 11:54

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.