mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Move some tests from viaYul to appropriate groups
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
contract C {
|
||||
function f(uint n) public pure returns (uint) {
|
||||
uint[][] memory a = new uint[][](2);
|
||||
for (uint i = 0; i < 2; ++i)
|
||||
a[i] = new uint[](3);
|
||||
a[1][1] = n;
|
||||
uint[] memory b = a[1];
|
||||
return b[1];
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// f(uint256): 42 -> 42
|
||||
@@ -0,0 +1,10 @@
|
||||
contract C {
|
||||
function f(uint n) public pure returns (uint) {
|
||||
uint[][] memory a = new uint[][](2);
|
||||
for (uint i = 0; i < 2; ++i)
|
||||
a[i] = new uint[](3);
|
||||
return a[0][0] = n;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// f(uint256): 42 -> 42
|
||||
@@ -0,0 +1,17 @@
|
||||
contract C {
|
||||
function f(uint n) public pure returns (uint) {
|
||||
uint[][][] memory a = new uint[][][](2);
|
||||
for (uint i = 0; i < 2; ++i)
|
||||
{
|
||||
a[i] = new uint[][](3);
|
||||
for (uint j = 0; j < 3; ++j)
|
||||
a[i][j] = new uint[](4);
|
||||
}
|
||||
a[1][1][1] = n;
|
||||
uint[][] memory b = a[1];
|
||||
uint[] memory c = b[1];
|
||||
return c[1];
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// f(uint256): 42 -> 42
|
||||
@@ -0,0 +1,14 @@
|
||||
contract C {
|
||||
function f(uint n) public pure returns (uint) {
|
||||
uint[][][] memory a = new uint[][][](2);
|
||||
for (uint i = 0; i < 2; ++i)
|
||||
{
|
||||
a[i] = new uint[][](3);
|
||||
for (uint j = 0; j < 3; ++j)
|
||||
a[i][j] = new uint[](4);
|
||||
}
|
||||
return a[1][1][1] = n;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// f(uint256): 42 -> 42
|
||||
@@ -0,0 +1,27 @@
|
||||
contract C {
|
||||
function f(uint n, uint m) public {
|
||||
function() internal returns (uint)[] memory arr = new function() internal returns (uint)[](n);
|
||||
arr[m]();
|
||||
}
|
||||
function f2(uint n, uint m, uint a, uint b) public {
|
||||
function() internal returns (uint)[][] memory arr = new function() internal returns (uint)[][](n);
|
||||
for (uint i = 0; i < n; ++i)
|
||||
arr[i] = new function() internal returns (uint)[](m);
|
||||
arr[a][b]();
|
||||
}
|
||||
function g(uint n, uint m) public {
|
||||
function() external returns (uint)[] memory arr = new function() external returns (uint)[](n);
|
||||
arr[m]();
|
||||
}
|
||||
function g2(uint n, uint m, uint a, uint b) public {
|
||||
function() external returns (uint)[][] memory arr = new function() external returns (uint)[][](n);
|
||||
for (uint i = 0; i < n; ++i)
|
||||
arr[i] = new function() external returns (uint)[](m);
|
||||
arr[a][b]();
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// f(uint256,uint256): 1823621, 12323 -> FAILURE # Out of gas #
|
||||
// f2(uint256,uint256,uint256,uint256): 18723921, 1823621, 123, 12323 -> FAILURE # Out of gas #
|
||||
// g(uint256,uint256): 1823621, 12323 -> FAILURE # Out of gas #
|
||||
// g2(uint256,uint256,uint256,uint256): 18723921, 1823621, 123, 12323 -> FAILURE # Out of gas #
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
contract C {
|
||||
uint test1;
|
||||
uint test2;
|
||||
uint test3;
|
||||
uint test4;
|
||||
uint test5;
|
||||
uint test6;
|
||||
uint test7;
|
||||
mapping (string => uint) map;
|
||||
function set(string memory s, uint n, uint m, uint a, uint b) public returns (uint) {
|
||||
map[s] = 0;
|
||||
uint[][] memory x = new uint[][](n);
|
||||
for (uint i = 0; i < n; ++i)
|
||||
x[i] = new uint[](m);
|
||||
return x[a][b];
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// set(string,uint256,uint256,uint256,uint256): 0xa0, 2, 4, 0, 0, 32, "01234567890123456789012345678901" -> 0
|
||||
// set(string,uint256,uint256,uint256,uint256): 0xa0, 2, 4, 1, 3, 32, "01234567890123456789012345678901" -> 0
|
||||
// set(string,uint256,uint256,uint256,uint256): 0xa0, 2, 4, 3, 3, 32, "01234567890123456789012345678901" -> FAILURE, hex"4e487b71", 0x32
|
||||
// set(string,uint256,uint256,uint256,uint256): 0xa0, 2, 4, 1, 5, 32, "01234567890123456789012345678901" -> FAILURE, hex"4e487b71", 0x32
|
||||
@@ -0,0 +1,20 @@
|
||||
contract C {
|
||||
uint test1;
|
||||
uint test2;
|
||||
uint test3;
|
||||
uint test4;
|
||||
uint test5;
|
||||
uint test6;
|
||||
uint test7;
|
||||
mapping (string => uint) map;
|
||||
function set(string memory s, uint n, uint m) public returns (uint) {
|
||||
map[s] = 0;
|
||||
uint[4][] memory x = new uint[4][](n);
|
||||
return x[m][0];
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// set(string,uint256,uint256): 0x60, 2, 0, 32, "01234567890123456789012345678901" -> 0
|
||||
// set(string,uint256,uint256): 0x60, 2, 1, 32, "01234567890123456789012345678901" -> 0
|
||||
// set(string,uint256,uint256): 0x60, 2, 2, 32, "01234567890123456789012345678901" -> FAILURE, hex"4e487b71", 0x32
|
||||
// set(string,uint256,uint256): 0x60, 200, 199, 32, "01234567890123456789012345678901" -> 0
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
contract C {
|
||||
uint test1;
|
||||
uint test2;
|
||||
uint test3;
|
||||
uint test4;
|
||||
uint test5;
|
||||
uint test6;
|
||||
uint test7;
|
||||
mapping (string => uint) map;
|
||||
function set(string memory s) public returns (uint[3] memory x, uint[2] memory y, uint[] memory z, uint t) {
|
||||
map[s] = 0;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// set(string): 0x20, 32, "01234567890123456789012345678901" -> 0, 0, 0, 0, 0, 0xe0, 0, 0
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
contract C {
|
||||
uint test1;
|
||||
uint test2;
|
||||
uint test3;
|
||||
uint test4;
|
||||
uint test5;
|
||||
uint test6;
|
||||
uint test7;
|
||||
mapping (string => uint) map;
|
||||
function set(string memory s) public returns (uint) {
|
||||
map[s] = 0;
|
||||
uint[3] memory x;
|
||||
return x[2];
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// set(string): 0x20, 32, "01234567890123456789012345678901" -> 0
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
contract C {
|
||||
uint test1;
|
||||
uint test2;
|
||||
uint test3;
|
||||
uint test4;
|
||||
uint test5;
|
||||
uint test6;
|
||||
uint test7;
|
||||
mapping (string => uint) map;
|
||||
function set(string memory s, uint n, uint a) public returns (uint) {
|
||||
map[s] = 0;
|
||||
uint[] memory x = new uint[](n);
|
||||
return x[a];
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// set(string,uint256,uint256): 0x60, 5, 0, 32, "01234567890123456789012345678901" -> 0
|
||||
// set(string,uint256,uint256): 0x60, 5, 1, 32, "01234567890123456789012345678901" -> 0
|
||||
// set(string,uint256,uint256): 0x60, 5, 4, 32, "01234567890123456789012345678901" -> 0
|
||||
// set(string,uint256,uint256): 0x60, 5, 5, 32, "01234567890123456789012345678901" -> FAILURE, hex"4e487b71", 0x32
|
||||
@@ -0,0 +1,24 @@
|
||||
contract C {
|
||||
function test(uint256 len, uint idx) public returns (uint256)
|
||||
{
|
||||
uint[] memory array = new uint[](len);
|
||||
uint result = receiver(array, idx);
|
||||
|
||||
for (uint256 i = 0; i < array.length; i++)
|
||||
require(array[i] == i + 1);
|
||||
|
||||
return result;
|
||||
}
|
||||
function receiver(uint[] memory array, uint idx) public returns (uint256)
|
||||
{
|
||||
for (uint256 i = 0; i < array.length; i++)
|
||||
array[i] = i + 1;
|
||||
|
||||
return array[idx];
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// test(uint256,uint256): 0, 0 -> FAILURE, hex"4e487b71", 0x32
|
||||
// test(uint256,uint256): 1, 0 -> 1
|
||||
// test(uint256,uint256): 10, 5 -> 6
|
||||
// test(uint256,uint256): 10, 50 -> FAILURE, hex"4e487b71", 0x32
|
||||
@@ -0,0 +1,11 @@
|
||||
contract C {
|
||||
function create(uint256 len) public returns (uint256)
|
||||
{
|
||||
uint[] memory array = new uint[](len);
|
||||
return array.length;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// create(uint256): 0 -> 0
|
||||
// create(uint256): 7 -> 7
|
||||
// create(uint256): 10 -> 10
|
||||
@@ -0,0 +1,36 @@
|
||||
contract C {
|
||||
function index(uint256 len) public returns (bool)
|
||||
{
|
||||
uint[] memory array = new uint[](len);
|
||||
|
||||
for (uint256 i = 0; i < len; i++)
|
||||
array[i] = i + 1;
|
||||
|
||||
for (uint256 i = 0; i < len; i++)
|
||||
require(array[i] == i + 1, "Unexpected value in array!");
|
||||
|
||||
return array.length == len;
|
||||
}
|
||||
function accessIndex(uint256 len, int256 idx) public returns (uint256)
|
||||
{
|
||||
uint[] memory array = new uint[](len);
|
||||
|
||||
for (uint256 i = 0; i < len; i++)
|
||||
array[i] = i + 1;
|
||||
|
||||
return array[uint256(idx)];
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// index(uint256): 0 -> true
|
||||
// index(uint256): 10 -> true
|
||||
// index(uint256): 20 -> true
|
||||
// index(uint256): 0xFF -> true
|
||||
// gas irOptimized: 135584
|
||||
// gas legacy: 244264
|
||||
// gas legacyOptimized: 152128
|
||||
// accessIndex(uint256,int256): 10, 1 -> 2
|
||||
// accessIndex(uint256,int256): 10, 0 -> 1
|
||||
// accessIndex(uint256,int256): 10, 11 -> FAILURE, hex"4e487b71", 0x32
|
||||
// accessIndex(uint256,int256): 10, 10 -> FAILURE, hex"4e487b71", 0x32
|
||||
// accessIndex(uint256,int256): 10, -1 -> FAILURE, hex"4e487b71", 0x32
|
||||
@@ -0,0 +1,23 @@
|
||||
contract C {
|
||||
uint[] storageArray;
|
||||
function test(uint256 v) public {
|
||||
storageArray.push() = v;
|
||||
}
|
||||
function getLength() public view returns (uint256) {
|
||||
return storageArray.length;
|
||||
}
|
||||
function fetch(uint256 a) public view returns (uint256) {
|
||||
return storageArray[a];
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// getLength() -> 0
|
||||
// test(uint256): 42 ->
|
||||
// getLength() -> 1
|
||||
// fetch(uint256): 0 -> 42
|
||||
// fetch(uint256): 1 -> FAILURE, hex"4e487b71", 0x32
|
||||
// test(uint256): 23 ->
|
||||
// getLength() -> 2
|
||||
// fetch(uint256): 0 -> 42
|
||||
// fetch(uint256): 1 -> 23
|
||||
// fetch(uint256): 2 -> FAILURE, hex"4e487b71", 0x32
|
||||
@@ -0,0 +1,23 @@
|
||||
contract C {
|
||||
uint[] storageArray;
|
||||
function test(uint256 v) public {
|
||||
storageArray.push(v);
|
||||
}
|
||||
function getLength() public view returns (uint256) {
|
||||
return storageArray.length;
|
||||
}
|
||||
function fetch(uint256 a) public view returns (uint256) {
|
||||
return storageArray[a];
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// getLength() -> 0
|
||||
// test(uint256): 42 ->
|
||||
// getLength() -> 1
|
||||
// fetch(uint256): 0 -> 42
|
||||
// fetch(uint256): 1 -> FAILURE, hex"4e487b71", 0x32
|
||||
// test(uint256): 23 ->
|
||||
// getLength() -> 2
|
||||
// fetch(uint256): 0 -> 42
|
||||
// fetch(uint256): 1 -> 23
|
||||
// fetch(uint256): 2 -> FAILURE, hex"4e487b71", 0x32
|
||||
@@ -0,0 +1,53 @@
|
||||
contract C {
|
||||
uint[] storageArray;
|
||||
function test_indices(uint256 len) public
|
||||
{
|
||||
while (storageArray.length < len)
|
||||
storageArray.push();
|
||||
while (storageArray.length > len)
|
||||
storageArray.pop();
|
||||
for (uint i = 0; i < len; i++)
|
||||
storageArray[i] = i + 1;
|
||||
|
||||
for (uint i = 0; i < len; i++)
|
||||
require(storageArray[i] == i + 1);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// test_indices(uint256): 1 ->
|
||||
// test_indices(uint256): 129 ->
|
||||
// gas irOptimized: 3020710
|
||||
// gas legacy: 3071683
|
||||
// gas legacyOptimized: 3014415
|
||||
// test_indices(uint256): 5 ->
|
||||
// gas irOptimized: 578008
|
||||
// gas legacy: 575321
|
||||
// gas legacyOptimized: 572912
|
||||
// test_indices(uint256): 10 ->
|
||||
// gas irOptimized: 158347
|
||||
// gas legacy: 162657
|
||||
// gas legacyOptimized: 158422
|
||||
// test_indices(uint256): 15 ->
|
||||
// gas irOptimized: 173377
|
||||
// gas legacy: 179782
|
||||
// gas legacyOptimized: 173727
|
||||
// test_indices(uint256): 0xFF ->
|
||||
// gas irOptimized: 5680122
|
||||
// gas legacy: 5780977
|
||||
// gas legacyOptimized: 5668997
|
||||
// test_indices(uint256): 1000 ->
|
||||
// gas irOptimized: 18202919
|
||||
// gas legacy: 18602799
|
||||
// gas legacyOptimized: 18179744
|
||||
// test_indices(uint256): 129 ->
|
||||
// gas irOptimized: 4158223
|
||||
// gas legacy: 4169611
|
||||
// gas legacyOptimized: 4126312
|
||||
// test_indices(uint256): 128 ->
|
||||
// gas irOptimized: 411932
|
||||
// gas legacy: 465768
|
||||
// gas legacyOptimized: 418968
|
||||
// test_indices(uint256): 1 ->
|
||||
// gas irOptimized: 581570
|
||||
// gas legacy: 577432
|
||||
// gas legacyOptimized: 576168
|
||||
@@ -0,0 +1,27 @@
|
||||
contract C {
|
||||
uint[] storageArray;
|
||||
function test_boundary_check(uint256 len, uint256 access) public returns (uint256)
|
||||
{
|
||||
while(storageArray.length < len)
|
||||
storageArray.push();
|
||||
while(storageArray.length > len)
|
||||
storageArray.pop();
|
||||
return storageArray[access];
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// test_boundary_check(uint256,uint256): 10, 11 -> FAILURE, hex"4e487b71", 0x32
|
||||
// test_boundary_check(uint256,uint256): 10, 9 -> 0
|
||||
// test_boundary_check(uint256,uint256): 1, 9 -> FAILURE, hex"4e487b71", 0x32
|
||||
// test_boundary_check(uint256,uint256): 1, 1 -> FAILURE, hex"4e487b71", 0x32
|
||||
// test_boundary_check(uint256,uint256): 10, 10 -> FAILURE, hex"4e487b71", 0x32
|
||||
// test_boundary_check(uint256,uint256): 256, 256 -> FAILURE, hex"4e487b71", 0x32
|
||||
// gas irOptimized: 140631
|
||||
// gas legacy: 134630
|
||||
// gas legacyOptimized: 114854
|
||||
// test_boundary_check(uint256,uint256): 256, 255 -> 0
|
||||
// gas irOptimized: 142763
|
||||
// gas legacy: 136949
|
||||
// gas legacyOptimized: 117033
|
||||
// test_boundary_check(uint256,uint256): 256, 0xFFFF -> FAILURE, hex"4e487b71", 0x32
|
||||
// test_boundary_check(uint256,uint256): 256, 2 -> 0
|
||||
@@ -0,0 +1,69 @@
|
||||
contract C {
|
||||
uint[] storageArray;
|
||||
function test_zeroed_indicies(uint256 len) public
|
||||
{
|
||||
while(storageArray.length < len)
|
||||
storageArray.push();
|
||||
while(storageArray.length > len)
|
||||
storageArray.pop();
|
||||
|
||||
for (uint i = 0; i < len; i++)
|
||||
storageArray[i] = i + 1;
|
||||
|
||||
if (len > 3)
|
||||
{
|
||||
while(storageArray.length > 0)
|
||||
storageArray.pop();
|
||||
while(storageArray.length < 3)
|
||||
storageArray.push();
|
||||
|
||||
for (uint i = 3; i < len; i++)
|
||||
{
|
||||
assembly {
|
||||
mstore(0, storageArray.slot)
|
||||
let pos := add(keccak256(0, 0x20), i)
|
||||
|
||||
if iszero(eq(sload(pos), 0)) {
|
||||
revert(0, 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
while(storageArray.length > 0)
|
||||
storageArray.pop();
|
||||
while(storageArray.length < len)
|
||||
storageArray.push();
|
||||
|
||||
for (uint i = 0; i < len; i++)
|
||||
{
|
||||
require(storageArray[i] == 0);
|
||||
|
||||
uint256 val = storageArray[i];
|
||||
uint256 check;
|
||||
|
||||
assembly { check := iszero(val) }
|
||||
|
||||
require(check == 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// test_zeroed_indicies(uint256): 1 ->
|
||||
// test_zeroed_indicies(uint256): 5 ->
|
||||
// gas irOptimized: 132036
|
||||
// gas legacy: 132961
|
||||
// gas legacyOptimized: 130752
|
||||
// test_zeroed_indicies(uint256): 10 ->
|
||||
// gas irOptimized: 226094
|
||||
// gas legacy: 228071
|
||||
// gas legacyOptimized: 224010
|
||||
// test_zeroed_indicies(uint256): 15 ->
|
||||
// gas irOptimized: 324266
|
||||
// gas legacy: 327311
|
||||
// gas legacyOptimized: 321462
|
||||
// test_zeroed_indicies(uint256): 0xFF ->
|
||||
// gas irOptimized: 5122626
|
||||
// gas legacy: 5172987
|
||||
// gas legacyOptimized: 5066462
|
||||
@@ -0,0 +1,22 @@
|
||||
contract C {
|
||||
uint[] storageArray;
|
||||
function set_get_length(uint256 len) public returns (uint256) {
|
||||
while(storageArray.length < len)
|
||||
storageArray.push();
|
||||
return storageArray.length;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// set_get_length(uint256): 0 -> 0
|
||||
// set_get_length(uint256): 1 -> 1
|
||||
// set_get_length(uint256): 10 -> 10
|
||||
// set_get_length(uint256): 20 -> 20
|
||||
// set_get_length(uint256): 0xFF -> 0xFF
|
||||
// gas irOptimized: 96690
|
||||
// gas legacy: 129522
|
||||
// gas legacyOptimized: 110618
|
||||
// set_get_length(uint256): 0xFFF -> 0xFFF
|
||||
// gas irOptimized: 1220648
|
||||
// gas legacy: 1704919
|
||||
// gas legacyOptimized: 1401220
|
||||
// set_get_length(uint256): 0xFFFFF -> FAILURE # Out-of-gas #
|
||||
@@ -0,0 +1,10 @@
|
||||
contract C {
|
||||
uint[] storageArray;
|
||||
function popEmpty() public {
|
||||
storageArray.pop();
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// EVMVersion: >=petersburg
|
||||
// ----
|
||||
// popEmpty() -> FAILURE, hex"4e487b71", 0x31
|
||||
@@ -0,0 +1,25 @@
|
||||
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
|
||||
// ----
|
||||
// pushEmpty(uint256): 128
|
||||
// gas irOptimized: 406798
|
||||
// gas legacy: 416903
|
||||
// gas legacyOptimized: 398280
|
||||
// pushEmpty(uint256): 256
|
||||
// gas irOptimized: 693826
|
||||
// gas legacy: 717115
|
||||
// gas legacyOptimized: 690172
|
||||
// pushEmpty(uint256): 38869 -> FAILURE # out-of-gas #
|
||||
// gas irOptimized: 100000000
|
||||
// gas legacy: 100000000
|
||||
// gas legacyOptimized: 100000000
|
||||
@@ -0,0 +1,33 @@
|
||||
contract C {
|
||||
address[] addressArray;
|
||||
function set_get_length(uint256 len) public returns (uint256)
|
||||
{
|
||||
while(addressArray.length < len)
|
||||
addressArray.push();
|
||||
while(addressArray.length > len)
|
||||
addressArray.pop();
|
||||
return addressArray.length;
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// EVMVersion: >=petersburg
|
||||
// ----
|
||||
// set_get_length(uint256): 0 -> 0
|
||||
// set_get_length(uint256): 1 -> 1
|
||||
// set_get_length(uint256): 10 -> 10
|
||||
// set_get_length(uint256): 20 -> 20
|
||||
// set_get_length(uint256): 0 -> 0
|
||||
// gas irOptimized: 77628
|
||||
// gas legacy: 77730
|
||||
// gas legacyOptimized: 77162
|
||||
// set_get_length(uint256): 0xFF -> 0xFF
|
||||
// gas irOptimized: 161696
|
||||
// gas legacy: 698137
|
||||
// gas legacyOptimized: 135004
|
||||
// set_get_length(uint256): 0xFFF -> 0xFFF
|
||||
// gas irOptimized: 1804463
|
||||
// gas legacy: 9876574
|
||||
// gas legacyOptimized: 1401346
|
||||
// set_get_length(uint256): 0xFFFFF -> FAILURE # Out-of-gas #
|
||||
// gas irOptimized: 100000000
|
||||
// gas legacyOptimized: 100000000
|
||||
@@ -0,0 +1,27 @@
|
||||
contract C {
|
||||
uint[] storageArray;
|
||||
function set_get_length(uint256 len) public returns (uint256) {
|
||||
while(storageArray.length < len)
|
||||
storageArray.push();
|
||||
while(storageArray.length > 0)
|
||||
storageArray.pop();
|
||||
return storageArray.length;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// set_get_length(uint256): 0 -> 0
|
||||
// set_get_length(uint256): 1 -> 0
|
||||
// set_get_length(uint256): 10 -> 0
|
||||
// set_get_length(uint256): 20 -> 0
|
||||
// gas irOptimized: 106222
|
||||
// gas legacy: 105722
|
||||
// gas legacyOptimized: 103508
|
||||
// set_get_length(uint256): 0xFF -> 0
|
||||
// gas irOptimized: 821872
|
||||
// gas legacy: 810327
|
||||
// gas legacyOptimized: 786258
|
||||
// set_get_length(uint256): 0xFFF -> 0
|
||||
// gas irOptimized: 12841084
|
||||
// gas legacy: 12649059
|
||||
// gas legacyOptimized: 12267870
|
||||
// set_get_length(uint256): 0xFFFF -> FAILURE # Out-of-gas #
|
||||
Reference in New Issue
Block a user