0

I am using solidity 0.4.24. The latest version has been updated. How to upgrade my solidity version? Is there any commands for it?

  • Thanks everyone for your valuable comments. I have done it by uninstalling and reinstalling truffle. – chandru Jan 24 at 15:44
2

Apart from upgrading the compiler, you will most likely need to migrate your contracts. A useful guide for migrating is https://solidity.readthedocs.io/en/latest/050-breaking-changes.html.

1

Simply use the new compiler.

  • If you are using Remix, choose the new one in the “Run” tab, drop up “compiler” menu.

  • If you are using Node, npm install -g solc@latest (at the moment it is 0.5.3).

  • If you are using truffle, upgrade to truffle 5.

You will be possibly required to upgrade/correct your code too: simply follow the compiler errors and warning messages and upgrade your code accordingly to the now updated 0.5.3 documentation.

1

Your question tagging implies that you are compiling via Truffle.

If so, then simply upgrade your Truffle version from 4.x to 5.x.

If installed globally, then just run npm update -g truffle.

If installed locally, then in package.json, change this:

"truffle": "4.1.14" // I am guessing it's 4.1.14 because your solc version is 0.4.24

To this:

"truffle": "5.0.2" // The latest version at this point in time

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.