1

In Software development, one usually asks "what's the most outdated version of x that we still need to support". Typically, technology/frameworks try to support as many deprecated version of a programming language (or other libraries for that matter) as possible.

Usually, you'll have some feature x (in e.g. a programming language) that was introduced in version y - and since you need to use x in your code, that required minimum level of your final product will be version y. Typically now, to a certain degree, this is easy, as newer versions than y will still support feature x, so you can also run your code with versions y+1, y+2, and so on.

Versions of Solidity on the other hand seem rather complex and hard to keep track of. I've found myself now in multiple scenarios where I asked myself "which version of Solidity should I write for"? There seem to be many breaking changes and hence, this question seems to be hard to answer.

Now, is there a common practice according to which one can "decide" which version is the best one to go with? I guess "use the latest version" is not the most promising approach here?

2

You will probably receive more opinions than facts, but here is my take on it.

To my knowledge, once 0.X.0 version is released, previous versions are no longer supported (even in regard of security issues). You could then argue that the safest version is always the latest.

Each new 0.X.0 version of the Soldity compiler brings many breaking changes from the previous 0.Y.0 version. A contract written for the previous version is generally not compatible without some changes. Moreover, since the compiler compiles your contract and all other contracts imported by yours at the same time, it causes an important issue: your contract will fail to compile with version 0.X.0 if you import another contract built with version 0.Y.0.

My guiding principle is thus the following: I always use the latest compiler version, unless my contract imports other contracts and libraries that rely on a previous version. In that case, I will either modify the imported contracts so they work with the latest version, or code my contract with that older version, whichever is easiest/safest.

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.