From cde4e3172be3fe87e4e229f28ad96b0844fa4bd4 Mon Sep 17 00:00:00 2001 From: bernard peh Date: Fri, 2 Mar 2018 23:40:17 +1100 Subject: change the language so that it doesn't sound like send and transfer is providing the stipend --- docs/contracts.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/contracts.rst b/docs/contracts.rst index cfd5256a..3df722db 100644 --- a/docs/contracts.rst +++ b/docs/contracts.rst @@ -523,7 +523,12 @@ 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. -It is worth nothing that the "send" or "transfer" function only has a 2300 gas stipend. If the fallback function is called by another contract account using the send/transfer function (eg address.transfer(1 ether)), then the fallback function only has 2300 gas to spend, meaning that it cannot do much other than basic logging. +In the worst case, the fallback function can only rely on 2300 gas being available (for example when send or transfer is used), leaving not much room to perform other operations except basic logging. The following operations will consume more gas than the 2300 gas stipend: + +- Writing to storage +- Creating a contract +- Calling an external function which consumes a large amount of gas +- Sending Ether Like any function, the fallback function can execute complex operations as long as there is enough gas passed on to it. -- cgit v1.2.3