1

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 { – Peter Kirubi Jul 5 '18 at 7:37
1
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 – Matthew Hughes Jun 23 '18 at 11:15
0

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. – Matthew Hughes Jun 23 '18 at 11:36
  • can i see the screenshot? – Shwet Jun 23 '18 at 11:39
  • I don't have it any more, I solved the issue. – Matthew Hughes Jun 23 '18 at 11:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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