aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2018-07-24 02:29:17 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2018-07-25 18:23:41 +0800
commit76bc04244aecb159d98a70bda0594aba57217195 (patch)
tree526b5c144e110872cf5458dba0a455f306b9037a /docs
parentae15b52d932dc7b186b6560e8d910106c5ca1043 (diff)
downloaddexon-solidity-76bc04244aecb159d98a70bda0594aba57217195.tar
dexon-solidity-76bc04244aecb159d98a70bda0594aba57217195.tar.gz
dexon-solidity-76bc04244aecb159d98a70bda0594aba57217195.tar.bz2
dexon-solidity-76bc04244aecb159d98a70bda0594aba57217195.tar.lz
dexon-solidity-76bc04244aecb159d98a70bda0594aba57217195.tar.xz
dexon-solidity-76bc04244aecb159d98a70bda0594aba57217195.tar.zst
dexon-solidity-76bc04244aecb159d98a70bda0594aba57217195.zip
Clarify relation between stateMutability and payable/constant
Diffstat (limited to 'docs')
-rw-r--r--docs/abi-spec.rst11
1 files changed, 6 insertions, 5 deletions
diff --git a/docs/abi-spec.rst b/docs/abi-spec.rst
index 5f6d7d50..16839292 100644
--- a/docs/abi-spec.rst
+++ b/docs/abi-spec.rst
@@ -410,15 +410,16 @@ A function description is a JSON object with the fields:
* ``components``: used for tuple types (more below).
- ``outputs``: an array of objects similar to ``inputs``, can be omitted if function doesn't return anything;
-- ``payable``: ``true`` if function accepts ether, defaults to ``false``;
-- ``stateMutability``: a string with one of the following values: ``pure`` (:ref:`specified to not read blockchain state <pure-functions>`), ``view`` (:ref:`specified to not modify the blockchain state <view-functions>`), ``nonpayable`` and ``payable`` (same as ``payable`` above).
-- ``constant``: ``true`` if function is either ``pure`` or ``view``
+- ``stateMutability``: a string with one of the following values: ``pure`` (:ref:`specified to not read blockchain state <pure-functions>`), ``view`` (:ref:`specified to not modify the blockchain state <view-functions>`), ``nonpayable`` (function does not accept ether) and ``payable`` (function accepts ether);
+- ``payable``: ``true`` if function accepts ether, ``false`` otherwise;
+- ``constant``: ``true`` if function is either ``pure`` or ``view``, ``false`` otherwise.
-``type`` can be omitted, defaulting to ``"function"``.
+``type`` can be omitted, defaulting to ``"function"``, likewise ``payable`` and ``constant`` can be omitted, both defaulting to ``false``.
Constructor and fallback function never have ``name`` or ``outputs``. Fallback function doesn't have ``inputs`` either.
-Sending non-zero ether to non-payable function will throw. Don't do it.
+.. note::
+ Sending non-zero ether to non-payable function will revert the transaction.
An event description is a JSON object with fairly similar fields: