diff options
author | Denton Liu <liu.denton+github@gmail.com> | 2016-07-11 22:28:20 +0800 |
---|---|---|
committer | Denton Liu <liu.denton+github@gmail.com> | 2016-08-10 22:40:55 +0800 |
commit | 617daa1f004dba9960c0de57109d5b1554a9f599 (patch) | |
tree | 453456c39073ff85da2313c5139296ab872ff7cd /docs/common-patterns.rst | |
parent | 82365f21c0421bd20d60a1e544dd798ce4315b2f (diff) | |
download | dexon-solidity-617daa1f004dba9960c0de57109d5b1554a9f599.tar.gz dexon-solidity-617daa1f004dba9960c0de57109d5b1554a9f599.tar.zst dexon-solidity-617daa1f004dba9960c0de57109d5b1554a9f599.zip |
Fix withdrawal pattern documentation
Diffstat (limited to 'docs/common-patterns.rst')
-rw-r--r-- | docs/common-patterns.rst | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/common-patterns.rst b/docs/common-patterns.rst index 0de692fc..e725e786 100644 --- a/docs/common-patterns.rst +++ b/docs/common-patterns.rst @@ -11,8 +11,8 @@ Withdrawal from Contracts ************************* The recommended method of sending funds after an effect -is with the withdrawal pattern. Although the most intuitive -aethod of sending Ether as a result of an effect is a +is using the withdrawal pattern. Although the most intuitive +method of sending Ether, as a result of an effect, is a direct ``send`` call, this is not recommended as it introduces a potential security risk. You may read more about this on the :ref:`security_considerations` page. @@ -28,7 +28,7 @@ an Ether storage contract. mapping (address => uint) pendingReturns; function sendEther(uint amount) { - if (amount < etherStore[msg.sender]) { + if (amount > etherStore[msg.sender]) { throw; } etherStore[msg.sender] -= amount; @@ -60,7 +60,7 @@ This is as opposed to the more intuitive sending pattern. mapping (address => uint) etherStore; function sendEther(uint amount) { - if (amount < etherStore[msg.sender]) { + if (amount > etherStore[msg.sender]) { throw; } etherStore[msg.sender] -= amount; |