Merge pull request #5800 from ethereum/wip/faq-call

[DOCS] Add call warning into main docs and remove FAQ item
This commit is contained in:
Chris Chinchilla 2019-01-17 11:31:46 +02:00 committed by GitHub
commit 72c2100164
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 12 deletions

View File

@ -54,18 +54,6 @@ Yes, you can use ``abi.encodePacked``::
}
}
Why is the low-level function ``.call()`` less favorable than instantiating a contract with a variable (``ContractB b;``) and executing its functions (``b.doSomething();``)?
=============================================================================================================================================================================
If you use actual functions, the compiler will tell you if the types
or your arguments do not match, if the function does not exist
or is not visible and it will do the packing of the
arguments for you.
See `ping.sol <https://github.com/fivedogit/solidity-baby-steps/blob/master/contracts/45_ping.sol>`_ and
`pong.sol <https://github.com/fivedogit/solidity-baby-steps/blob/master/contracts/45_pong.sol>`_.
What happens if you send ether along with a function call to a contract?
========================================================================

View File

@ -199,6 +199,10 @@ Members of Address Types
For more information, see the section on :ref:`address`.
.. warning::
You should avoid using ``.call()`` whenever possible when executing another contract function as it bypasses type checking,
function existence check, and argument packing.
.. warning::
There are some dangers in using ``send``: The transfer fails if the call stack depth is at 1024
(this can always be forced by the caller) and it also fails if the recipient runs out of gas. So in order