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-05-18 13:39:08 +00:00
|
|
|
// gas irOptimized: 85304
|
|
|
|
// gas legacy: 115012
|
2020-03-09 21:14:07 +00:00
|
|
|
// g() -> 5
|
2021-05-18 13:39:08 +00:00
|
|
|
// gas irOptimized: 85400
|
|
|
|
// gas legacy: 115472
|