2020-03-09 21:14:07 +00:00
|
|
|
contract C {
|
|
|
|
function balance() public returns (uint256) {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
function transfer(uint256 amount) public returns (uint256) {
|
|
|
|
return amount;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
contract D {
|
|
|
|
function f() public returns (uint256) {
|
|
|
|
return (new C()).balance();
|
|
|
|
}
|
|
|
|
|
|
|
|
function g() public returns (uint256) {
|
|
|
|
return (new C()).transfer(5);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-04-09 19:59:17 +00:00
|
|
|
// ====
|
|
|
|
// compileViaYul: also
|
2020-03-09 21:14:07 +00:00
|
|
|
// ----
|
|
|
|
// f() -> 1
|
2021-09-15 15:01:40 +00:00
|
|
|
// gas irOptimized: 77164
|
2021-10-27 15:26:44 +00:00
|
|
|
// gas legacy: 114884
|
2020-03-09 21:14:07 +00:00
|
|
|
// g() -> 5
|
2021-09-15 15:01:40 +00:00
|
|
|
// gas irOptimized: 77231
|
2021-10-27 15:26:44 +00:00
|
|
|
// gas legacy: 115430
|