From e4d3425ad9fdc500ad94a8799b82f041e01cac0d Mon Sep 17 00:00:00 2001 From: CJ42 Date: Tue, 7 Jun 2022 18:30:57 +0100 Subject: [PATCH] docs: add `uint160` type in address conversion section MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit docs: add notice for uint conversion before 0.8.0 docs: edit sentence structure + remove 'result in `address payable`' docs: add keyword 'explicitly' to be more specific for `address payable` docs: edit notice uint to address conversion change since 0.8.0 Co-authored-by: Kamil ƚliwak --- docs/types/conversion.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/types/conversion.rst b/docs/types/conversion.rst index 7e266d1bd..e6c68df41 100644 --- a/docs/types/conversion.rst +++ b/docs/types/conversion.rst @@ -188,6 +188,10 @@ Addresses As described in :ref:`address_literals`, hex literals of the correct size that pass the checksum test are of ``address`` type. No other literals can be implicitly converted to the ``address`` type. -Explicit conversions from ``bytes20`` or any integer type to ``address`` result in ``address payable``. +Explicit conversions to ``address`` are allowed only from ``bytes20`` and ``uint160``. -An ``address a`` can be converted to ``address payable`` via ``payable(a)``. +An ``address a`` can be converted explicitly to ``address payable`` via ``payable(a)``. + +.. note:: + Prior to version 0.8.0, it was possible to explicitly convert from any integer type (of any size, signed or unsigned) to ``address`` or ``address payable``. + Starting with in 0.8.0 only conversion from ``uint160`` is allowed. \ No newline at end of file