Merge pull request #8805 from ethereum/solidity-upgrade-documentation

[BREAKING] Update documentation for solidity-upgrade 0.7.0
This commit is contained in:
Harikrishnan Mulackal 2020-04-30 18:27:39 +05:30 committed by GitHub
commit b13c87f266
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 6 deletions

View File

@ -0,0 +1,17 @@
********************************
Solidity v0.7.0 Breaking Changes
********************************
This section highlights the main breaking changes introduced in Solidity
version 0.7.0, along with the reasoning behind the changes and how to update
affected code.
For the full list check
`the release changelog <https://github.com/ethereum/solidity/releases/tag/v0.7.0>`_.
How to update your code
=======================
This section gives detailed instructions on how to update prior code for every breaking change.
* Change ``f.value(...)()`` to ``f{value: ...}()``. Similarly ``(new C).value(...)()`` to
``(new C){value: ...}()`` and ``f.gas(...)()`` to ``f{gas: ...}()``.

View File

@ -127,6 +127,7 @@ Contents
050-breaking-changes.rst 050-breaking-changes.rst
060-breaking-changes.rst 060-breaking-changes.rst
070-breaking-changes.rst
natspec-format.rst natspec-format.rst
security-considerations.rst security-considerations.rst
resources.rst resources.rst

View File

@ -71,7 +71,7 @@ So for the following contract snippet
the position of ``data[4][9].b`` is at ``keccak256(uint256(9) . keccak256(uint256(4) . uint256(1))) + 1``:: the position of ``data[4][9].b`` is at ``keccak256(uint256(9) . keccak256(uint256(4) . uint256(1))) + 1``::
pragma solidity >=0.4.0 <0.7.0; pragma solidity >=0.4.0 <0.8.0;
contract C { contract C {
@ -171,7 +171,7 @@ value and reference types, types that are encoded packed, and nested types.
.. code:: .. code::
pragma solidity >=0.4.0 <0.7.0; pragma solidity >=0.4.0 <0.8.0;
contract A { contract A {
struct S { struct S {
uint128 a; uint128 a;

View File

@ -571,9 +571,16 @@ Available upgrade modules
| ``override`` | 0.6.0 | When overriding a function or modifier, the new | | ``override`` | 0.6.0 | When overriding a function or modifier, the new |
| | | keyword ``override`` must be used. | | | | keyword ``override`` must be used. |
+-----------------+---------+--------------------------------------------------+ +-----------------+---------+--------------------------------------------------+
| ``dotsyntax`` | 0.7.0 | The following syntax is deprecated: |
| | | ``f.gas(...)()``, ``f.value(...)()`` and |
| | | ``(new C).value(...)()``. Replace these calls by |
| | | ``f{gas: ..., value: ...}()`` and |
| | | ``(new C){value: ...}()``. |
+-----------------+---------+--------------------------------------------------+
Please read :doc:`0.5.0 release notes <050-breaking-changes>` and Please read :doc:`0.5.0 release notes <050-breaking-changes>`,
:doc:`0.6.0 release notes <060-breaking-changes>` for further details. :doc:`0.6.0 release notes <060-breaking-changes>` and
:doc:`0.7.0 release notes <070-breaking-changes>` for further details.
Synopsis Synopsis
~~~~~~~~ ~~~~~~~~
@ -668,8 +675,9 @@ do not need to specify the ``--modules`` option.
Found 0 errors. Found 0 errors.
Found 0 upgrades. Found 0 upgrades.
The above performs a dry-ran upgrade on the given file and logs statistics after all. The above performs a dry-run upgrade on the given file and logs statistics at
In this case, the upgrade was successful and no further adjustments are needed. the end. In this case, the upgrade was successful and no further adjustments are
needed.
Finally, you can run the upgrade and also write to the source file. Finally, you can run the upgrade and also write to the source file.