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-05-18 13:39:08 +00:00
|
|
|
// gas legacy: 115012
|
2020-03-09 21:14:07 +00:00
|
|
|
// g() -> 5
|
2021-09-15 15:01:40 +00:00
|
|
|
// gas irOptimized: 77231
|
2021-08-05 11:23:50 +00:00
|
|
|
// gas legacy: 115558
|