Skip to content

Commit e96453d

Browse files
The-ArbiterLeo Alt
authored andcommitted
Added details on placeholders in function-modifiers
Author: NoFaceDev <[email protected]> Date: Sat Jul 23 18:22:06 2022 +0400
1 parent 2420966 commit e96453d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/contracts/function-modifiers.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ whitespace-separated list and are evaluated in the order presented.
111111
Modifiers cannot implicitly access or change the arguments and return values of functions they modify.
112112
Their values can only be passed to them explicitly at the point of invocation.
113113

114+
In function modifiers, it is necessary to specify when you want the function to which the modifier is
115+
applied to be run. The placeholder statement (denoted by a single underscore character ``_``) is used to
116+
denote where the body of the function being modified should be inserted. Note that the
117+
placeholder operator is different from using underscores as leading or trailing characters in variable
118+
names, which is a stylistic choice.
119+
114120
Explicit returns from a modifier or function body only leave the current
115121
modifier or function body. Return variables are assigned and
116122
control flow continues after the ``_`` in the preceding modifier.

0 commit comments

Comments
 (0)