mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Explain that .value() is only available if contract function is marked payable
This commit is contained in:
parent
6ece0d6c2f
commit
17443f458a
@ -127,8 +127,8 @@ the gas can be specified with special options ``.value()`` and ``.gas()``, respe
|
|||||||
function callFeed() { feed.info.value(10).gas(800)(); }
|
function callFeed() { feed.info.value(10).gas(800)(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
The modifier ``payable`` has to be used for ``info``, because otherwise,
|
The modifier ``payable`` has to be used for ``info``, because otherwise, the `.value()`
|
||||||
we would not be able to send Ether to it in the call ``feed.info.value(10).gas(800)()``.
|
option would not be available.
|
||||||
|
|
||||||
Note that the expression ``InfoFeed(addr)`` performs an explicit type conversion stating
|
Note that the expression ``InfoFeed(addr)`` performs an explicit type conversion stating
|
||||||
that "we know that the type of the contract at the given address is ``InfoFeed``" and
|
that "we know that the type of the contract at the given address is ``InfoFeed``" and
|
||||||
|
Loading…
Reference in New Issue
Block a user