Tests/Docs: changing type of msg.sender and tx.origin into address

And also making the type of address(literal) as non-payable address.
This commit is contained in:
hrkrshnn
2020-12-14 16:55:48 +01:00
parent e1a95cfd42
commit 88c99a7538
45 changed files with 159 additions and 89 deletions
+13
View File
@@ -65,6 +65,13 @@ This section lists changes that might cause existing contracts to not compile an
with ``type(uint).max``.
3. Explicit conversions between literals and enums are only allowed if the literal can
represent a value in the enum.
4. Explicit conversions between literals and ``address`` type (e.g. ``address(literal)``) have the
type ``address`` instead of ``address payable``. One can get a payable address type by using an
explicit conversion, i.e., ``payable(literal)``.
* :ref:`Address literals<address_literals>` have the type ``address`` instead of ``address
payable``. They can be converted to ``address payable`` by using an explicit conversion, e.g.
``payable(0xdCad3a6d3569DF655070DEd06cb7A1b2Ccd1D3AF)``.
* There are new restrictions on explicit type conversions. The conversion is only allowed when there
is at most one change in sign, width or type-category (``int``, ``address``, ``bytesNN``, etc.).
@@ -105,6 +112,12 @@ This section lists changes that might cause existing contracts to not compile an
* Remove support for the ``\b``, ``\f``, and ``\v`` escape sequences in code.
They can still be inserted via hexadecimal escapes, e.g. ``\x08``, ``\x0c``, and ``\x0b``, respectively.
* The global variables ``tx.origin`` and ``msg.sender`` have the type ``address`` instead of
``address payable``. One can convert them into ``address payable`` by using an explicit
conversion, i.e., ``payable(tx.origin)`` or ``payable(msg.sender)``.
This change was done since the compiler cannot determine whether or not these addresses
are payable or not, so it now requires an explicit conversion to make this requirement visible.
* The ``chainid`` builtin in inline assembly is now considered ``view`` instead of ``pure``.