mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
25 lines
435 B
Solidity
25 lines
435 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
|
|
// compileViaYul: also
|
|
// ----
|
|
// constructor(): 2 ->
|
|
// gas irOptimized: 204072
|
|
// gas legacy: 246202
|
|
// gas legacyOptimized: 195914
|
|
// f() -> 2
|