-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
33ce5d3
commit d36f847
Showing
10 changed files
with
359 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
test/cmdlineTests/storage_layout_specified_location/in.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity >=0.8.27; | ||
|
||
contract A layout at 42 { | ||
uint x; | ||
uint y; | ||
int8 z; | ||
bool b; | ||
address addr; | ||
uint[2] array; | ||
} |
16 changes: 16 additions & 0 deletions
16
test/cmdlineTests/storage_layout_specified_location/input.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"language": "Solidity", | ||
"sources": { | ||
"fileA": { | ||
"urls": ["storage_layout_specified_location/in.sol"] | ||
} | ||
}, | ||
"settings": { | ||
"outputSelection": { | ||
"fileA": { | ||
"A": [ "storageLayout" ], | ||
"": [ "storageLayout" ] | ||
} | ||
} | ||
} | ||
} |
93 changes: 93 additions & 0 deletions
93
test/cmdlineTests/storage_layout_specified_location/output.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
{ | ||
"contracts": { | ||
"fileA": { | ||
"A": { | ||
"storageLayout": { | ||
"storage": [ | ||
{ | ||
"astId": 4, | ||
"contract": "fileA:A", | ||
"label": "x", | ||
"offset": 0, | ||
"slot": "42", | ||
"type": "t_uint256" | ||
}, | ||
{ | ||
"astId": 6, | ||
"contract": "fileA:A", | ||
"label": "y", | ||
"offset": 0, | ||
"slot": "43", | ||
"type": "t_uint256" | ||
}, | ||
{ | ||
"astId": 8, | ||
"contract": "fileA:A", | ||
"label": "z", | ||
"offset": 0, | ||
"slot": "44", | ||
"type": "t_int8" | ||
}, | ||
{ | ||
"astId": 10, | ||
"contract": "fileA:A", | ||
"label": "b", | ||
"offset": 1, | ||
"slot": "44", | ||
"type": "t_bool" | ||
}, | ||
{ | ||
"astId": 12, | ||
"contract": "fileA:A", | ||
"label": "addr", | ||
"offset": 2, | ||
"slot": "44", | ||
"type": "t_address" | ||
}, | ||
{ | ||
"astId": 16, | ||
"contract": "fileA:A", | ||
"label": "array", | ||
"offset": 0, | ||
"slot": "45", | ||
"type": "t_array(t_uint256)2_storage" | ||
} | ||
], | ||
"types": { | ||
"t_address": { | ||
"encoding": "inplace", | ||
"label": "address", | ||
"numberOfBytes": "20" | ||
}, | ||
"t_array(t_uint256)2_storage": { | ||
"base": "t_uint256", | ||
"encoding": "inplace", | ||
"label": "uint256[2]", | ||
"numberOfBytes": "64" | ||
}, | ||
"t_bool": { | ||
"encoding": "inplace", | ||
"label": "bool", | ||
"numberOfBytes": "1" | ||
}, | ||
"t_int8": { | ||
"encoding": "inplace", | ||
"label": "int8", | ||
"numberOfBytes": "1" | ||
}, | ||
"t_uint256": { | ||
"encoding": "inplace", | ||
"label": "uint256", | ||
"numberOfBytes": "32" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"sources": { | ||
"fileA": { | ||
"id": 0 | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
test/cmdlineTests/storage_layout_specified_location_inheritance/in.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity >=0.8.27; | ||
|
||
contract A { | ||
uint x; | ||
uint y; | ||
int8 z; | ||
} | ||
|
||
contract C layout at 42 { | ||
bool b; | ||
address addr; | ||
uint[2] array; | ||
} |
16 changes: 16 additions & 0 deletions
16
test/cmdlineTests/storage_layout_specified_location_inheritance/input.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"language": "Solidity", | ||
"sources": { | ||
"fileA": { | ||
"urls": ["storage_layout_specified_location_inheritance/in.sol"] | ||
} | ||
}, | ||
"settings": { | ||
"outputSelection": { | ||
"fileA": { | ||
"A": [ "storageLayout" ], | ||
"": [ "storageLayout" ] | ||
} | ||
} | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
test/cmdlineTests/storage_layout_specified_location_inheritance/output.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"contracts": { | ||
"fileA": { | ||
"A": { | ||
"storageLayout": { | ||
"storage": [ | ||
{ | ||
"astId": 3, | ||
"contract": "fileA:A", | ||
"label": "x", | ||
"offset": 0, | ||
"slot": "0", | ||
"type": "t_uint256" | ||
}, | ||
{ | ||
"astId": 5, | ||
"contract": "fileA:A", | ||
"label": "y", | ||
"offset": 0, | ||
"slot": "1", | ||
"type": "t_uint256" | ||
}, | ||
{ | ||
"astId": 7, | ||
"contract": "fileA:A", | ||
"label": "z", | ||
"offset": 0, | ||
"slot": "2", | ||
"type": "t_int8" | ||
} | ||
], | ||
"types": { | ||
"t_int8": { | ||
"encoding": "inplace", | ||
"label": "int8", | ||
"numberOfBytes": "1" | ||
}, | ||
"t_uint256": { | ||
"encoding": "inplace", | ||
"label": "uint256", | ||
"numberOfBytes": "32" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"sources": { | ||
"fileA": { | ||
"id": 0 | ||
} | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
test/cmdlineTests/storage_layout_specified_location_two_contracts/contractA.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
contract A { | ||
uint32 x; | ||
int y; | ||
bool b; | ||
address a; | ||
} |
7 changes: 7 additions & 0 deletions
7
test/cmdlineTests/storage_layout_specified_location_two_contracts/contractB.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
contract B { | ||
bool b; | ||
address a; | ||
uint x; | ||
int32 y; | ||
int64 z; | ||
} |
19 changes: 19 additions & 0 deletions
19
test/cmdlineTests/storage_layout_specified_location_two_contracts/input.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"language": "Solidity", | ||
"sources": { | ||
"fileA": { | ||
"urls": ["storage_layout_specified_location_two_contracts/contractA.sol"] | ||
}, | ||
"fileB": { | ||
"urls": ["storage_layout_specified_location_two_contracts/contractB.sol"] | ||
} | ||
}, | ||
"settings": { | ||
"outputSelection": { | ||
"fileA": { | ||
"A": [ "storageLayout" ], | ||
"": [ "storageLayout" ] | ||
} | ||
} | ||
} | ||
} |
124 changes: 124 additions & 0 deletions
124
test/cmdlineTests/storage_layout_specified_location_two_contracts/output.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
{ | ||
"contracts": { | ||
"fileA": { | ||
"A": { | ||
"storageLayout": { | ||
"storage": [ | ||
{ | ||
"astId": 2, | ||
"contract": "fileA:A", | ||
"label": "x", | ||
"offset": 0, | ||
"slot": "0", | ||
"type": "t_uint32" | ||
}, | ||
{ | ||
"astId": 4, | ||
"contract": "fileA:A", | ||
"label": "y", | ||
"offset": 0, | ||
"slot": "1", | ||
"type": "t_int256" | ||
}, | ||
{ | ||
"astId": 6, | ||
"contract": "fileA:A", | ||
"label": "b", | ||
"offset": 0, | ||
"slot": "2", | ||
"type": "t_bool" | ||
}, | ||
{ | ||
"astId": 8, | ||
"contract": "fileA:A", | ||
"label": "a", | ||
"offset": 1, | ||
"slot": "2", | ||
"type": "t_address" | ||
} | ||
], | ||
"types": { | ||
"t_address": { | ||
"encoding": "inplace", | ||
"label": "address", | ||
"numberOfBytes": "20" | ||
}, | ||
"t_bool": { | ||
"encoding": "inplace", | ||
"label": "bool", | ||
"numberOfBytes": "1" | ||
}, | ||
"t_int256": { | ||
"encoding": "inplace", | ||
"label": "int256", | ||
"numberOfBytes": "32" | ||
}, | ||
"t_uint32": { | ||
"encoding": "inplace", | ||
"label": "uint32", | ||
"numberOfBytes": "4" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"errors": [ | ||
{ | ||
"component": "general", | ||
"errorCode": "1878", | ||
"formattedMessage": "Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: <SPDX-License>\" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information. | ||
--> fileA | ||
|
||
", | ||
"message": "SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: <SPDX-License>\" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information.", | ||
"severity": "warning", | ||
"sourceLocation": { | ||
"end": -1, | ||
"file": "fileA", | ||
"start": -1 | ||
}, | ||
"type": "Warning" | ||
}, | ||
{ | ||
"component": "general", | ||
"errorCode": "1878", | ||
"formattedMessage": "Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: <SPDX-License>\" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information. | ||
--> fileB | ||
|
||
", | ||
"message": "SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: <SPDX-License>\" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information.", | ||
"severity": "warning", | ||
"sourceLocation": { | ||
"end": -1, | ||
"file": "fileB", | ||
"start": -1 | ||
}, | ||
"type": "Warning" | ||
}, | ||
{ | ||
"component": "general", | ||
"errorCode": "3420", | ||
"formattedMessage": "Warning: Source file does not specify required compiler version! | ||
--> fileA | ||
|
||
", | ||
"message": "Source file does not specify required compiler version!", | ||
"severity": "warning", | ||
"sourceLocation": { | ||
"end": -1, | ||
"file": "fileA", | ||
"start": -1 | ||
}, | ||
"type": "Warning" | ||
} | ||
], | ||
"sources": { | ||
"fileA": { | ||
"id": 0 | ||
}, | ||
"fileB": { | ||
"id": 1 | ||
} | ||
} | ||
} |