-
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
6e9257f
commit 2579486
Showing
14 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
test/libsolidity/syntaxTests/contractBaseLocation/at_before_layout.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,3 @@ | ||
contract C at layout 0x1234ABC { } | ||
// ---- | ||
// ParserError 2314: (11-13): Expected '{' but got identifier |
2 changes: 2 additions & 0 deletions
2
test/libsolidity/syntaxTests/contractBaseLocation/contract_named_at.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,2 @@ | ||
contract at layout at 0x1234ABC { } | ||
// ---- |
2 changes: 2 additions & 0 deletions
2
test/libsolidity/syntaxTests/contractBaseLocation/contract_named_layout.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,2 @@ | ||
contract layout layout at 0x1234ABC { } | ||
// ---- |
5 changes: 5 additions & 0 deletions
5
...ibsolidity/syntaxTests/contractBaseLocation/contract_with_members_named_layout_and_at.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,5 @@ | ||
contract C layout at 0x1234 { | ||
uint layout; | ||
function at() public pure { } | ||
} | ||
// ---- |
3 changes: 3 additions & 0 deletions
3
test/libsolidity/syntaxTests/contractBaseLocation/duplicated_layout_definition.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,3 @@ | ||
contract C layout at 0x1234 is A, B layout at 0xABC { } | ||
// ---- | ||
// ParserError 8714: (36-42): Storage base location was already defined previously. |
4 changes: 4 additions & 0 deletions
4
test/libsolidity/syntaxTests/contractBaseLocation/duplicated_layout_keyword.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,4 @@ | ||
contract C layout layout at 0x1234ABC { } | ||
// ---- | ||
// ParserError 1994: (18-24): Expected 'at' but got identifier | ||
// ParserError 2314: (28-37): Expected '{' but got 'Number' |
2 changes: 2 additions & 0 deletions
2
test/libsolidity/syntaxTests/contractBaseLocation/layout_specification_binary_expression.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,2 @@ | ||
contract C layout at 0xffff * (0x123 + 0xABC) { } | ||
// ---- |
3 changes: 3 additions & 0 deletions
3
...solidity/syntaxTests/contractBaseLocation/layout_specification_constant_in_expression.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,3 @@ | ||
uint constant X = 42; | ||
contract C layout at 0xffff * (50 - X) { } | ||
// ---- |
8 changes: 8 additions & 0 deletions
8
test/libsolidity/syntaxTests/contractBaseLocation/layout_specification_function_erc7201.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,8 @@ | ||
function erc7201(bytes memory id) pure returns (uint256) { | ||
return uint256( | ||
keccak256(bytes.concat(bytes32(uint256(keccak256(id)) - 1))) & | ||
~bytes32(uint256(0xff)) | ||
); | ||
} | ||
contract C layout at erc7201("C") { } | ||
// ---- |
3 changes: 3 additions & 0 deletions
3
test/libsolidity/syntaxTests/contractBaseLocation/layout_specification_no_expression.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,3 @@ | ||
contract C layout at { } | ||
// ---- | ||
// ParserError 6933: (21-22): Expected primary expression. |
4 changes: 4 additions & 0 deletions
4
test/libsolidity/syntaxTests/contractBaseLocation/layout_statement_without_at.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,4 @@ | ||
contract C layout { } | ||
// ---- | ||
// ParserError 1994: (18-19): Expected 'at' but got '{' | ||
// ParserError 6933: (20-21): Expected primary expression. |
5 changes: 5 additions & 0 deletions
5
test/libsolidity/syntaxTests/contractBaseLocation/layout_with_inheritance.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,5 @@ | ||
contract A { } | ||
contract B { } | ||
contract C is A, B layout at 0x1234 { } | ||
contract D layout at 0xABCD is A, B { } | ||
// ---- |
4 changes: 4 additions & 0 deletions
4
test/libsolidity/syntaxTests/contractBaseLocation/simple_layout.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,4 @@ | ||
contract A layout at 0x1234 {} | ||
contract B layout at 1024 {} | ||
contract C layout at "C" {} | ||
// ---- |
5 changes: 5 additions & 0 deletions
5
test/libsolidity/syntaxTests/inheritance/duplicated_inheritance_definition.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,5 @@ | ||
contract A {} | ||
contract B {} | ||
contract C is A is B{ } | ||
// ---- | ||
// ParserError 6668: (44-46): Base contracts were already defined previously. |