2

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?

Rick Park
  • 3,194
  • 2
  • 8
  • 25
chandru
  • 131
  • 1
  • 6

3 Answers3

2

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.

Rick Park
  • 3,194
  • 2
  • 8
  • 25
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

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
goodvibration
  • 26,003
  • 5
  • 46
  • 86