Merge pull request #2870 from aarongoa/develop

Add payable constructor for `C` - #2869
This commit is contained in:
chriseth 2017-09-12 11:32:46 +02:00 committed by GitHub
commit fabf4accd3

View File

@ -237,16 +237,17 @@ creation-dependencies are not possible.
D newD = new D(arg);
}
function createAndEndowD(uint arg, uint amount) {
function createAndEndowD(uint arg, uint amount) payable {
// Send ether along with the creation
D newD = (new D).value(amount)(arg);
}
}
As seen in the example, it is possible to forward Ether to the creation using the ``.value()`` option,
but it is not possible to limit the amount of gas. If the creation fails
(due to out-of-stack, not enough balance or other problems), an exception
is thrown.
As seen in the example, it is possible to forward Ether while creating
an instance of ``D`` using the ``.value()`` option, but it is not possible
to limit the amount of gas.
If the creation fails (due to out-of-stack, not enough balance or other problems),
an exception is thrown.
Order of Evaluation of Expressions
==================================