From 615668bfb4dd5fbe7df0619b537f17e680e2b6fb Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 23 Apr 2020 01:35:21 +0200 Subject: [PATCH] Explain nonpayable Fixes https://github.com/ethereum/solidity/issues/8736 --- docs/abi-spec.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/abi-spec.rst b/docs/abi-spec.rst index 59636acb6..ec31654dd 100644 --- a/docs/abi-spec.rst +++ b/docs/abi-spec.rst @@ -507,13 +507,17 @@ A function description is a JSON object with the fields: - ``outputs``: an array of objects similar to ``inputs``. - ``stateMutability``: a string with one of the following values: ``pure`` (:ref:`specified to not read blockchain state `), ``view`` (:ref:`specified to not modify the blockchain - state `), ``nonpayable`` (function does not accept Ether) and ``payable`` (function accepts Ether). + state `), ``nonpayable`` (function does not accept Ether - the default) and ``payable`` (function accepts Ether). Constructor and fallback function never have ``name`` or ``outputs``. Fallback function doesn't have ``inputs`` either. .. note:: Sending non-zero Ether to non-payable function will revert the transaction. +.. note:: + The state mutability ``nonpayable`` is reflected in Solidity by not specifying + a state mutability modifier at all. + An event description is a JSON object with fairly similar fields: - ``type``: always ``"event"``