aboutsummaryrefslogtreecommitdiffstats
path: root/docs/solidity-by-example.rst
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-08-28 19:47:44 +0800
committerGitHub <noreply@github.com>2017-08-28 19:47:44 +0800
commitb3c251c1548e8f85a76cf1aef8bb698daa5e5ec7 (patch)
tree8b9cc141b147222f455cfd2d346fd3152a4c9cc5 /docs/solidity-by-example.rst
parent5bd6254449ec08d93973ef9b070d56e3a745c8ea (diff)
parent550d646b9727603f39aeaa432d718cd2bb51cf85 (diff)
downloaddexon-solidity-b3c251c1548e8f85a76cf1aef8bb698daa5e5ec7.tar.gz
dexon-solidity-b3c251c1548e8f85a76cf1aef8bb698daa5e5ec7.tar.zst
dexon-solidity-b3c251c1548e8f85a76cf1aef8bb698daa5e5ec7.zip
Merge pull request #2831 from ethereum/docs
Various doc updates
Diffstat (limited to 'docs/solidity-by-example.rst')
-rw-r--r--docs/solidity-by-example.rst3
1 files changed, 3 insertions, 0 deletions
diff --git a/docs/solidity-by-example.rst b/docs/solidity-by-example.rst
index ca6b970c..139c8a42 100644
--- a/docs/solidity-by-example.rst
+++ b/docs/solidity-by-example.rst
@@ -535,6 +535,9 @@ Safe Remote Purchase
enum State { Created, Locked, Inactive }
State public state;
+ // Ensure that `msg.value` is an even number.
+ // Division will truncate if it is an odd number.
+ // Check via multiplication that it wasn't an odd number.
function Purchase() payable {
seller = msg.sender;
value = msg.value / 2;