Merge pull request #7982 from ethereum/updateVisibility

Update visibility and getters.
This commit is contained in:
chriseth 2019-12-12 14:02:35 +01:00 committed by GitHub
commit fc085cb141
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,10 +6,10 @@
Visibility and Getters Visibility and Getters
********************** **********************
Since Solidity knows two kinds of function calls (internal Solidity knows two kinds of function calls: internal
ones that do not create an actual EVM call (also called ones that do not create an actual EVM call (also called
a "message call") and external a "message call") and external
ones that do), there are four types of visibilities for ones that do. Because of that, there are four types of visibility for
functions and state variables. functions and state variables.
Functions have to be specified as being ``external``, Functions have to be specified as being ``external``,
@ -22,7 +22,8 @@ For state variables, ``external`` is not possible.
via transactions. An external function ``f`` cannot be called via transactions. An external function ``f`` cannot be called
internally (i.e. ``f()`` does not work, but ``this.f()`` works). internally (i.e. ``f()`` does not work, but ``this.f()`` works).
External functions are sometimes more efficient when External functions are sometimes more efficient when
they receive large arrays of data. they receive large arrays of data, because the data
is not copied from calldata to memory.
``public``: ``public``:
Public functions are part of the contract interface Public functions are part of the contract interface