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-04-22 14:07:57 +00:00
|
|
|
// gas irOptimized: 630896
|
2021-02-12 12:45:15 +00:00
|
|
|
// gas legacy: 607287
|
|
|
|
// gas legacyOptimized: 589048
|
2019-11-18 13:36:45 +00:00
|
|
|
// pushEmpty(uint256): 256
|
2021-04-22 14:07:57 +00:00
|
|
|
// gas irOptimized: 861040
|
2021-02-12 12:45:15 +00:00
|
|
|
// gas legacy: 828983
|
|
|
|
// gas legacyOptimized: 802808
|
|
|
|
// pushEmpty(uint256): 32768 -> FAILURE # out-of-gas #
|