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 ->
2023-08-04 10:27:18 +00:00
// gas irOptimized: 193730
// gas legacy: 241606
// gas legacyOptimized: 193193
// f() -> 2