2021-01-13 14:35:55 +00:00
|
|
|
contract D { constructor() payable {} }
|
|
|
|
contract C {
|
|
|
|
uint public x;
|
|
|
|
constructor() payable {}
|
|
|
|
function f(uint amount) public returns (D) {
|
|
|
|
x++;
|
|
|
|
return (new D){value: amount}();
|
|
|
|
}
|
|
|
|
function stack(uint depth) public payable returns (address) {
|
|
|
|
if (depth > 0)
|
|
|
|
return this.stack(depth - 1);
|
|
|
|
else
|
|
|
|
return address(f(0));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// ====
|
|
|
|
// EVMVersion: >=byzantium
|
2021-02-12 12:45:15 +00:00
|
|
|
// compileViaYul: also
|
2021-01-13 14:35:55 +00:00
|
|
|
// ----
|
|
|
|
// constructor(), 20 wei
|
2022-03-15 16:25:35 +00:00
|
|
|
// gas irOptimized: 212583
|
2022-03-07 18:13:35 +00:00
|
|
|
// gas legacy: 294335
|
|
|
|
// gas legacyOptimized: 174279
|
2021-01-13 14:35:55 +00:00
|
|
|
// f(uint256): 20 -> 1370859564726510389319704988634906228201275401179
|
|
|
|
// x() -> 1
|
|
|
|
// f(uint256): 20 -> FAILURE
|
|
|
|
// x() -> 1
|
|
|
|
// stack(uint256): 1023 -> FAILURE
|
2022-02-16 12:03:39 +00:00
|
|
|
// gas irOptimized: 314884
|
2021-10-27 15:26:44 +00:00
|
|
|
// gas legacy: 483942
|
2021-11-04 17:20:10 +00:00
|
|
|
// gas legacyOptimized: 298807
|
2021-01-13 14:35:55 +00:00
|
|
|
// x() -> 1
|
|
|
|
// stack(uint256): 10 -> 693016686122178122849713379390321835634789309880
|
|
|
|
// x() -> 2
|