2020-01-23 16:39:15 +00:00
|
|
|
contract B
|
|
|
|
{
|
|
|
|
uint x;
|
|
|
|
function getBalance() public view returns (uint) {
|
|
|
|
return address(this).balance * 1000 + x;
|
|
|
|
}
|
2020-06-23 12:14:24 +00:00
|
|
|
constructor(uint _x) payable {
|
2020-01-23 16:39:15 +00:00
|
|
|
x = _x;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
contract A {
|
|
|
|
function f() public payable returns (uint, uint, uint) {
|
|
|
|
B x = new B{salt: "abc", value: 3}(7);
|
2020-11-02 13:10:37 +00:00
|
|
|
B y = new B{value: 3, salt: "abc"}(8);
|
|
|
|
B z = new B{salt: "abc", value: 3}(9);
|
2020-01-23 16:39:15 +00:00
|
|
|
return (x.getBalance(), y.getBalance(), z.getBalance());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// ====
|
|
|
|
// EVMVersion: >=constantinople
|
2021-02-12 12:45:15 +00:00
|
|
|
// compileViaYul: also
|
2020-01-23 16:39:15 +00:00
|
|
|
// ----
|
|
|
|
// f(), 10 ether -> 3007, 3008, 3009
|
2021-03-19 13:25:19 +00:00
|
|
|
// gas irOptimized: 327566
|
2021-02-12 12:45:15 +00:00
|
|
|
// gas legacy: 422027
|
|
|
|
// gas legacyOptimized: 287256
|