From 4d487850893fb52c8345fae25c06822e7f0e3857 Mon Sep 17 00:00:00 2001 From: shooter Date: Tue, 4 Dec 2018 00:21:52 +0800 Subject: Fix: `console.log` is javascript grammer --- solidity.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'solidity.html.markdown') diff --git a/solidity.html.markdown b/solidity.html.markdown index 4ff770eb..a545f3ce 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -237,7 +237,7 @@ uint x[][5]; // arr with 5 dynamic array elements (opp order of most languages) // Dictionaries (any type to any other type) mapping (string => uint) public balances; balances["charles"] = 1; -console.log(balances["ada"]); // is 0, all non-set key values return zeroes +// balances["ada"] is 0, all non-set key values return zeroes // 'public' allows following from another contract contractName.balances("charles"); // returns 1 // 'public' created a getter (but not setter) like the following: -- cgit v1.2.3 From 484e1325ef5c1cda1298b82c64252405e57d6a98 Mon Sep 17 00:00:00 2001 From: shooter Date: Tue, 4 Dec 2018 00:25:57 +0800 Subject: Javascript code mixes with Solidity code, not good --- solidity.html.markdown | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'solidity.html.markdown') 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) -- cgit v1.2.3 From 84f9aa47fce4e2ac0b2b22d5077426fe1162b027 Mon Sep 17 00:00:00 2001 From: shooter Date: Tue, 25 Dec 2018 15:05:13 +0800 Subject: update chinese version content --- solidity.html.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'solidity.html.markdown') diff --git a/solidity.html.markdown b/solidity.html.markdown index d3f70623..d215180d 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -5,6 +5,7 @@ contributors: - ["Nemil Dalal", "https://www.nemil.com"] - ["Joseph Chow", ""] - ["Bhoomtawath Plinsut", "https://github.com/varshard"] + - ["Shooter", "https://github.com/liushooter"] --- Solidity lets you program on [Ethereum](https://www.ethereum.org/), a @@ -237,7 +238,7 @@ uint x[][5]; // arr with 5 dynamic array elements (opp order of most languages) // Dictionaries (any type to any other type) mapping (string => uint) public balances; balances["charles"] = 1; -// balances["ada"] is 0, all non-set key values return zeroes +// balances["ada"] result is 0, all non-set key values return zeroes // 'public' allows following from another contract contractName.balances("charles"); // returns 1 // 'public' created a getter (but not setter) like the following: -- cgit v1.2.3