From eab9e58e7e6b815e7dfb288510b49d52fe579fe2 Mon Sep 17 00:00:00 2001 From: Chris Ward Date: Wed, 16 Jan 2019 17:11:23 +0200 Subject: Add call warning into main docs and remove FAQ item --- docs/frequently-asked-questions.rst | 12 ------------ docs/units-and-global-variables.rst | 4 ++++ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/docs/frequently-asked-questions.rst b/docs/frequently-asked-questions.rst index 4635d577..3b59af81 100644 --- a/docs/frequently-asked-questions.rst +++ b/docs/frequently-asked-questions.rst @@ -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 `_ and -`pong.sol `_. - What happens if you send ether along with a function call to a contract? ======================================================================== diff --git a/docs/units-and-global-variables.rst b/docs/units-and-global-variables.rst index 59acfcff..e44caa8f 100644 --- a/docs/units-and-global-variables.rst +++ b/docs/units-and-global-variables.rst @@ -199,6 +199,10 @@ Members of Address Types For more information, see the section on :ref:`address`. +.. warning:: + You should avoid using ``.call()`` when executing another contract function as it bypasses the compiler 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 -- cgit From 5279f9f03bdcaafaeaadb20121f8cab550b2ed9e Mon Sep 17 00:00:00 2001 From: Erik Kundt Date: Thu, 17 Jan 2019 10:19:16 +0200 Subject: Update docs/units-and-global-variables.rst Co-Authored-By: ChrisChinchilla --- docs/units-and-global-variables.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/units-and-global-variables.rst b/docs/units-and-global-variables.rst index e44caa8f..c47f257b 100644 --- a/docs/units-and-global-variables.rst +++ b/docs/units-and-global-variables.rst @@ -200,7 +200,7 @@ Members of Address Types For more information, see the section on :ref:`address`. .. warning:: - You should avoid using ``.call()`` when executing another contract function as it bypasses the compiler type checking, + You should avoid using ``.call()`` whenever possible when executing another contract function as it bypasses type checking, function existence check, and argument packing. .. warning:: -- cgit