Explain address payable and withdraw.

This commit is contained in:
chriseth
2018-09-27 11:48:41 +02:00
parent 9508406984
commit 927cdb3170
2 changed files with 11 additions and 1 deletions
+7
View File
@@ -189,6 +189,13 @@ has the type ``address payable``, if ``x`` is of integer or fixed bytes type, a
If ``x`` is a contract without payable fallback function, then ``address(x)`` will be of type ``address``.
In external function signatures ``address`` is used for both the ``address`` and the ``address payable`` type.
.. note::
It might very well be that you do not need to care about the distinction between ``address``
and ``address payable`` and just use ``address`` everywhere. For example,
if you are using the :ref:`withdrawal pattern<withdrawal_pattern>`, you can (and should) store the
address itself as ``address``, because you invoke the ``transfer`` function on
``msg.sender``, which is an ``address payable``.
Operators:
* ``<=``, ``<``, ``==``, ``!=``, ``>=`` and ``>``