aboutsummaryrefslogtreecommitdiffstats
path: root/docs/contracts.rst
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-02-17 00:32:30 +0800
committerchriseth <chris@ethereum.org>2018-02-22 22:17:42 +0800
commitf58024b9744f557dbc77d5f7bfbc4319bde2e0c7 (patch)
treeabde5538e7cedcf41cafb9fe0681ad505380c496 /docs/contracts.rst
parent04c922e5ed038fd5f6d43a364e11b8c459898a93 (diff)
downloaddexon-solidity-f58024b9744f557dbc77d5f7bfbc4319bde2e0c7.tar.gz
dexon-solidity-f58024b9744f557dbc77d5f7bfbc4319bde2e0c7.tar.zst
dexon-solidity-f58024b9744f557dbc77d5f7bfbc4319bde2e0c7.zip
Documentation about emitting events.
Diffstat (limited to 'docs/contracts.rst')
-rw-r--r--docs/contracts.rst10
1 files changed, 6 insertions, 4 deletions
diff --git a/docs/contracts.rst b/docs/contracts.rst
index 368b7819..ee203263 100644
--- a/docs/contracts.rst
+++ b/docs/contracts.rst
@@ -724,10 +724,12 @@ All non-indexed arguments will be stored in the data part of the log.
);
function deposit(bytes32 _id) public payable {
- // Any call to this function (even deeply nested) can
- // be detected from the JavaScript API by filtering
- // for `Deposit` to be called.
- Deposit(msg.sender, _id, msg.value);
+ // Events are emitted using `emit`, followed by
+ // the name of the event and the arguments
+ // (if any) in parentheses. Any such invocation
+ // (even deeply nested) can be detected from
+ // the JavaScript API by filtering for `Deposit`.
+ emit Deposit(msg.sender, _id, msg.value);
}
}