solidity/test/libsolidity/semanticTests/functionCall/creation_function_call_with_salt.sol
2022-05-19 20:23:28 +02:00

24 lines
412 B
Solidity

contract C {
uint public i;
constructor(uint newI) {
i = newI;
}
}
contract D {
C c;
constructor(uint v) {
c = new C{salt: "abc"}(v);
}
function f() public returns (uint r) {
return c.i();
}
}
// ====
// EVMVersion: >=constantinople
// ----
// constructor(): 2 ->
// gas irOptimized: 200380
// gas legacy: 246202
// gas legacyOptimized: 195914
// f() -> 2