aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenton Liu <liu.denton+github@gmail.com>2016-05-25 22:44:35 +0800
committerDenton Liu <liu.denton+github@gmail.com>2016-05-31 01:18:30 +0800
commita29aaa3776f028d635307d6ef9a889ea3a01427d (patch)
tree8332959fb59af143d34bf69e28d7204517ad7bfb
parente72f819111a71ee53dcabec1bfead34fb0b9d349 (diff)
downloaddexon-solidity-a29aaa3776f028d635307d6ef9a889ea3a01427d.tar
dexon-solidity-a29aaa3776f028d635307d6ef9a889ea3a01427d.tar.gz
dexon-solidity-a29aaa3776f028d635307d6ef9a889ea3a01427d.tar.bz2
dexon-solidity-a29aaa3776f028d635307d6ef9a889ea3a01427d.tar.lz
dexon-solidity-a29aaa3776f028d635307d6ef9a889ea3a01427d.tar.xz
dexon-solidity-a29aaa3776f028d635307d6ef9a889ea3a01427d.tar.zst
dexon-solidity-a29aaa3776f028d635307d6ef9a889ea3a01427d.zip
Added section on address-related constants
-rw-r--r--docs/units-and-global-variables.rst15
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/units-and-global-variables.rst b/docs/units-and-global-variables.rst
index d0a60d28..594807c0 100644
--- a/docs/units-and-global-variables.rst
+++ b/docs/units-and-global-variables.rst
@@ -111,6 +111,21 @@ same as ``sha3(uint16(0x12))``.
It might be that you run into Out-of-Gas for ``sha256``, ``ripemd160`` or ``ecrecover`` on a *private blockchain*. The reason for this is that those are implemented as so-called precompiled contracts and these contracts only really exist after they received the first message (although their contract code is hardcoded). Messages to non-existing contracts are more expensive and thus the execution runs into an Out-of-Gas error. A workaround for this problem is to first send e.g. 1 Wei to each of the contracts before you use them in your actual contracts. This is not an issue on the official or test net.
+.. index:: send, balance
+
+Address Related
+---------------
+
+``<address>.balance`` (``uint256``):
+ balance of the address in Wei
+``<address>.send(uint256) returns (bool)``:
+ send given amount of Wei to address, returns ``false`` on failure
+
+.. warning::
+ Since it is possible for calls to ``send`` to fail, such as
+ if there are insufficient funds, it is good practice to
+ check the return value whenever calling ``send``.
+
.. index:: this, selfdestruct
Contract Related