solidity/test/libsolidity/semanticTests/salted_create/salted_create_with_value.sol
Nikola Matic fdc6699159 Rematerialize zero literals with default cleanup sequence
Add unused pruner step to the end of the default cleanup sequence
2023-09-04 15:40:33 +02:00

27 lines
648 B
Solidity

contract B
{
uint x;
function getBalance() public view returns (uint) {
return address(this).balance * 1000 + x;
}
constructor(uint _x) payable {
x = _x;
}
}
contract A {
function f() public payable returns (uint, uint, uint) {
B x = new B{salt: "abc", value: 3}(7);
B y = new B{value: 3, salt: "abc"}(8);
B z = new B{salt: "abc", value: 3}(9);
return (x.getBalance(), y.getBalance(), z.getBalance());
}
}
// ====
// EVMVersion: >=constantinople
// ----
// f(), 10 ether -> 3007, 3008, 3009
// gas irOptimized: 253005
// gas legacy: 381063
// gas legacyOptimized: 279694