mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Explain safe purchase (even number)
This commit is contained in:
parent
5a5d21d0c8
commit
550d646b97
@ -535,6 +535,9 @@ Safe Remote Purchase
|
|||||||
enum State { Created, Locked, Inactive }
|
enum State { Created, Locked, Inactive }
|
||||||
State public state;
|
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 {
|
function Purchase() payable {
|
||||||
seller = msg.sender;
|
seller = msg.sender;
|
||||||
value = msg.value / 2;
|
value = msg.value / 2;
|
||||||
|
Loading…
Reference in New Issue
Block a user