Merge pull request #12954 from aathan/clarify-address-literals-eip-55

Link to address literals from address value types
This commit is contained in:
Leo 2022-08-13 15:06:34 +02:00 committed by GitHub
commit 9dd2e0ec3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -210,6 +210,11 @@ an exception to this rule.
declare its type as ``address payable`` to make this requirement visible. Also,
try to make this distinction or conversion as early as possible.
The distinction between ``address`` and ``address payable`` was introduced with version 0.5.0.
Also starting from that version, contracts are not implicitly convertible to the ``address`` type, but can still be explicitly converted to
``address`` or to ``address payable``, if they have a receive or payable fallback function.
Operators:
* ``<=``, ``<``, ``==``, ``!=``, ``>=`` and ``>``
@ -223,9 +228,7 @@ Operators:
or you can use ``address(uint160(uint256(b)))``, which results in ``0x777788889999AaAAbBbbCcccddDdeeeEfFFfCcCc``.
.. note::
The distinction between ``address`` and ``address payable`` was introduced with version 0.5.0.
Also starting from that version, contracts do not derive from the address type, but can still be explicitly converted to
``address`` or to ``address payable``, if they have a receive or payable fallback function.
Mixed-case hexadecimal numbers conforming to `EIP-55 <https://github.com/ethereum/EIPs/blob/master/EIPS/eip-55.md>`_ are automatically treated as literals of the ``address`` type. See :ref:`Address Literals<address_literals>`.
.. _members-of-addresses: