0

I am trying to run my first contract and getting this error "Contract Compilation failed".

pragma solidity >=0.4.0 <0.6.0;
contract SimpleStorage {

uint storedData;

function set(uint x) public {
    storedData = x;
}

function get() public view returns (uint) {
    return storedData;
}
}

Am i doing any mistake? what should i do?

enter image description here

  • Can you post your contract as text so people can paste it into Remix? Your issue will probably go away if you select compiler 0.4.25 on the compile tab. There will also be a hint about why the new one doesn't like it. – Rob Hitchens Nov 14 '18 at 18:08
  • Compilation of your contract works for me. Did you select a compiler version on the compile page? – flygoing Nov 14 '18 at 21:16
1

Try selecting the below compiler version:

    0.4.25+commit.59dbf8f1

That worked for me!

| improve this answer | |

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.