diff options
author | chriseth <c@ethdev.com> | 2016-05-31 20:13:02 +0800 |
---|---|---|
committer | Denton Liu <liu.denton+github@gmail.com> | 2016-06-02 01:22:15 +0800 |
commit | 84a8c0c008acf80a70c60dbfc0f5c3666abcd676 (patch) | |
tree | 16c8cabaee18151c5432afb2d284cbccfec25705 /docs/types.rst | |
parent | 9da7a4c17c2245e869475d031cb23587c33f5045 (diff) | |
download | dexon-solidity-84a8c0c008acf80a70c60dbfc0f5c3666abcd676.tar.gz dexon-solidity-84a8c0c008acf80a70c60dbfc0f5c3666abcd676.tar.zst dexon-solidity-84a8c0c008acf80a70c60dbfc0f5c3666abcd676.zip |
Document some pitfalls in connection with "send".
Diffstat (limited to 'docs/types.rst')
-rw-r--r-- | docs/types.rst | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/types.rst b/docs/types.rst index 2cd3654b..6d4e928c 100644 --- a/docs/types.rst +++ b/docs/types.rst @@ -86,6 +86,12 @@ and to send Ether (in units of wei) to an address using the ``send`` function: .. note:: If ``x`` is a contract address, its code (more specifically: its fallback function, if present) will be executed together with the ``send`` call (this is a limitation of the EVM and cannot be prevented). If that execution runs out of gas or fails in any way, the Ether transfer will be reverted. In this case, ``send`` returns ``false``. +.. warning:: + There are some dangers in using ``send``: The transfer fails if the call stack depth is at 1023 + (this can always be forced by the caller) and it also fails if the recipient runs out of gas. So in order + to make safe Ether transfers, always check the return value of ``send`` or even better: + Use a pattern where the recipient withdraws the money. + * ``call``, ``callcode`` and ``delegatecall`` Furthermore, to interface with contracts that do not adhere to the ABI, |