2019-08-14 13:41:16 +00:00
|
|
|
********************************
|
|
|
|
Solidity v0.6.0 Breaking Changes
|
|
|
|
********************************
|
|
|
|
|
|
|
|
This section highlights the main breaking changes introduced in Solidity
|
|
|
|
version 0.6.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.6.0>`_.
|
|
|
|
|
|
|
|
|
2019-08-13 14:43:25 +00:00
|
|
|
Syntactic Only Changes
|
|
|
|
======================
|
|
|
|
|
|
|
|
This section lists purely syntactic changes that do not affect the behavior of existing code.
|
|
|
|
|
|
|
|
* Conversions from external function types to ``address`` are now disallowed. Instead external
|
|
|
|
function types have a member called ``address``, similar to the existing ``selector`` member.
|
2019-09-04 15:45:12 +00:00
|
|
|
* Conversions from ``address`` to ``address payable`` are now possible via ``payable(x)``, where
|
|
|
|
``x`` must be of type ``address``.
|
2019-08-13 14:43:25 +00:00
|
|
|
|
2019-09-13 22:54:51 +00:00
|
|
|
* Function ``push(value)`` for dynamic storage arrays do not return the new length anymore.
|
|
|
|
|
2019-09-09 10:49:54 +00:00
|
|
|
* New reserved keywords: ``virtual``.
|
|
|
|
|
2019-08-14 13:41:16 +00:00
|
|
|
Semantic Only Changes
|
|
|
|
=====================
|
|
|
|
|
|
|
|
This section lists the changes that are semantic-only, thus potentially
|
|
|
|
hiding new and different behavior in existing code.
|
|
|
|
|
|
|
|
|
|
|
|
Semantic and Syntactic Changes
|
|
|
|
==============================
|
|
|
|
|
|
|
|
This section highlights changes that affect syntax and semantics.
|
|
|
|
|
2019-07-07 15:53:03 +00:00
|
|
|
* The resulting type of an exponentiation is the type of the base. It used to be the smallest type
|
|
|
|
that can hold both the type of the base and the type of the exponent, as with symmentric
|
|
|
|
operations. Additionally, signed types are allowed for the base of the exponetation.
|
|
|
|
|
2019-08-14 13:41:16 +00:00
|
|
|
|
|
|
|
How to update your code
|
|
|
|
=======================
|
|
|
|
|
|
|
|
This section gives detailed instructions on how to update prior code for every breaking change.
|
|
|
|
|
2019-08-15 11:57:04 +00:00
|
|
|
* Change ``address(f)`` to ``f.address`` for ``f`` being of external function type.
|
2019-08-14 13:41:16 +00:00
|
|
|
|
2019-09-13 22:54:51 +00:00
|
|
|
* Change ``uint length = array.push(value)`` to ``array.push(value);``. The new length can be
|
|
|
|
accessed via ``array.length``.
|
|
|
|
|
2019-08-14 13:41:16 +00:00
|
|
|
Deprecated Elements
|
|
|
|
===================
|
|
|
|
|
|
|
|
This section lists changes that deprecate prior features or syntax.
|
|
|
|
|
|
|
|
|
|
|
|
.. _interoperability_060:
|
|
|
|
|
|
|
|
Interoperability With Older Contracts
|
|
|
|
=====================================
|
|
|
|
|