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 '19 at 15:44
-
Check out this answer if you're using Truffle. – Paul Razvan Berg May 27 '19 at 12:21
3 Answers
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.
- 3,194
- 2
- 8
- 25
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.
- 121
- 2
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
- 26,003
- 5
- 46
- 86