From 550d646b9727603f39aeaa432d718cd2bb51cf85 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Mon, 28 Aug 2017 12:14:41 +0100 Subject: Explain safe purchase (even number) --- docs/solidity-by-example.rst | 3 +++ 1 file changed, 3 insertions(+) (limited to 'docs/solidity-by-example.rst') 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; -- cgit