aboutsummaryrefslogtreecommitdiffstats
path: root/docs/frequently-asked-questions.rst
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2016-10-18 01:14:21 +0800
committerLefteris Karapetsas <lefteris@refu.co>2016-10-18 01:14:21 +0800
commit806d94c214e295bb57d4eb30c256787e28bf21df (patch)
tree367f1155df2f3cb6e7566fea7d6ed99bba4952be /docs/frequently-asked-questions.rst
parent07d32937fd1aa0860611ce1307f08439317de449 (diff)
downloaddexon-solidity-806d94c214e295bb57d4eb30c256787e28bf21df.tar.gz
dexon-solidity-806d94c214e295bb57d4eb30c256787e28bf21df.tar.zst
dexon-solidity-806d94c214e295bb57d4eb30c256787e28bf21df.zip
Docs: Change contract init with value section
After solidity 0.4.0 we need to make the constructor `payable` if we are to provide value during contract creation.
Diffstat (limited to 'docs/frequently-asked-questions.rst')
-rw-r--r--docs/frequently-asked-questions.rst6
1 files changed, 4 insertions, 2 deletions
diff --git a/docs/frequently-asked-questions.rst b/docs/frequently-asked-questions.rst
index acc0c106..a4315a14 100644
--- a/docs/frequently-asked-questions.rst
+++ b/docs/frequently-asked-questions.rst
@@ -709,10 +709,12 @@ How do I initialize a contract with only a specific amount of wei?
Currently the approach is a little ugly, but there is little that can be done to improve it.
In the case of a ``contract A`` calling a new instance of ``contract B``, parentheses have to be used around
``new B`` because ``B.value`` would refer to a member of ``B`` called ``value``.
-You will need to make sure that you have both contracts aware of each other's presence.
+You will need to make sure that you have both contracts aware of each other's presence and that ``contract B`` has a ``payable`` constructor.
In this example::
- contract B {}
+ contract B {
+ function B() payable {}
+ }
contract A {