Refactor storageSizeUpperBound.

This commit is contained in:
chriseth
2020-07-14 10:45:02 +02:00
parent 289fc7a9d0
commit f28bede34a
9 changed files with 63 additions and 59 deletions
@@ -4,5 +4,5 @@ contract C {
uint[2**255][2] a;
}
// ----
// TypeError 1534: (77-94): Type too large for storage.
// TypeError 7676: (60-97): Contract too large for storage.
// TypeError 1534: (77-94): Type too large for storage.
@@ -5,6 +5,6 @@ contract C {
uint[2**255] b;
}
// ----
// TypeError 7676: (60-114): Contract too large for storage.
// Warning 3408: (77-91): Variable "a" covers a large part of storage and thus makes collisions likely. Either use mappings or dynamic arrays and allow their size to be increased only in small quantities per transaction.
// Warning 3408: (97-111): Variable "b" covers a large part of storage and thus makes collisions likely. Either use mappings or dynamic arrays and allow their size to be increased only in small quantities per transaction.
// TypeError 7676: (60-114): Contract too large for storage.
@@ -0,0 +1,12 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >= 0.0;
contract C {
uint[2**255] a;
}
contract D is C {
uint[2**255] b;
}
// ----
// TypeError 7676: (95-134): Contract too large for storage.
// Warning 3408: (77-91): Variable "a" covers a large part of storage and thus makes collisions likely. Either use mappings or dynamic arrays and allow their size to be increased only in small quantities per transaction.
// Warning 3408: (117-131): Variable "b" covers a large part of storage and thus makes collisions likely. Either use mappings or dynamic arrays and allow their size to be increased only in small quantities per transaction.
@@ -8,5 +8,5 @@ contract C {
S s;
}
// ----
// TypeError 1534: (146-149): Type too large for storage.
// TypeError 7676: (60-152): Contract too large for storage.
// TypeError 1534: (146-149): Type too large for storage.