-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Recommend to use latest version #5757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,8 @@ that run on the Ethereum Virtual Machine. Smart contracts are programs that are | |
network where nobody has special authority over the execution and thus they allow to implement tokens of value, | ||
ownership, voting and other kinds of logics. | ||
|
||
When deploying contracts, you should use the latest released version of Solidity. This is because breaking changes as well as new features and bug fixes are introduced regularly. We currently use a 0.x version number [to indicate this fast pace of change](https://semver.org/#spec-item-4). | ||
|
||
## Build and Install | ||
|
||
Instructions about how to build and install the Solidity compiler can be found in the [Solidity documentation](https://solidity.readthedocs.io/en/latest/installing-solidity.html#building-from-source) | ||
|
@@ -29,7 +31,7 @@ Instructions about how to build and install the Solidity compiler can be found i | |
A "Hello World" program in Solidity is of even less use than in other languages, but still: | ||
|
||
``` | ||
pragma solidity ^0.4.16; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Someone requested to use the pragma range as wide as possible to show when certain features were introduced. I'm fine to relax this for this code snippet - but I'm not sure we will be able to keep it up to date. Perhaps make this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good compromise, updated in fulldecent@0842ac6 Created separate issue to track that update at #5767 |
||
pragma solidity ^0.5.0; | ||
|
||
contract HelloWorld { | ||
function helloWorld() external pure returns (string memory) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 10 lines down there are links to the documentation with hardcoded version number - we should use something like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you saying to add a variable into the RST file and update everything at once? Or are you recommending a change to the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, I'm saying the link could be https://solidity.readthedocs.io/en/latest/solidity-by-example.html#voting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (10 lines down from here) |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,12 +37,12 @@ breaking changes, those releases will always have versions of the form | |
|
||
The version pragma is used as follows:: | ||
|
||
pragma solidity ^0.4.0; | ||
pragma solidity ^0.5.2; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason to use 0.5.2 and not 0.5.0? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's a nice example. |
||
|
||
Such a source file will not compile with a compiler earlier than version 0.4.0 | ||
and it will also not work on a compiler starting from version 0.5.0 (this | ||
Such a source file will not compile with a compiler earlier than version 0.5.2 | ||
and it will also not work on a compiler starting from version 0.6.0 (this | ||
second condition is added by using ``^``). The idea behind this is that | ||
there will be no breaking changes until version ``0.5.0``, so we can always | ||
there will be no breaking changes until version ``0.6.0``, so we can always | ||
be sure that our code will compile the way we intended it to. We do not fix | ||
the exact version of the compiler, so that bugfix releases are still possible. | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this may slightly misleading to say that if the major number would be 1, then bumping it wouldn't mean a breaking change. Though I understand where you're coming from, being in major number 0 suggests changes are more frequent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I intentionally left out any mention of what happens at >= 1.0 so as not to make commitments on your behalf. But presumably, we would follow normal semver practices at that time and update the statement here.