2019-11-18 13:36:45 +00:00
|
|
|
contract C {
|
|
|
|
uint256[] storageArray;
|
|
|
|
function pushEmpty(uint256 len) public {
|
|
|
|
while(storageArray.length < len)
|
|
|
|
storageArray.push();
|
|
|
|
|
|
|
|
for (uint i = 0; i < len; i++)
|
|
|
|
require(storageArray[i] == 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// ====
|
|
|
|
// EVMVersion: >=petersburg
|
2021-02-12 12:45:15 +00:00
|
|
|
// compileViaYul: also
|
2019-11-18 13:36:45 +00:00
|
|
|
// ----
|
|
|
|
// pushEmpty(uint256): 128
|
2021-09-15 15:01:40 +00:00
|
|
|
// gas irOptimized: 412570
|
2022-03-07 18:13:35 +00:00
|
|
|
// gas legacy: 416903
|
|
|
|
// gas legacyOptimized: 398280
|
2019-11-18 13:36:45 +00:00
|
|
|
// pushEmpty(uint256): 256
|
2021-09-15 15:01:40 +00:00
|
|
|
// gas irOptimized: 702558
|
2022-03-07 18:13:35 +00:00
|
|
|
// gas legacy: 714315
|
|
|
|
// gas legacyOptimized: 687372
|
2021-05-25 11:09:48 +00:00
|
|
|
// pushEmpty(uint256): 38869 -> FAILURE # out-of-gas #
|
|
|
|
// gas irOptimized: 100000000
|
|
|
|
// gas legacy: 100000000
|
|
|
|
// gas legacyOptimized: 100000000
|