Merge payable FAQ item

This commit is contained in:
Chris Ward 2019-01-16 14:36:59 +02:00
parent 606c2b9945
commit a1df27ae3d
2 changed files with 2 additions and 9 deletions

View File

@ -236,9 +236,9 @@ functions match the given function identifier (or if no data was supplied at
all). all).
Furthermore, this function is executed whenever the contract receives plain Furthermore, this function is executed whenever the contract receives plain
Ether (without data). Additionally, in order to receive Ether, the fallback function Ether (without data). To receive Ether and add it to the total balance of the contract, the fallback function
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 and throws an exception.
In the worst case, the fallback function can only rely on 2300 gas being In the worst case, the fallback function can only rely on 2300 gas being
available (for example when `send` or `transfer` is used), leaving little available (for example when `send` or `transfer` is used), leaving little

View File

@ -54,13 +54,6 @@ Yes, you can use ``abi.encodePacked``::
} }
} }
What happens if you send ether along with a function call to a contract?
========================================================================
It gets added to the total balance of the contract, just like when you send ether when creating a contract.
You can only send ether along to a function that has the ``payable`` modifier,
otherwise an exception is thrown.
****************** ******************
Advanced Questions Advanced Questions
****************** ******************