aboutsummaryrefslogtreecommitdiffstats
path: root/docs/contracts.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/contracts.rst')
-rw-r--r--docs/contracts.rst10
1 files changed, 8 insertions, 2 deletions
diff --git a/docs/contracts.rst b/docs/contracts.rst
index 0dd9845c..0c697dd6 100644
--- a/docs/contracts.rst
+++ b/docs/contracts.rst
@@ -315,7 +315,10 @@ inheritable properties of contracts and may be overridden by derived contracts.
// function is executed and otherwise, an exception is
// thrown.
modifier onlyOwner {
- require(msg.sender == owner);
+ require(
+ msg.sender == owner,
+ "Only owner can call this function."
+ );
_;
}
}
@@ -360,7 +363,10 @@ inheritable properties of contracts and may be overridden by derived contracts.
contract Mutex {
bool locked;
modifier noReentrancy() {
- require(!locked);
+ require(
+ !locked,
+ "Reentrant call."
+ );
locked = true;
_;
locked = false;