From f8f71eca2b84ddce24d48d120cd4b6f7dcd41ea1 Mon Sep 17 00:00:00 2001 From: webthethird Date: Wed, 28 Dec 2022 11:44:34 -0600 Subject: [PATCH] Add test contracts for storage layout using structure types --- tests/check-upgradeability/contractV1_struct.sol | 8 ++++++++ tests/check-upgradeability/contractV2_struct.sol | 8 ++++++++ tests/check-upgradeability/contractV2_struct_bug.sol | 8 ++++++++ 3 files changed, 24 insertions(+) create mode 100644 tests/check-upgradeability/contractV1_struct.sol create mode 100644 tests/check-upgradeability/contractV2_struct.sol create mode 100644 tests/check-upgradeability/contractV2_struct_bug.sol diff --git a/tests/check-upgradeability/contractV1_struct.sol b/tests/check-upgradeability/contractV1_struct.sol new file mode 100644 index 000000000..cd0e90bd4 --- /dev/null +++ b/tests/check-upgradeability/contractV1_struct.sol @@ -0,0 +1,8 @@ +contract ContractV1{ + struct Foo { + uint256 bar; + address baz; + } + address destination; + Foo foo; +} diff --git a/tests/check-upgradeability/contractV2_struct.sol b/tests/check-upgradeability/contractV2_struct.sol new file mode 100644 index 000000000..76175d004 --- /dev/null +++ b/tests/check-upgradeability/contractV2_struct.sol @@ -0,0 +1,8 @@ +contract ContractV2{ + struct Foo { + uint256 bar; + address baz; + } + address destination; + Foo foo; +} diff --git a/tests/check-upgradeability/contractV2_struct_bug.sol b/tests/check-upgradeability/contractV2_struct_bug.sol new file mode 100644 index 000000000..2e3b0da34 --- /dev/null +++ b/tests/check-upgradeability/contractV2_struct_bug.sol @@ -0,0 +1,8 @@ +contract ContractV2{ + struct Foo { + uint8 bar; + address baz; + } + address destination; + Foo foo; +}