mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #8750 from ethereum/chriseth-patch-1
Explain nonpayable
This commit is contained in:
commit
aaa434dad9
@ -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 <pure-functions>`), ``view`` (:ref:`specified to not modify the blockchain
|
||||
state <view-functions>`), ``nonpayable`` (function does not accept Ether) and ``payable`` (function accepts Ether).
|
||||
state <view-functions>`), ``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"``
|
||||
|
Loading…
Reference in New Issue
Block a user