Merge pull request #2945 from LefterisJP/docs_fix_fallback_gas

Better specify the fall function gas cost in the docs.
This commit is contained in:
chriseth 2017-09-21 14:44:12 +02:00 committed by GitHub
commit 68fbe1ec0e

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 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: