mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Tests, Docs and Changelog
This commit is contained in:
@@ -123,9 +123,9 @@ throws an exception or goes out of gas.
|
||||
so your contract is not vulnerable to a reentrancy exploit.
|
||||
|
||||
.. note::
|
||||
Before Solidity 0.6.2, the recommended way to specify the value and gas
|
||||
was to use ``f.value(x).gas(g)()``. This is still possible but deprecated
|
||||
and will be removed with Solidity 0.7.0.
|
||||
Before Solidity 0.6.2, the recommended way to specify the value and gas was to
|
||||
use ``f.value(x).gas(g)()``. This was deprecated in Solidity 0.6.2 and is no
|
||||
longer possible since Solidity 0.7.0.
|
||||
|
||||
Named Calls and Anonymous Function Parameters
|
||||
---------------------------------------------
|
||||
@@ -716,4 +716,4 @@ in scope in the block that follows.
|
||||
out-of-gas situation and not a deliberate error condition:
|
||||
The caller always retains 63/64th of the gas in a call and thus
|
||||
even if the called contract goes out of gas, the caller still
|
||||
has some gas left.
|
||||
has some gas left.
|
||||
|
||||
+10
-11
@@ -641,17 +641,18 @@ External (or public) functions have the following members:
|
||||
|
||||
* ``.address`` returns the address of the contract of the function.
|
||||
* ``.selector`` returns the :ref:`ABI function selector <abi_function_selector>`
|
||||
* ``.gas(uint)`` returns a callable function object which, when called, will send
|
||||
the specified amount of gas to the target function. Deprecated - use ``{gas: ...}`` instead.
|
||||
See :ref:`External Function Calls <external-function-calls>` for more information.
|
||||
* ``.value(uint)`` returns a callable function object which, when called, will
|
||||
send the specified amount of wei to the target function. Deprecated - use ``{value: ...}`` instead.
|
||||
See :ref:`External Function Calls <external-function-calls>` for more information.
|
||||
|
||||
.. note::
|
||||
External (or public) functions used to have the additional members
|
||||
``.gas(uint)`` and ``.value(uint)``. These were deprecated in Solidity 0.6.2
|
||||
and removed in Solidity 0.7.0. Instead use ``{gas: ...}`` and ``{value: ...}``
|
||||
to specify the amount of gas or the amount of wei sent to a function,
|
||||
respectively. See :ref:`External Function Calls <external-function-calls>` for
|
||||
more information.
|
||||
|
||||
Example that shows how to use the members::
|
||||
|
||||
pragma solidity >=0.6.0 <0.8.0;
|
||||
// This will report a warning
|
||||
pragma solidity >=0.6.4 <0.8.0;
|
||||
|
||||
contract Example {
|
||||
function f() public payable returns (bytes4) {
|
||||
@@ -660,9 +661,7 @@ Example that shows how to use the members::
|
||||
}
|
||||
|
||||
function g() public {
|
||||
this.f.gas(10).value(800)();
|
||||
// New syntax:
|
||||
// this.f{gas: 10, value: 800}()
|
||||
this.f{gas: 10, value: 800}();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user