diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/contracts.rst | 11 | ||||
-rw-r--r-- | docs/solidity-by-example.rst | 2 |
2 files changed, 12 insertions, 1 deletions
diff --git a/docs/contracts.rst b/docs/contracts.rst index afc32b16..368b7819 100644 --- a/docs/contracts.rst +++ b/docs/contracts.rst @@ -1053,6 +1053,17 @@ but they can be used as base contracts:: If a contract inherits from an abstract contract and does not implement all non-implemented functions by overriding, it will itself be abstract. +Note that a function without implementation is different from a :ref:`Function Type <function_types>` even though their syntax looks very similar. + +Example of function without implementation (a function declaration):: + + function foo(address) external returns (address); + +Example of a Function Type (a variable declaration, where the variable is of type ``function``):: + + function(address) external returns (address) foo; + + .. index:: ! contract;interface, ! interface contract ********** diff --git a/docs/solidity-by-example.rst b/docs/solidity-by-example.rst index b663083c..b8e158ac 100644 --- a/docs/solidity-by-example.rst +++ b/docs/solidity-by-example.rst @@ -272,7 +272,7 @@ activate themselves. // money back. require(msg.value > highestBid); - if (highestBidder != 0) { + if (highestBid != 0) { // Sending back the money by simply using // highestBidder.send(highestBid) is a security risk // because it could execute an untrusted contract. |