You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the approach is a little ugly, but there is little that can be done to improve it.
208
-
In the case of a ``contract A`` calling a new instance of ``contract B``, parentheses have to be used around
209
-
``new B`` because ``B.value`` would refer to a member of ``B`` called ``value``.
210
-
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.
211
-
In this example::
212
-
213
-
pragma solidity ^0.4.0;
214
-
215
-
contract B {
216
-
function B() public payable {}
217
-
}
218
-
219
-
contract A {
220
-
address child;
221
-
222
-
function test() public {
223
-
child = (new B).value(10)(); //construct a new B with 10 wei
224
-
}
225
-
}
226
-
227
-
.. TODO: Does this mean it does work for internal?
228
-
229
-
230
203
What is the relationship between ``bytes32`` and ``string``? Why is it that ``bytes32 somevar = "stringliteral";`` works and what does the saved 32-byte hex value mean?
0 commit comments