I am trying to compile my solidity code in remix editor. I keep getting this error "Optimization exception during compilation". I was using solidity version 0.5.2 till day before yesterday. Now, It is not letting me choose the version or higher version which is nightly build. enter image description here

  • Are you using the online version of remix? – Rick Park Jan 15 '19 at 17:36
  • yes. i am using the browser version of remix. – skr Jan 15 '19 at 17:57

Issue i am facing turns out to be a browser specific trouble. I was able to deploy my contract successfully from chrome. One mistake I did before backing up my code in Remix IDE in firefox is that I cleared cache and browser history without having a backup. So, I lost the smart contract code. Thankfully, I remembered most of it that I could rewrite the code.

  • Yes, the browser of the cache is used as temporary storage for remix files. May be you can have some advantages if you install remix-ide from npm and use remixd. In that a way your files shall be ever synced with the remix window. – Rick Park Jan 16 '19 at 21:16

Try to exit, to clear the cache of the browser and restart. Compile without optimizer as first try and, if it is ok, switch on the optimizer.

I currently use 0.5.2 and I did not encounter problems.

I saw something similar using 0.4.24, but it was related to the browser.

(EDIT AFTER COMMENTS FOR REFERENCE OF READERS: it resulted to be exactly that: a browser related problem. Changing the browser solved, but clearing the cache resulted in the loss of the code, not backed-up. There is the suggestion to use the npm remix-ide complete with remixd in order to avoid those occasional loss.)

  • turned out to be a browser specific issue for me. I switched to Chrome and it worked fine. I am not sure why i still have the same issue with firefox – skr Jan 16 '19 at 20:02
  • Happy to hear that. – Rick Park Jan 16 '19 at 20:09

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.