mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Brought warning to high priority
Update functions.rst Update for warning over note priority Updated units-and-global-variables.rst Updated file for warning over note priority Updated control-structures.rst Updated priority of warning over note Updated assembly.rst Updated priority of warning over code Updated introduction-to-smart-contracts.rst Updated priority of warning over note Update installing-solidity.rst Corrected control-structures.rst Corrected white space error Corrected whitespace Corrected whitespace introduction to smart contract
This commit is contained in:
committed by
vigneshkarthikeyan
parent
dd04a35c0e
commit
3d40152102
@@ -252,10 +252,6 @@ will consume more gas than the 2300 gas stipend:
|
||||
|
||||
Like any function, the fallback function can execute complex operations as long as there is enough gas passed on to it.
|
||||
|
||||
.. note::
|
||||
Even though the fallback function cannot have arguments, one can still use ``msg.data`` to retrieve
|
||||
any payload supplied with the call.
|
||||
|
||||
.. warning::
|
||||
The fallback function is also executed if the caller meant to call
|
||||
a function that is not available. If you want to implement the fallback
|
||||
@@ -273,6 +269,10 @@ Like any function, the fallback function can execute complex operations as long
|
||||
A contract without a payable fallback function can receive Ether as a recipient of a `coinbase transaction` (aka `miner block reward`)
|
||||
or as a destination of a ``selfdestruct``.
|
||||
|
||||
.. note::
|
||||
Even though the fallback function cannot have arguments, one can still use ``msg.data`` to retrieve
|
||||
any payload supplied with the call.
|
||||
|
||||
A contract cannot react to such Ether transfers and thus also cannot reject them. This is a design choice of the EVM and Solidity cannot work around it.
|
||||
|
||||
It also means that ``address(this).balance`` can be higher than the sum of some manual accounting implemented in a contract (i.e. having a counter updated in the fallback function).
|
||||
|
||||
Reference in New Issue
Block a user