aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2018-07-25 19:38:17 +0800
committerGitHub <noreply@github.com>2018-07-25 19:38:17 +0800
commite94eb1ed6eb2768e1babdd8a11fcaa2f73365372 (patch)
tree333e99bf31657ff2876c2c631645599ab669741c
parentae15b52d932dc7b186b6560e8d910106c5ca1043 (diff)
parent61a8b098e6c2caf55afea3742f5011a41afa5755 (diff)
downloaddexon-solidity-e94eb1ed6eb2768e1babdd8a11fcaa2f73365372.tar.gz
dexon-solidity-e94eb1ed6eb2768e1babdd8a11fcaa2f73365372.tar.zst
dexon-solidity-e94eb1ed6eb2768e1babdd8a11fcaa2f73365372.zip
Merge pull request #4549 from ethereum/deprecate-abi
Mention that constant and payable are deprecated in the ABI spec
-rw-r--r--docs/abi-spec.rst14
1 files changed, 9 insertions, 5 deletions
diff --git a/docs/abi-spec.rst b/docs/abi-spec.rst
index 5f6d7d50..82c9f67a 100644
--- a/docs/abi-spec.rst
+++ b/docs/abi-spec.rst
@@ -410,15 +410,19 @@ 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.
+.. warning::
+ The fields ``constant`` and ``payable`` are deprecated and will be removed in the future. Instead, the ``stateMutability`` field can be used to determine the same properties.
+
+.. note::
+ Sending non-zero ether to non-payable function will revert the transaction.
An event description is a JSON object with fairly similar fields: