mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
docs: Specify gas fallback function from call
Specify that also 21k gas is needed for fallback functions originating from external function calls.
This commit is contained in:
parent
ab8b1bcc72
commit
7f88d43937
@ -519,8 +519,7 @@ Ether (without data). Additionally, in order to receive Ether, the fallback func
|
|||||||
must be marked ``payable``. If no such function exists, the contract cannot receive
|
must be marked ``payable``. If no such function exists, the contract cannot receive
|
||||||
Ether through regular transactions.
|
Ether through regular transactions.
|
||||||
|
|
||||||
In such a context, there is usually very little gas available to the function call (to be precise, 2300 gas),
|
In such a context, there is usually very little gas available to the function call (to be precise, 2300 gas), so it is important to make fallback functions as cheap as possible. Note that the gas required by a transaction (as opposed to an internal call) that invokes the fallback function is much higher, because each transaction charges an additional amount of 21000 gas or more for things like signature checking.
|
||||||
so it is important to make fallback functions as cheap as possible.
|
|
||||||
|
|
||||||
In particular, the following operations will consume more gas than the stipend provided to a fallback function:
|
In particular, the following operations will consume more gas than the stipend provided to a fallback function:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user