Skip to content

Commit b0104f3

Browse files
committed
fixup! Warn when layout base is near the end of storage
1 parent 9c7ceb6 commit b0104f3

6 files changed

+7
-0
lines changed

test/libsolidity/syntaxTests/largeTypes/max_size_array_with_transient_state_variables.sol

+1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ contract C {
55
// ====
66
// EVMVersion: >=cancun
77
// ----
8+
// Warning 3495: (0-60): This contract is very close to the end of storage. This limits its future upgradability.
89
// Warning 7325: (17-33): Type uint256[115792089237316195423570985008687907853269984665640564039457584007913129639935] 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.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
contract C layout at 2**256 - 1 {
22
}
33
// ----
4+
// Warning 3495: (11-31): This contract is very close to the end of storage. This limits its future upgradability.

test/libsolidity/syntaxTests/storageLayoutSpecifier/contract_at_storage_end_with_transient_state_variables.sol

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ contract C layout at 2**256 - 1 {
66
// ====
77
// EVMVersion: >=cancun
88
// ----
9+
// Warning 3495: (11-31): This contract is very close to the end of storage. This limits its future upgradability.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
contract A layout at (2**256 + 1) * 2 - 2**256 - 3 {}
22
contract B layout at (2**2 - 2**3) * (2**5 - 2**8) {}
33
// ----
4+
// Warning 3495: (11-51): This contract is very close to the end of storage. This limits its future upgradability.
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
contract C layout at 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF {}
22
// ----
3+
// Warning 3495: (11-87): This contract is very close to the end of storage. This limits its future upgradability.

test/libsolidity/syntaxTests/storageLayoutSpecifier/warning_near_the_storage_end.sol

+2
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ contract C layout at 2**256 - 2**65 {
44
uint[2**63] y;
55
}
66
// ----
7+
// Warning 3495: (11-35): This contract is very close to the end of storage. This limits its future upgradability.
8+
// Warning 3495: (50-74): This contract is very close to the end of storage. This limits its future upgradability.

0 commit comments

Comments
 (0)