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-03-19 13:25:19 +00:00
|
|
|
// gas irOptimized: 98658
|
2021-02-12 12:45:15 +00:00
|
|
|
// gas legacy: 114412
|
2020-03-09 21:14:07 +00:00
|
|
|
// g() -> 5
|
2021-03-19 13:25:19 +00:00
|
|
|
// gas irOptimized: 98760
|
2021-02-12 12:45:15 +00:00
|
|
|
// gas legacy: 114872
|