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:
Lefteris Karapetsas 2017-09-21 14:15:13 +02:00
parent ab8b1bcc72
commit 7f88d43937
No known key found for this signature in database
GPG Key ID: AC4257C95510463E

View File

@ -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
Ether through regular transactions.
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.
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.
In particular, the following operations will consume more gas than the stipend provided to a fallback function: