solidity/test/libsolidity/semanticTests/functionCall/creation_function_call_with_salt.sol

24 lines
412 B
Solidity
Raw Normal View History

contract C {
uint public i;
2020-06-23 12:14:24 +00:00
constructor(uint newI) {
i = newI;
}
}
contract D {
C c;
2020-06-23 12:14:24 +00:00
constructor(uint v) {
c = new C{salt: "abc"}(v);
}
function f() public returns (uint r) {
return c.i();
}
}
// ====
// EVMVersion: >=constantinople
// ----
// constructor(): 2 ->
2022-03-15 16:25:35 +00:00
// gas irOptimized: 200380
2021-11-15 15:19:33 +00:00
// gas legacy: 246202
// gas legacyOptimized: 195914
// f() -> 2