summaryrefslogtreecommitdiffhomepage
path: root/solidity.html.markdown
diff options
context:
space:
mode:
authorshooter <shooter.hero@gmail.com>2018-12-04 00:25:57 +0800
committershooter <shooter.hero@gmail.com>2018-12-25 15:08:20 +0800
commit484e1325ef5c1cda1298b82c64252405e57d6a98 (patch)
tree4d30fed1df90e6228faa0e2b8970357cef97f581 /solidity.html.markdown
parent4d487850893fb52c8345fae25c06822e7f0e3857 (diff)
Javascript code mixes with Solidity code, not good
Diffstat (limited to 'solidity.html.markdown')
-rw-r--r--solidity.html.markdown10
1 files changed, 8 insertions, 2 deletions
diff --git a/solidity.html.markdown b/solidity.html.markdown
index a545f3ce..d3f70623 100644
--- a/solidity.html.markdown
+++ b/solidity.html.markdown
@@ -403,8 +403,12 @@ event LogSent(address indexed from, address indexed to, uint amount); // note ca
// Call
LogSent(from, to, amount);
-// For an external party (a contract or external entity), to watch using
-// the Web3 Javascript library:
+/**
+
+For an external party (a contract or external entity), to watch using
+the Web3 Javascript library:
+
+// The following is Javascript code, not Solidity code
Coin.LogSent().watch({}, '', function(error, result) {
if (!error) {
console.log("Coin transfer: " + result.args.amount +
@@ -415,6 +419,8 @@ Coin.LogSent().watch({}, '', function(error, result) {
"Receiver: " + Coin.balances.call(result.args.to));
}
}
+**/
+
// Common paradigm for one contract to depend on another (e.g., a
// contract that depends on current exchange rate provided by another)