aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorDenton Liu <liu.denton+github@gmail.com>2016-08-12 02:34:36 +0800
committerDenton Liu <liu.denton+github@gmail.com>2016-08-12 02:34:36 +0800
commit0f1fb33d58e55444474b75ed10e88bcd27567e6b (patch)
tree5b5be0c04f040c739cbcb016939f7414370ab3c5 /docs
parent058e5f0159dcad3e7349b2ab9873396fcc5894e5 (diff)
downloaddexon-solidity-0f1fb33d58e55444474b75ed10e88bcd27567e6b.tar.gz
dexon-solidity-0f1fb33d58e55444474b75ed10e88bcd27567e6b.tar.zst
dexon-solidity-0f1fb33d58e55444474b75ed10e88bcd27567e6b.zip
Add minor corrections
Diffstat (limited to 'docs')
-rw-r--r--docs/common-patterns.rst19
1 files changed, 10 insertions, 9 deletions
diff --git a/docs/common-patterns.rst b/docs/common-patterns.rst
index eb4e14f0..51fb4e6e 100644
--- a/docs/common-patterns.rst
+++ b/docs/common-patterns.rst
@@ -23,7 +23,7 @@ contract in order to become the "richest".
In the following contract, if you are usurped as the richest,
you will recieve the funds of the person who has gone on to
-become the richest.
+become the new richest.
::
@@ -32,7 +32,7 @@ become the richest.
uint public mostSent;
mapping (address => uint) pending;
-
+
function WithdrawalContract() {
richest = msg.sender;
mostSent = msg.value;
@@ -68,7 +68,7 @@ This is as opposed to the more intuitive sending pattern.
contract SendContract {
address public richest;
uint public mostSent;
-
+
function SendContract() {
richest = msg.sender;
mostSent = msg.value;
@@ -93,12 +93,13 @@ This is as opposed to the more intuitive sending pattern.
}
Notice that, in this example, an attacker could trap the
-contract into an unusable state by causing the ``richest``
-to be a contract that has a fallback function which consumes
-more than the 2300 gas stipend. That way, whenever ``send``
-is called to deliver funds to the "poisoned" contract, it
-will cause execution to always fail because there is not
-enough gas to finish the execution of the fallback function.
+contract into an unusable state by causing ``richest`` to be
+the address of a contract that has a fallback function
+which consumes more than the 2300 gas stipend. That way,
+whenever ``send`` is called to deliver funds to the
+"poisoned" contract, it will cause execution to always fail
+because there will not be enough gas to finish the execution
+of the fallback function.
.. index:: access;restricting