Merge pull request #11866 from ethereum/clarifyExample

Clarify function call options example.
This commit is contained in:
chriseth 2021-08-31 17:08:25 +02:00 committed by GitHub
commit 208ba61ee6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -105,8 +105,10 @@ otherwise, the ``value`` option would not be available.
.. warning:: .. warning::
Be careful that ``feed.info{value: 10, gas: 800}`` only locally sets the Be careful that ``feed.info{value: 10, gas: 800}`` only locally sets the
``value`` and amount of ``gas`` sent with the function call, and the ``value`` and amount of ``gas`` sent with the function call, and the
parentheses at the end perform the actual call. So in this case, the parentheses at the end perform the actual call. So
function is not called and the ``value`` and ``gas`` settings are lost. ``feed.info{value: 10, gas: 800}`` does not call the function and
the ``value`` and ``gas`` settings are lost, only
``feed.info{value: 10, gas: 800}()`` performs the function call.
Due to the fact that the EVM considers a call to a non-existing contract to Due to the fact that the EVM considers a call to a non-existing contract to
always succeed, Solidity uses the ``extcodesize`` opcode to check that always succeed, Solidity uses the ``extcodesize`` opcode to check that