Skip to content

Commit e2176ff

Browse files
fixup! Update docs
1 parent ef25da2 commit e2176ff

File tree

9 files changed

+26
-43
lines changed

9 files changed

+26
-43
lines changed

docs/assembly.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ of Solidity, you can use a special comment to annotate an assembly block as memo
383383
384384
.. warning::
385385
The ``memory-safe-assembly`` special comment is deprecated and scheduled for removal.
386-
For new code targeting recent compilers, specify the assembly block annotation.
386+
In new code targeting recent compilers, use the assembly block annotation.
387387

388388
Advanced Safe Use of Memory
389389
---------------------------

docs/cheatsheet.rst

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,8 @@ Members of ``address``
5353
- ``<address>.staticcall(bytes memory) returns (bool, bytes memory)``: issue low-level ``STATICCALL`` with the given payload,
5454
returns success condition and return data
5555
- ``<address payable>.send(uint256 amount) returns (bool)``: send given amount of Wei to :ref:`address`,
56-
returns ``false`` on failure
57-
- ``<address payable>.transfer(uint256 amount)``: send given amount of Wei to :ref:`address`, throws on failure
58-
59-
.. warning::
60-
`send()` and `transfer()` are deprecated and scheduled for removal.
61-
Simple ether transfers can still be performed using the [`call()`](...) function with empty payload, i.e., `call{value: <amount>}("")`.
62-
By default this forwards all the remaining gas, subject to additional limits imposed by some EVM versions
63-
(such as the [63/64th rule](https://eips.ethereum.org/EIPS/eip-150) introduced by `tangerineWhistle`).
64-
As with any external call, the `gas` call option can be used to set a lower limit.
65-
66-
While it is possible to recreate the functionality by explicitly setting the limit to the value of the stipend (2300 gas),
67-
this value no longer holds its original meaning due to changing opcode costs.
68-
It is recommended to use different means to protect against reentrancy.
56+
returns ``false`` on failure (deprecated)
57+
- ``<address payable>.transfer(uint256 amount)``: send given amount of Wei to :ref:`address`, throws on failure (deprecated)
6958

7059
.. index:: blockhash, blobhash, block, block;basefee, block;blobbasefee, block;chainid, block;coinbase, block;difficulty, block;gaslimit, block;number, block;prevrandao, block;timestamp
7160
.. index:: gasleft, msg;data, msg;sender, msg;sig, msg;value, tx;gasprice, tx;origin

docs/contracts/functions.rst

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -311,11 +311,8 @@ will consume more gas than the 2300 gas stipend:
311311
- Sending Ether
312312

313313
.. warning::
314-
`send()` and `transfer()` are deprecated and scheduled for removal.
315-
Simple ether transfers can still be performed using the [`call()`](...) function with empty payload, i.e., `call{value: <amount>}("")`.
316-
By default this forwards all the remaining gas, subject to additional limits imposed by some EVM versions
317-
(such as the [63/64th rule](https://eips.ethereum.org/EIPS/eip-150) introduced by `tangerineWhistle`).
318-
As with any external call, the `gas` call option can be used to set a lower limit.
314+
``send()`` and ``transfer()`` are deprecated and scheduled for removal.
315+
See the section on :ref:`address` for more information.
319316

320317
While it is possible to recreate the functionality by explicitly setting the limit to the value of the stipend (2300 gas),
321318
this value no longer holds its original meaning due to changing opcode costs.

docs/contracts/inheritance.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ explicitly:
428428
}
429429
430430
.. warning::
431-
``virtual`` modifiers are deprecated and scheduled.
431+
``virtual`` modifiers are deprecated and scheduled for removal.
432432

433433

434434
.. index:: ! constructor

docs/examples/blind-auction.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ to receive their Ether - contracts cannot activate themselves.
118118
if (amount > 0) {
119119
// It is important to set this to zero because the recipient
120120
// can call this function again as part of the receiving call
121-
// before `send` returns.
121+
// before `call` returns.
122122
pendingReturns[msg.sender] = 0;
123123
124124
// msg.sender is not of type `address payable` and must be
@@ -322,7 +322,7 @@ invalid bids.
322322
if (amount > 0) {
323323
// It is important to set this to zero because the recipient
324324
// can call this function again as part of the receiving call
325-
// before `transfer` returns (see the remark above about
325+
// before `call` returns (see the remark above about
326326
// conditions -> effects -> interaction).
327327
pendingReturns[msg.sender] = 0;
328328

docs/examples/safe-remote.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ you can use state machine-like constructs inside a contract.
9393
{
9494
emit Aborted();
9595
state = State.Inactive;
96-
// We use transfer here directly. It is
96+
// We use call here directly. It is
9797
// reentrancy-safe, because it is the
9898
// last call in this function and we
9999
// already changed the state.
@@ -125,7 +125,7 @@ you can use state machine-like constructs inside a contract.
125125
{
126126
emit ItemReceived();
127127
// It is important to change the state first because
128-
// otherwise, the contracts called using `send` below
128+
// otherwise, the contracts called using `call` below
129129
// can call in again here.
130130
state = State.Release;
131131
@@ -142,7 +142,7 @@ you can use state machine-like constructs inside a contract.
142142
{
143143
emit SellerRefunded();
144144
// It is important to change the state first because
145-
// otherwise, the contracts called using `send` below
145+
// otherwise, the contracts called using `call` below
146146
// can call in again here.
147147
state = State.Inactive;
148148

docs/security-considerations.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Ether transfer can always include code execution,
7777
so the recipient could be a contract that calls back into ``withdraw``.
7878
This would let it get multiple refunds and, basically, retrieve all the Ether in the contract.
7979
In particular, the following contract will allow an attacker to refund multiple times
80-
as it uses ``call`` which forwards 63/64 of the remaining gas by default:
80+
as it uses ``call`` which does not limit the amount of gas that is forwarded by default:
8181

8282
.. code-block:: solidity
8383
@@ -161,8 +161,8 @@ Sending and Receiving Ether
161161

162162
- There is a way to forward more gas to the receiving contract using ``addr.call{value: x}("")``.
163163
This is essentially the same as ``addr.transfer(x)``, only that it forwards all remaining gas,
164-
subject to additional limits imposed by some EVM versions (such as the [63/64th rule](https://eips.ethereum.org/EIPS/eip-150)
165-
introduced by `tangerineWhistle`), and opens up the ability for the recipient to perform more expensive actions
164+
subject to additional limits imposed by some EVM versions (such as the `63/64th rule <https://eips.ethereum.org/EIPS/eip-150>`__
165+
introduced by ``tangerineWhistle``), and opens up the ability for the recipient to perform more expensive actions
166166
(and it returns a failure code instead of automatically propagating the error).
167167
This might include calling back into the sending contract or other state changes you might not have thought of.
168168
So it allows for great flexibility for honest users but also for malicious actors.

docs/types/value-types.rst

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,11 @@ For a quick reference of all members of address, see :ref:`address_related`.
263263

264264
.. warning::
265265
``transfer`` is deprecated and scheduled for removal.
266-
Use the :ref:`call function <address_call_functions>` with an optionally provided maximum amount of
267-
gas and an empty calldata parameter, e.g., ``call{value: amount}("")``.
268-
By default forwards all remaining gas, subject to additional limits imposed by some EVM versions (such as the [63/64th rule](https://eips.ethereum.org/EIPS/eip-150) introduced by `tangerineWhistle`).
269-
As with any external call, the `gas` call option can be used to set a lower limit.
266+
Simple ether transfers can still be performed using the :ref:`call function <address_call_functions>`
267+
with with an optionally provided maximum amount of gas and empty payload, i.e., ``call{value: <amount>}("")``.
268+
By default this forwards all the remaining gas, subject to additional limits imposed by some EVM versions
269+
(such as the `63/64th rule <https://eips.ethereum.org/EIPS/eip-150>`__ introduced by ``tangerineWhistle``).
270+
As with any external call, the ``gas`` call option can be used to set a lower limit.
270271

271272
* ``send``
272273

@@ -280,10 +281,11 @@ For a quick reference of all members of address, see :ref:`address_related`.
280281

281282
.. warning::
282283
``send`` is deprecated and scheduled for removal.
283-
Use the :ref:`call function <address_call_functions>` with an optionally provided maximum amount of
284-
gas and an empty calldata parameter, e.g., ``call{value: amount}("")``.
285-
By default forwards all remaining gas, subject to additional limits imposed by some EVM versions (such as the [63/64th rule](https://eips.ethereum.org/EIPS/eip-150) introduced by `tangerineWhistle`).
286-
As with any external call, the `gas` call option can be used to set a lower limit.
284+
Simple ether transfers can still be performed using the :ref:`call function <address_call_functions>`
285+
with with an optionally provided maximum amount of gas and empty payload, i.e., ``call{value: <amount>}("")``.
286+
By default this forwards all the remaining gas, subject to additional limits imposed by some EVM versions
287+
(such as the `63/64th rule <https://eips.ethereum.org/EIPS/eip-150>`__ introduced by ``tangerineWhistle``).
288+
As with any external call, the ``gas`` call option can be used to set a lower limit.
287289

288290
.. _address_call_functions:
289291

docs/units-and-global-variables.rst

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -269,13 +269,8 @@ Members of Address Types
269269
send given amount of Wei to :ref:`address`, returns ``false`` on failure, forwards 2300 gas stipend, not adjustable
270270

271271
.. warning::
272-
`send()` and `transfer()` are deprecated and scheduled for removal.
273-
Simple ether transfers can still be performed using the [`call()`](...) function with empty payload, i.e., `call{value: <amount>}("")`.
274-
By default this forwards all the remaining gas, subject to additional limits imposed by some EVM versions (such as the [63/64th rule](https://eips.ethereum.org/EIPS/eip-150) introduced by `tangerineWhistle`).
275-
As with any external call, the `gas` call option can be used to set a lower limit.
276-
277-
While it is possible to recreate the functionality by explicitly setting the limit to the value of the stipend (2300 gas), this value no longer holds its original meaning due to changing opcode costs.
278-
It is recommended to use different means to protect against reentrancy.
272+
``send()`` and ``transfer()`` are deprecated and scheduled for removal.
273+
See the section on :ref:`address` for more information.
279274

280275
``<address>.call(bytes memory) returns (bool, bytes memory)``
281276
issue low-level ``CALL`` with the given payload, returns success condition and return data,

0 commit comments

Comments
 (0)