aboutsummaryrefslogtreecommitdiffstats
path: root/docs/types.rst
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-07-12 01:10:42 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-09-13 18:40:57 +0800
commitc70ebfd241cc3dc6d19847d94b11784da1c79cdd (patch)
treebb62bc052da4098c745aed537729349b39b9eb08 /docs/types.rst
parentfd1f8ab38ba7f2bb04e67a44ea5e947eddcf9b13 (diff)
downloaddexon-solidity-c70ebfd241cc3dc6d19847d94b11784da1c79cdd.tar.gz
dexon-solidity-c70ebfd241cc3dc6d19847d94b11784da1c79cdd.tar.zst
dexon-solidity-c70ebfd241cc3dc6d19847d94b11784da1c79cdd.zip
Document function selectors
Diffstat (limited to 'docs/types.rst')
-rw-r--r--docs/types.rst11
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/types.rst b/docs/types.rst
index 3335655a..5c291f35 100644
--- a/docs/types.rst
+++ b/docs/types.rst
@@ -400,6 +400,17 @@ Note that public functions of the current contract can be used both as an
internal and as an external function. To use ``f`` as an internal function,
just use ``f``, if you want to use its external form, use ``this.f``.
+Additionally, public (or external) functions also have a special member called ``selector``,
+which returns the :ref:`ABI function selector <abi_function_selector>`::
+
+ pragma solidity ^0.4.0;
+
+ contract Selector {
+ function f() returns (bytes4) {
+ return this.f.selector;
+ }
+ }
+
Example that shows how to use internal function types::
pragma solidity ^0.4.5;