From f31df720e4fb5c832d80766d0c4eac628e820fe4 Mon Sep 17 00:00:00 2001 From: Giovanni_Torrisi_ChainSecurity Date: Fri, 6 Jun 2025 15:11:42 +0200 Subject: [PATCH 1/3] Sort storage variables by slot number --- lib/state/contract_state.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/state/contract_state.rs b/lib/state/contract_state.rs index c328a525..458385c4 100644 --- a/lib/state/contract_state.rs +++ b/lib/state/contract_state.rs @@ -307,6 +307,9 @@ impl<'a> ContractState<'a> { }; critical_storage_variables.push(crit_var); } + + critical_storage_variables.sort_by_key(|crit_var| crit_var.slot); + Ok(critical_storage_variables) } From e0d5f1a2d4c0f4f8fe1f0ef90239ba5a51b02366 Mon Sep 17 00:00:00 2001 From: Hubert Ritzdorf Date: Fri, 6 Jun 2025 16:59:29 +0200 Subject: [PATCH 2/3] fix test --- tests/test_decoding.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_decoding.rs b/tests/test_decoding.rs index a25cd536..3a94bd8a 100644 --- a/tests/test_decoding.rs +++ b/tests/test_decoding.rs @@ -82,7 +82,8 @@ mod tests { let res_str = fs::read_to_string(format!("./tests/data/result_{}.json", contract_name)).unwrap(); - let expected_result: Vec = serde_json::from_str(&res_str).unwrap(); + let mut expected_result: Vec = serde_json::from_str(&res_str).unwrap(); + expected_result.sort_by_key(|exp| exp.slot); assert_eq!(generated_result.len(), expected_result.len()); for i in 0..generated_result.len() { From 45a6c21b130c805a50586aedcce61ad275b1dbc7 Mon Sep 17 00:00:00 2001 From: Hubert Ritzdorf Date: Fri, 6 Jun 2025 17:26:27 +0200 Subject: [PATCH 3/3] Adjust test cases --- .../expected_dvfs/CrazyHiddenStruct.dvf.json | 234 +++++++++--------- tests/expected_dvfs/Deploy_0.dvf.json | 22 +- tests/expected_dvfs/Deploy_0_b1.dvf.json | 20 +- tests/expected_dvfs/Deploy_0_updated.dvf.json | 18 +- tests/expected_dvfs/Deploy_1.dvf.json | 98 ++++---- tests/expected_dvfs/Deploy_1_b1.dvf.json | 56 ++--- tests/expected_dvfs/Deploy_1_updated.dvf.json | 52 ++-- tests/expected_dvfs/Deploy_4.dvf.json | 108 ++++---- tests/expected_dvfs/Deploy_4_b1.dvf.json | 98 ++++---- tests/expected_dvfs/Deploy_4_updated.dvf.json | 96 +++---- tests/expected_dvfs/Deploy_5.dvf.json | 40 +-- tests/expected_dvfs/Deploy_5_b1.dvf.json | 20 +- tests/expected_dvfs/Deploy_5_updated.dvf.json | 18 +- tests/expected_dvfs/HardhatUp.dvf.json | 36 +-- .../TransparentUpgradeableProxy.dvf.json | 20 +- 15 files changed, 468 insertions(+), 468 deletions(-) diff --git a/tests/expected_dvfs/CrazyHiddenStruct.dvf.json b/tests/expected_dvfs/CrazyHiddenStruct.dvf.json index 96f1c041..9fcc21ac 100644 --- a/tests/expected_dvfs/CrazyHiddenStruct.dvf.json +++ b/tests/expected_dvfs/CrazyHiddenStruct.dvf.json @@ -1,6 +1,6 @@ { "version": "0.9.1", - "id": "0xf50233de5831580f52586919088c01292c21b2ca30f629b8f8c1b03d9b930337", + "id": "0x71f27bd042cf53e6783d03336d86171f7d728e61f867e60071ae32818de10da2", "contract_name": "CrazyHiddenStruct", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", "chain_id": 1337, @@ -12,24 +12,6 @@ "immutables": [], "constructor_args": [], "critical_storage_variables": [ - { - "slot": "0x35651ad27f3aefbb385b9ec8083a43fa66a530f8d5c595761b795067f1e74a1e", - "offset": 0, - "var_name": "CrazyHiddenStruct.slot.Struct2.a", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000033", - "value_hint": "51", - "comparison_operator": "Equal" - }, - { - "slot": "0x35651ad27f3aefbb385b9ec8083a43fa66a530f8d5c595761b795067f1e74a1f", - "offset": 0, - "var_name": "CrazyHiddenStruct.slot.Struct2.b", - "var_type": "t_uint192", - "value": "0x000000000000000000000000000000000000000000000034", - "value_hint": "52", - "comparison_operator": "Equal" - }, { "slot": "0x15a25abce1e290903dfb3bf850cde568a79974bd708fad6773051983c8f32392", "offset": 0, @@ -48,6 +30,15 @@ "value_hint": "54", "comparison_operator": "Equal" }, + { + "slot": "0x236453792347cdd69067164d0e3b70a6cccb56abd581bf2f84ba13b07bf3c58d", + "offset": 0, + "var_name": "CrazyHiddenStruct.StorageLocation2.Struct1._mapping[0x5fbdb2315678afecb367f032d93f642f64180aa3]", + "var_type": "t_uint256", + "value": "0x000000000000000000000000000000000000000000000000000000000000002f", + "value_hint": "47", + "comparison_operator": "Equal" + }, { "slot": "0x23a5f7cc72e23cdd4f1db53ce1b03f6dc7fc47aeb7fdbce350f3d3985d8279ce", "offset": 0, @@ -67,21 +58,21 @@ "comparison_operator": "Equal" }, { - "slot": "0x9791306d36f884f84fb67051679efcfc2826c7a42c194c1ea63f58f3d1d1a1d4", + "slot": "0x35651ad27f3aefbb385b9ec8083a43fa66a530f8d5c595761b795067f1e74a1e", "offset": 0, - "var_name": "CrazyHiddenStruct.KeccakStorageLocation2.Struct2.a", + "var_name": "CrazyHiddenStruct.slot.Struct2.a", "var_type": "t_uint256", - "value": "0x000000000000000000000000000000000000000000000000000000000000003d", - "value_hint": "61", + "value": "0x0000000000000000000000000000000000000000000000000000000000000033", + "value_hint": "51", "comparison_operator": "Equal" }, { - "slot": "0x9791306d36f884f84fb67051679efcfc2826c7a42c194c1ea63f58f3d1d1a1d5", + "slot": "0x35651ad27f3aefbb385b9ec8083a43fa66a530f8d5c595761b795067f1e74a1f", "offset": 0, - "var_name": "CrazyHiddenStruct.KeccakStorageLocation2.Struct2.b", + "var_name": "CrazyHiddenStruct.slot.Struct2.b", "var_type": "t_uint192", - "value": "0x00000000000000000000000000000000000000000000003e", - "value_hint": "62", + "value": "0x000000000000000000000000000000000000000000000034", + "value_hint": "52", "comparison_operator": "Equal" }, { @@ -147,33 +138,6 @@ "value_hint": "3", "comparison_operator": "Equal" }, - { - "slot": "0x5b1dc9b27b9505294a9eec7abe23dbfc1a1b1453a90ad80e89410fd965346456", - "offset": 0, - "var_name": "CrazyHiddenStruct.StorageLocation1.Struct1._dynArrayUint40[0]", - "var_type": "t_uint40", - "value": "0x0000000019", - "value_hint": "25", - "comparison_operator": "Equal" - }, - { - "slot": "0x5b1dc9b27b9505294a9eec7abe23dbfc1a1b1453a90ad80e89410fd965346456", - "offset": 5, - "var_name": "CrazyHiddenStruct.StorageLocation1.Struct1._dynArrayUint40[1]", - "var_type": "t_uint40", - "value": "0x000000001a", - "value_hint": "26", - "comparison_operator": "Equal" - }, - { - "slot": "0x5b1dc9b27b9505294a9eec7abe23dbfc1a1b1453a90ad80e89410fd965346456", - "offset": 10, - "var_name": "CrazyHiddenStruct.StorageLocation1.Struct1._dynArrayUint40[2]", - "var_type": "t_uint40", - "value": "0x000000001b", - "value_hint": "27", - "comparison_operator": "Equal" - }, { "slot": "0x41ef84cfd2398a02556624f13effd41aa790a48ce39e70d3a0dc298f7a4dec8e", "offset": 0, @@ -217,15 +181,6 @@ "value_hint": "30", "comparison_operator": "Equal" }, - { - "slot": "0x9aaec34ad20a36f142849df84dc18f6cca8d9667522d7459cee106efd7f1ebe8", - "offset": 0, - "var_name": "CrazyHiddenStruct.StorageLocation1.Struct1._mapping[0x5fbdb2315678afecb367f032d93f642f64180aa3]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000020", - "value_hint": "32", - "comparison_operator": "Equal" - }, { "slot": "0x41ef84cfd2398a02556624f13effd41aa790a48ce39e70d3a0dc298f7a4dec94", "offset": 0, @@ -278,6 +233,78 @@ "value": "0x00000000000000000000000000000023", "comparison_operator": "Equal" }, + { + "slot": "0x42d0407cb447148fd182bf527909ab1ba2fbaefe3f25cbe9851153586910b294", + "offset": 0, + "var_name": "DirectStorageLocation2", + "var_type": "t_uint256", + "value": "0x0000000000000000000000000000000000000000000000000000000000000038", + "value_hint": "56", + "comparison_operator": "Equal" + }, + { + "slot": "0x4a7aec098045e3d96a6592c68c6dbd22bd3358e23bcaa52ab70d20bef4f890ef", + "offset": 0, + "var_name": "[_setDirect4].unnamed", + "var_type": "t_uint128", + "value": "0x0000000000000000000000000000003a", + "value_hint": "58", + "comparison_operator": "Equal" + }, + { + "slot": "0x5b1dc9b27b9505294a9eec7abe23dbfc1a1b1453a90ad80e89410fd965346456", + "offset": 0, + "var_name": "CrazyHiddenStruct.StorageLocation1.Struct1._dynArrayUint40[0]", + "var_type": "t_uint40", + "value": "0x0000000019", + "value_hint": "25", + "comparison_operator": "Equal" + }, + { + "slot": "0x5b1dc9b27b9505294a9eec7abe23dbfc1a1b1453a90ad80e89410fd965346456", + "offset": 5, + "var_name": "CrazyHiddenStruct.StorageLocation1.Struct1._dynArrayUint40[1]", + "var_type": "t_uint40", + "value": "0x000000001a", + "value_hint": "26", + "comparison_operator": "Equal" + }, + { + "slot": "0x5b1dc9b27b9505294a9eec7abe23dbfc1a1b1453a90ad80e89410fd965346456", + "offset": 10, + "var_name": "CrazyHiddenStruct.StorageLocation1.Struct1._dynArrayUint40[2]", + "var_type": "t_uint40", + "value": "0x000000001b", + "value_hint": "27", + "comparison_operator": "Equal" + }, + { + "slot": "0x729d4e87c26acdd3d89aba983a003ca2c8c8a63969ac31180cb88ef645276a20", + "offset": 0, + "var_name": "CrazyHiddenStruct.StorageLocation2.Struct1._dynArrayUint40[0]", + "var_type": "t_uint40", + "value": "0x0000000029", + "value_hint": "41", + "comparison_operator": "Equal" + }, + { + "slot": "0x729d4e87c26acdd3d89aba983a003ca2c8c8a63969ac31180cb88ef645276a20", + "offset": 5, + "var_name": "CrazyHiddenStruct.StorageLocation2.Struct1._dynArrayUint40[1]", + "var_type": "t_uint40", + "value": "0x000000002a", + "value_hint": "42", + "comparison_operator": "Equal" + }, + { + "slot": "0x729d4e87c26acdd3d89aba983a003ca2c8c8a63969ac31180cb88ef645276a20", + "offset": 10, + "var_name": "CrazyHiddenStruct.StorageLocation2.Struct1._dynArrayUint40[2]", + "var_type": "t_uint40", + "value": "0x000000002b", + "value_hint": "43", + "comparison_operator": "Equal" + }, { "slot": "0x852cbd6b186221cbf354c68826ab57cef1512cf2f5d959ca4501e155cbea7ae8", "offset": 0, @@ -332,33 +359,6 @@ "value_hint": "3", "comparison_operator": "Equal" }, - { - "slot": "0x729d4e87c26acdd3d89aba983a003ca2c8c8a63969ac31180cb88ef645276a20", - "offset": 0, - "var_name": "CrazyHiddenStruct.StorageLocation2.Struct1._dynArrayUint40[0]", - "var_type": "t_uint40", - "value": "0x0000000029", - "value_hint": "41", - "comparison_operator": "Equal" - }, - { - "slot": "0x729d4e87c26acdd3d89aba983a003ca2c8c8a63969ac31180cb88ef645276a20", - "offset": 5, - "var_name": "CrazyHiddenStruct.StorageLocation2.Struct1._dynArrayUint40[1]", - "var_type": "t_uint40", - "value": "0x000000002a", - "value_hint": "42", - "comparison_operator": "Equal" - }, - { - "slot": "0x729d4e87c26acdd3d89aba983a003ca2c8c8a63969ac31180cb88ef645276a20", - "offset": 10, - "var_name": "CrazyHiddenStruct.StorageLocation2.Struct1._dynArrayUint40[2]", - "var_type": "t_uint40", - "value": "0x000000002b", - "value_hint": "43", - "comparison_operator": "Equal" - }, { "slot": "0x852cbd6b186221cbf354c68826ab57cef1512cf2f5d959ca4501e155cbea7aec", "offset": 0, @@ -402,15 +402,6 @@ "value_hint": "46", "comparison_operator": "Equal" }, - { - "slot": "0x236453792347cdd69067164d0e3b70a6cccb56abd581bf2f84ba13b07bf3c58d", - "offset": 0, - "var_name": "CrazyHiddenStruct.StorageLocation2.Struct1._mapping[0x5fbdb2315678afecb367f032d93f642f64180aa3]", - "var_type": "t_uint256", - "value": "0x000000000000000000000000000000000000000000000000000000000000002f", - "value_hint": "47", - "comparison_operator": "Equal" - }, { "slot": "0x852cbd6b186221cbf354c68826ab57cef1512cf2f5d959ca4501e155cbea7af2", "offset": 0, @@ -464,11 +455,30 @@ "comparison_operator": "Equal" }, { - "slot": "0xe82aa111a62567be9a414850f7168d2e6c9f9d61a82b90598df0a59035cd53a6", + "slot": "0x9791306d36f884f84fb67051679efcfc2826c7a42c194c1ea63f58f3d1d1a1d4", "offset": 0, - "var_name": "CrazyHiddenStruct.StorageLocation4.AddressSlot.value", - "var_type": "t_address", - "value": "0x5fbdb2315678afecb367f032d93f642f64180aa3", + "var_name": "CrazyHiddenStruct.KeccakStorageLocation2.Struct2.a", + "var_type": "t_uint256", + "value": "0x000000000000000000000000000000000000000000000000000000000000003d", + "value_hint": "61", + "comparison_operator": "Equal" + }, + { + "slot": "0x9791306d36f884f84fb67051679efcfc2826c7a42c194c1ea63f58f3d1d1a1d5", + "offset": 0, + "var_name": "CrazyHiddenStruct.KeccakStorageLocation2.Struct2.b", + "var_type": "t_uint192", + "value": "0x00000000000000000000000000000000000000000000003e", + "value_hint": "62", + "comparison_operator": "Equal" + }, + { + "slot": "0x9aaec34ad20a36f142849df84dc18f6cca8d9667522d7459cee106efd7f1ebe8", + "offset": 0, + "var_name": "CrazyHiddenStruct.StorageLocation1.Struct1._mapping[0x5fbdb2315678afecb367f032d93f642f64180aa3]", + "var_type": "t_uint256", + "value": "0x0000000000000000000000000000000000000000000000000000000000000020", + "value_hint": "32", "comparison_operator": "Equal" }, { @@ -488,15 +498,6 @@ "value_hint": "55", "comparison_operator": "Equal" }, - { - "slot": "0x42d0407cb447148fd182bf527909ab1ba2fbaefe3f25cbe9851153586910b294", - "offset": 0, - "var_name": "DirectStorageLocation2", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000038", - "value_hint": "56", - "comparison_operator": "Equal" - }, { "slot": "0xd63cda19032c797bc0681e2077ae95a9a76af0fdb8f771b8f1cfcdf6578aca6c", "offset": 0, @@ -507,12 +508,11 @@ "comparison_operator": "Equal" }, { - "slot": "0x4a7aec098045e3d96a6592c68c6dbd22bd3358e23bcaa52ab70d20bef4f890ef", + "slot": "0xe82aa111a62567be9a414850f7168d2e6c9f9d61a82b90598df0a59035cd53a6", "offset": 0, - "var_name": "[_setDirect4].unnamed", - "var_type": "t_uint128", - "value": "0x0000000000000000000000000000003a", - "value_hint": "58", + "var_name": "CrazyHiddenStruct.StorageLocation4.AddressSlot.value", + "var_type": "t_address", + "value": "0x5fbdb2315678afecb367f032d93f642f64180aa3", "comparison_operator": "Equal" } ], diff --git a/tests/expected_dvfs/Deploy_0.dvf.json b/tests/expected_dvfs/Deploy_0.dvf.json index e807e925..2aad4cca 100644 --- a/tests/expected_dvfs/Deploy_0.dvf.json +++ b/tests/expected_dvfs/Deploy_0.dvf.json @@ -1,6 +1,6 @@ { "version": "0.9.1", - "id": "0xd5c2ba6466b7c6138861f139a9c71fc2c62202a847c354eed6084bbb8fd93c0c", + "id": "0xaf3c754d94b0f9857c409046651ccf6c73d812b7d9db1c04a74652e8437421cc", "contract_name": "BytesMapping", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", "chain_id": 1337, @@ -13,12 +13,12 @@ "constructor_args": [], "critical_storage_variables": [ { - "slot": "0xb37d9860c28a567bf45179fa03c86974dd335ac8196411736cdce29fbfda6ec1", + "slot": "0x1", "offset": 0, - "var_name": "x[0x41]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000064", - "value_hint": "100", + "var_name": "b (length=23)", + "var_type": "t_bytes_storage", + "value": "0x4a75737420736f6d65206e6f726d616c2062797465732e00000000000000002e", + "value_hint": "4a75737420736f6d65206e6f726d616c2062797465732e", "comparison_operator": "Equal" }, { @@ -49,12 +49,12 @@ "comparison_operator": "Equal" }, { - "slot": "0x1", + "slot": "0xb37d9860c28a567bf45179fa03c86974dd335ac8196411736cdce29fbfda6ec1", "offset": 0, - "var_name": "b (length=23)", - "var_type": "t_bytes_storage", - "value": "0x4a75737420736f6d65206e6f726d616c2062797465732e00000000000000002e", - "value_hint": "4a75737420736f6d65206e6f726d616c2062797465732e", + "var_name": "x[0x41]", + "var_type": "t_uint256", + "value": "0x0000000000000000000000000000000000000000000000000000000000000064", + "value_hint": "100", "comparison_operator": "Equal" } ], diff --git a/tests/expected_dvfs/Deploy_0_b1.dvf.json b/tests/expected_dvfs/Deploy_0_b1.dvf.json index a492e012..89445387 100644 --- a/tests/expected_dvfs/Deploy_0_b1.dvf.json +++ b/tests/expected_dvfs/Deploy_0_b1.dvf.json @@ -1,6 +1,6 @@ { "version": "0.9.1", - "id": "0x4904d0056d9b5ffe89e7e2daeeb7134331ccc30b933f6a94f63867dc08686439", + "id": "0x4be820f0e3915aa5f0cc36ac62260161931c5873c01ed998e18c5f62fbcd2ed0", "contract_name": "BytesMapping", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", "chain_id": 1337, @@ -12,6 +12,15 @@ "immutables": [], "constructor_args": [], "critical_storage_variables": [ + { + "slot": "0x1", + "offset": 0, + "var_name": "b (length=23)", + "var_type": "t_bytes_storage", + "value": "0x4a75737420736f6d65206e6f726d616c2062797465732e00000000000000002e", + "value_hint": "4a75737420736f6d65206e6f726d616c2062797465732e", + "comparison_operator": "Equal" + }, { "slot": "0x4a8918e67ba0b26637797e1472ee3d675d66efda39253f7139f8eabc58b20ffb", "offset": 0, @@ -29,15 +38,6 @@ "value": "0x0000000000000000000000000000000000000000000000000000000000000005", "value_hint": "5", "comparison_operator": "Equal" - }, - { - "slot": "0x1", - "offset": 0, - "var_name": "b (length=23)", - "var_type": "t_bytes_storage", - "value": "0x4a75737420736f6d65206e6f726d616c2062797465732e00000000000000002e", - "value_hint": "4a75737420736f6d65206e6f726d616c2062797465732e", - "comparison_operator": "Equal" } ], "critical_events": [ diff --git a/tests/expected_dvfs/Deploy_0_updated.dvf.json b/tests/expected_dvfs/Deploy_0_updated.dvf.json index f891bff6..d00b7992 100644 --- a/tests/expected_dvfs/Deploy_0_updated.dvf.json +++ b/tests/expected_dvfs/Deploy_0_updated.dvf.json @@ -11,6 +11,15 @@ "immutables": [], "constructor_args": [], "critical_storage_variables": [ + { + "slot": "0x1", + "offset": 0, + "var_name": "b (length=23)", + "var_type": "t_bytes_storage", + "value": "0x4a75737420736f6d65206e6f726d616c2062797465732e00000000000000002e", + "value_hint": "4a75737420736f6d65206e6f726d616c2062797465732e", + "comparison_operator": "Equal" + }, { "slot": "0x4a8918e67ba0b26637797e1472ee3d675d66efda39253f7139f8eabc58b20ffb", "offset": 0, @@ -27,15 +36,6 @@ "var_type": "t_uint256", "value": "0x0000000000000000000000000000000000000000000000000000000000000006", "comparison_operator": "Equal" - }, - { - "slot": "0x1", - "offset": 0, - "var_name": "b (length=23)", - "var_type": "t_bytes_storage", - "value": "0x4a75737420736f6d65206e6f726d616c2062797465732e00000000000000002e", - "value_hint": "4a75737420736f6d65206e6f726d616c2062797465732e", - "comparison_operator": "Equal" } ], "critical_events": [ diff --git a/tests/expected_dvfs/Deploy_1.dvf.json b/tests/expected_dvfs/Deploy_1.dvf.json index ed5f5927..8030e7fa 100644 --- a/tests/expected_dvfs/Deploy_1.dvf.json +++ b/tests/expected_dvfs/Deploy_1.dvf.json @@ -1,6 +1,6 @@ { "version": "0.9.1", - "id": "0xb0473a5acbcc746d6997b0523f4ced4dff4e55c189b2a6bffb9a05e8754dbb30", + "id": "0xf32b45eac919cf99a2294293196b61a639469e6504e7744fd8fe7a437a768756", "contract_name": "StringMapping", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", "chain_id": 1337, @@ -13,12 +13,30 @@ "constructor_args": [], "critical_storage_variables": [ { - "slot": "0xb37d9860c28a567bf45179fa03c86974dd335ac8196411736cdce29fbfda6ec1", + "slot": "0x2fccf76901d0aa8dbb54cf0f8d3d8db6b27e630b57020bc913d21efd33831cbc", "offset": 0, - "var_name": "x[A]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000064", - "value_hint": "100", + "var_name": "y[a][part_0]", + "var_type": "t_string_storage", + "value": "0x4120766572797665727976657279766572797665727976657279766572797665", + "value_hint": "A veryveryveryveryveryveryveryve", + "comparison_operator": "Equal" + }, + { + "slot": "0x2fccf76901d0aa8dbb54cf0f8d3d8db6b27e630b57020bc913d21efd33831cbd", + "offset": 0, + "var_name": "y[a][part_1]", + "var_type": "t_string_storage", + "value": "0x7279766572797665727976657279766572797665727976657279766572797665", + "value_hint": "ryveryveryveryveryveryveryveryve", + "comparison_operator": "Equal" + }, + { + "slot": "0x2fccf76901d0aa8dbb54cf0f8d3d8db6b27e630b57020bc913d21efd33831cbe", + "offset": 13, + "var_name": "y[a][part_2]", + "var_type": "t_string_storage", + "value": "0x727976657279206c6f6e6720737472696e672e", + "value_hint": "ryvery long string.", "comparison_operator": "Equal" }, { @@ -39,6 +57,15 @@ "value_hint": "6", "comparison_operator": "Equal" }, + { + "slot": "0x5cb7530405d23568cccc332e086c4afa26608feb8193b553060fb9aee8e8c04c", + "offset": 0, + "var_name": "y[b] (length=1)", + "var_type": "t_string_storage", + "value": "0x6300000000000000000000000000000000000000000000000000000000000002", + "value_hint": "c", + "comparison_operator": "Equal" + }, { "slot": "0xa94363f9a5bd091e0ec27815f31bc1c4265af2e01bbbc8de08d6de9c1e110092", "offset": 0, @@ -49,9 +76,18 @@ "comparison_operator": "Equal" }, { - "slot": "0xbf6f11c383958d1054c416e03c241009281d4d9c5ed30ab5bba90a72f2234842", + "slot": "0xac85c8cc1ac92e94a731b8df588044cbfd366c5ee08805d198cb1b094f3cacac", "offset": 0, - "var_name": "x[escapethis\"]", + "var_name": "y[abc] (length=14)", + "var_type": "t_string_storage", + "value": "0x612073686f727420737472696e6700000000000000000000000000000000001c", + "value_hint": "a short string", + "comparison_operator": "Equal" + }, + { + "slot": "0xb37d9860c28a567bf45179fa03c86974dd335ac8196411736cdce29fbfda6ec1", + "offset": 0, + "var_name": "x[A]", "var_type": "t_uint256", "value": "0x0000000000000000000000000000000000000000000000000000000000000064", "value_hint": "100", @@ -67,48 +103,12 @@ "comparison_operator": "Equal" }, { - "slot": "0x2fccf76901d0aa8dbb54cf0f8d3d8db6b27e630b57020bc913d21efd33831cbc", - "offset": 0, - "var_name": "y[a][part_0]", - "var_type": "t_string_storage", - "value": "0x4120766572797665727976657279766572797665727976657279766572797665", - "value_hint": "A veryveryveryveryveryveryveryve", - "comparison_operator": "Equal" - }, - { - "slot": "0x2fccf76901d0aa8dbb54cf0f8d3d8db6b27e630b57020bc913d21efd33831cbd", - "offset": 0, - "var_name": "y[a][part_1]", - "var_type": "t_string_storage", - "value": "0x7279766572797665727976657279766572797665727976657279766572797665", - "value_hint": "ryveryveryveryveryveryveryveryve", - "comparison_operator": "Equal" - }, - { - "slot": "0x2fccf76901d0aa8dbb54cf0f8d3d8db6b27e630b57020bc913d21efd33831cbe", - "offset": 13, - "var_name": "y[a][part_2]", - "var_type": "t_string_storage", - "value": "0x727976657279206c6f6e6720737472696e672e", - "value_hint": "ryvery long string.", - "comparison_operator": "Equal" - }, - { - "slot": "0xac85c8cc1ac92e94a731b8df588044cbfd366c5ee08805d198cb1b094f3cacac", - "offset": 0, - "var_name": "y[abc] (length=14)", - "var_type": "t_string_storage", - "value": "0x612073686f727420737472696e6700000000000000000000000000000000001c", - "value_hint": "a short string", - "comparison_operator": "Equal" - }, - { - "slot": "0x5cb7530405d23568cccc332e086c4afa26608feb8193b553060fb9aee8e8c04c", + "slot": "0xbf6f11c383958d1054c416e03c241009281d4d9c5ed30ab5bba90a72f2234842", "offset": 0, - "var_name": "y[b] (length=1)", - "var_type": "t_string_storage", - "value": "0x6300000000000000000000000000000000000000000000000000000000000002", - "value_hint": "c", + "var_name": "x[escapethis\"]", + "var_type": "t_uint256", + "value": "0x0000000000000000000000000000000000000000000000000000000000000064", + "value_hint": "100", "comparison_operator": "Equal" } ], diff --git a/tests/expected_dvfs/Deploy_1_b1.dvf.json b/tests/expected_dvfs/Deploy_1_b1.dvf.json index 8fb2ee11..ec3c43e0 100644 --- a/tests/expected_dvfs/Deploy_1_b1.dvf.json +++ b/tests/expected_dvfs/Deploy_1_b1.dvf.json @@ -1,6 +1,6 @@ { "version": "0.9.1", - "id": "0x7ed8ac4896d783d244402fe86b3b34a0bb870379a825d468efc1dd09363c33d6", + "id": "0xddec5fab35250ee9bb557688e3df2c8ddca9c277e454546e5358aa48a1dfd25c", "contract_name": "StringMapping", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", "chain_id": 1337, @@ -12,33 +12,6 @@ "immutables": [], "constructor_args": [], "critical_storage_variables": [ - { - "slot": "0x4a8918e67ba0b26637797e1472ee3d675d66efda39253f7139f8eabc58b20ffb", - "offset": 0, - "var_name": "x[A veryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryvery long string]", - "var_type": "t_uint256", - "value": "0x000000000000000000000000000000000000000000000000000000000000002a", - "value_hint": "42", - "comparison_operator": "Equal" - }, - { - "slot": "0x5585ade74713b5d6d915d0f40534bd55231ae0a540289299fb117ed2c74ca466", - "offset": 0, - "var_name": "x[Hello this is a test]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000005", - "value_hint": "5", - "comparison_operator": "Equal" - }, - { - "slot": "0xb5cafab5b83d18303877bb912b2d66ca18ab7390cfd9be8a2e66cc5096e0ea02", - "offset": 0, - "var_name": "y[a].length", - "var_type": "t_uint256", - "value": "0x00000000000000000000000000000000000000000000000000000000000000a7", - "value_hint": "167", - "comparison_operator": "Equal" - }, { "slot": "0x2fccf76901d0aa8dbb54cf0f8d3d8db6b27e630b57020bc913d21efd33831cbc", "offset": 0, @@ -66,6 +39,24 @@ "value_hint": "ryvery long string.", "comparison_operator": "Equal" }, + { + "slot": "0x4a8918e67ba0b26637797e1472ee3d675d66efda39253f7139f8eabc58b20ffb", + "offset": 0, + "var_name": "x[A veryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryvery long string]", + "var_type": "t_uint256", + "value": "0x000000000000000000000000000000000000000000000000000000000000002a", + "value_hint": "42", + "comparison_operator": "Equal" + }, + { + "slot": "0x5585ade74713b5d6d915d0f40534bd55231ae0a540289299fb117ed2c74ca466", + "offset": 0, + "var_name": "x[Hello this is a test]", + "var_type": "t_uint256", + "value": "0x0000000000000000000000000000000000000000000000000000000000000005", + "value_hint": "5", + "comparison_operator": "Equal" + }, { "slot": "0xac85c8cc1ac92e94a731b8df588044cbfd366c5ee08805d198cb1b094f3cacac", "offset": 0, @@ -74,6 +65,15 @@ "value": "0x612073686f727420737472696e6700000000000000000000000000000000001c", "value_hint": "a short string", "comparison_operator": "Equal" + }, + { + "slot": "0xb5cafab5b83d18303877bb912b2d66ca18ab7390cfd9be8a2e66cc5096e0ea02", + "offset": 0, + "var_name": "y[a].length", + "var_type": "t_uint256", + "value": "0x00000000000000000000000000000000000000000000000000000000000000a7", + "value_hint": "167", + "comparison_operator": "Equal" } ], "critical_events": [ diff --git a/tests/expected_dvfs/Deploy_1_updated.dvf.json b/tests/expected_dvfs/Deploy_1_updated.dvf.json index ee6f1369..d8865090 100644 --- a/tests/expected_dvfs/Deploy_1_updated.dvf.json +++ b/tests/expected_dvfs/Deploy_1_updated.dvf.json @@ -11,32 +11,6 @@ "immutables": [], "constructor_args": [], "critical_storage_variables": [ - { - "slot": "0x4a8918e67ba0b26637797e1472ee3d675d66efda39253f7139f8eabc58b20ffb", - "offset": 0, - "var_name": "x[A veryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryvery long string]", - "var_type": "t_uint256", - "value": "0x000000000000000000000000000000000000000000000000000000000000002a", - "value_hint": "42", - "comparison_operator": "Equal" - }, - { - "slot": "0x5585ade74713b5d6d915d0f40534bd55231ae0a540289299fb117ed2c74ca466", - "offset": 0, - "var_name": "x[Hello this is a test]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000006", - "comparison_operator": "Equal" - }, - { - "slot": "0xb5cafab5b83d18303877bb912b2d66ca18ab7390cfd9be8a2e66cc5096e0ea02", - "offset": 0, - "var_name": "y[a].length", - "var_type": "t_uint256", - "value": "0x00000000000000000000000000000000000000000000000000000000000000a7", - "value_hint": "167", - "comparison_operator": "Equal" - }, { "slot": "0x2fccf76901d0aa8dbb54cf0f8d3d8db6b27e630b57020bc913d21efd33831cbc", "offset": 0, @@ -64,6 +38,23 @@ "value_hint": "ryvery long string.", "comparison_operator": "Equal" }, + { + "slot": "0x4a8918e67ba0b26637797e1472ee3d675d66efda39253f7139f8eabc58b20ffb", + "offset": 0, + "var_name": "x[A veryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryvery long string]", + "var_type": "t_uint256", + "value": "0x000000000000000000000000000000000000000000000000000000000000002a", + "value_hint": "42", + "comparison_operator": "Equal" + }, + { + "slot": "0x5585ade74713b5d6d915d0f40534bd55231ae0a540289299fb117ed2c74ca466", + "offset": 0, + "var_name": "x[Hello this is a test]", + "var_type": "t_uint256", + "value": "0x0000000000000000000000000000000000000000000000000000000000000006", + "comparison_operator": "Equal" + }, { "slot": "0xac85c8cc1ac92e94a731b8df588044cbfd366c5ee08805d198cb1b094f3cacac", "offset": 0, @@ -72,6 +63,15 @@ "value": "0x612073686f727420737472696e6700000000000000000000000000000000001c", "value_hint": "a short string", "comparison_operator": "Equal" + }, + { + "slot": "0xb5cafab5b83d18303877bb912b2d66ca18ab7390cfd9be8a2e66cc5096e0ea02", + "offset": 0, + "var_name": "y[a].length", + "var_type": "t_uint256", + "value": "0x00000000000000000000000000000000000000000000000000000000000000a7", + "value_hint": "167", + "comparison_operator": "Equal" } ], "critical_events": [ diff --git a/tests/expected_dvfs/Deploy_4.dvf.json b/tests/expected_dvfs/Deploy_4.dvf.json index 190d4b81..57caf355 100644 --- a/tests/expected_dvfs/Deploy_4.dvf.json +++ b/tests/expected_dvfs/Deploy_4.dvf.json @@ -1,6 +1,6 @@ { "version": "0.9.1", - "id": "0x084734e2af8f0401712700a73a919f0432c2c24c933751dd2814bc9b59bc21f3", + "id": "0x0e0f1cf58013f0899d332b2afda5526e2d893f06ddb2149a2cdea045a5b5468d", "contract_name": "StaticArrayOfDynamicArray", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", "chain_id": 1337, @@ -22,66 +22,66 @@ "comparison_operator": "Equal" }, { - "slot": "0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563", + "slot": "0x1", "offset": 0, - "var_name": "staticDynamic[0][0]", - "var_type": "t_uint128", - "value": "0x00000000000000000000000000100000", - "value_hint": "1.048576 * 10^6", + "var_name": "staticDynamic[1].length", + "var_type": "t_uint256", + "value": "0x0000000000000000000000000000000000000000000000000000000000000002", + "value_hint": "2", "comparison_operator": "Equal" }, { - "slot": "0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563", - "offset": 16, - "var_name": "staticDynamic[0][1]", - "var_type": "t_uint128", - "value": "0x00000000000000000000000000100000", - "value_hint": "1.048576 * 10^6", + "slot": "0x2", + "offset": 0, + "var_name": "staticDynamic[2].length", + "var_type": "t_uint256", + "value": "0x0000000000000000000000000000000000000000000000000000000000000001", + "value_hint": "1", "comparison_operator": "Equal" }, { - "slot": "0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e564", + "slot": "0x3", "offset": 0, - "var_name": "staticDynamic[0][2]", - "var_type": "t_uint128", - "value": "0x00000000000000008ac7230489e80000", - "value_hint": "1. * 10^19", + "var_name": "staticDynamicAddress[0].length", + "var_type": "t_uint256", + "value": "0x0000000000000000000000000000000000000000000000000000000000000002", + "value_hint": "2", "comparison_operator": "Equal" }, { - "slot": "0x1", + "slot": "0x4", "offset": 0, - "var_name": "staticDynamic[1].length", + "var_name": "staticDynamicAddress[1].length", "var_type": "t_uint256", "value": "0x0000000000000000000000000000000000000000000000000000000000000002", "value_hint": "2", "comparison_operator": "Equal" }, { - "slot": "0xb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6", + "slot": "0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563", "offset": 0, - "var_name": "staticDynamic[1][0]", + "var_name": "staticDynamic[0][0]", "var_type": "t_uint128", - "value": "0x000000000000000000000002540be400", - "value_hint": "1. * 10^10", + "value": "0x00000000000000000000000000100000", + "value_hint": "1.048576 * 10^6", "comparison_operator": "Equal" }, { - "slot": "0xb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6", + "slot": "0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563", "offset": 16, - "var_name": "staticDynamic[1][1]", + "var_name": "staticDynamic[0][1]", "var_type": "t_uint128", "value": "0x00000000000000000000000000100000", "value_hint": "1.048576 * 10^6", "comparison_operator": "Equal" }, { - "slot": "0x2", + "slot": "0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e564", "offset": 0, - "var_name": "staticDynamic[2].length", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000001", - "value_hint": "1", + "var_name": "staticDynamic[0][2]", + "var_type": "t_uint128", + "value": "0x00000000000000008ac7230489e80000", + "value_hint": "1. * 10^19", "comparison_operator": "Equal" }, { @@ -94,53 +94,53 @@ "comparison_operator": "Equal" }, { - "slot": "0x3", + "slot": "0x8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b", "offset": 0, - "var_name": "staticDynamicAddress[0].length", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000002", - "value_hint": "2", + "var_name": "staticDynamicAddress[1][0]", + "var_type": "t_address", + "value": "0x0000000000000000000000000000000000000011", "comparison_operator": "Equal" }, { - "slot": "0xc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b", + "slot": "0x8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c", "offset": 0, - "var_name": "staticDynamicAddress[0][0]", + "var_name": "staticDynamicAddress[1][1]", "var_type": "t_address", - "value": "0x0000000000000000000000000000000000000001", + "value": "0x0000000000000000000000000000000000000012", "comparison_operator": "Equal" }, { - "slot": "0xc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c", + "slot": "0xb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6", "offset": 0, - "var_name": "staticDynamicAddress[0][1]", - "var_type": "t_address", - "value": "0x0000000000000000000000000000000000000002", + "var_name": "staticDynamic[1][0]", + "var_type": "t_uint128", + "value": "0x000000000000000000000002540be400", + "value_hint": "1. * 10^10", "comparison_operator": "Equal" }, { - "slot": "0x4", - "offset": 0, - "var_name": "staticDynamicAddress[1].length", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000002", - "value_hint": "2", + "slot": "0xb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6", + "offset": 16, + "var_name": "staticDynamic[1][1]", + "var_type": "t_uint128", + "value": "0x00000000000000000000000000100000", + "value_hint": "1.048576 * 10^6", "comparison_operator": "Equal" }, { - "slot": "0x8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b", + "slot": "0xc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b", "offset": 0, - "var_name": "staticDynamicAddress[1][0]", + "var_name": "staticDynamicAddress[0][0]", "var_type": "t_address", - "value": "0x0000000000000000000000000000000000000011", + "value": "0x0000000000000000000000000000000000000001", "comparison_operator": "Equal" }, { - "slot": "0x8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c", + "slot": "0xc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c", "offset": 0, - "var_name": "staticDynamicAddress[1][1]", + "var_name": "staticDynamicAddress[0][1]", "var_type": "t_address", - "value": "0x0000000000000000000000000000000000000012", + "value": "0x0000000000000000000000000000000000000002", "comparison_operator": "Equal" } ], diff --git a/tests/expected_dvfs/Deploy_4_b1.dvf.json b/tests/expected_dvfs/Deploy_4_b1.dvf.json index fcc89453..8f86e2c8 100644 --- a/tests/expected_dvfs/Deploy_4_b1.dvf.json +++ b/tests/expected_dvfs/Deploy_4_b1.dvf.json @@ -1,6 +1,6 @@ { "version": "0.9.1", - "id": "0xece47ed3775266f0fec1b94431711810d08ca30302da7adbcf3a96f8f90f3dfe", + "id": "0x6da8da48d3e2f00c70dacb5f78ddb31895ccb05e07f26ae2d540cc1f35fcf925", "contract_name": "StaticArrayOfDynamicArray", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", "chain_id": 1337, @@ -21,15 +21,6 @@ "value_hint": "1", "comparison_operator": "Equal" }, - { - "slot": "0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563", - "offset": 0, - "var_name": "staticDynamic[0][0]", - "var_type": "t_uint128", - "value": "0x00000000000000000000000000100000", - "value_hint": "1.048576 * 10^6", - "comparison_operator": "Equal" - }, { "slot": "0x1", "offset": 0, @@ -40,89 +31,98 @@ "comparison_operator": "Equal" }, { - "slot": "0xb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6", + "slot": "0x2", "offset": 0, - "var_name": "staticDynamic[1][0]", - "var_type": "t_uint128", - "value": "0x000000000000000000000002540be400", - "value_hint": "1. * 10^10", + "var_name": "staticDynamic[2].length", + "var_type": "t_uint256", + "value": "0x0000000000000000000000000000000000000000000000000000000000000001", + "value_hint": "1", "comparison_operator": "Equal" }, { - "slot": "0xb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6", - "offset": 16, - "var_name": "staticDynamic[1][1]", - "var_type": "t_uint128", - "value": "0x00000000000000000000000000100000", - "value_hint": "1.048576 * 10^6", + "slot": "0x3", + "offset": 0, + "var_name": "staticDynamicAddress[0].length", + "var_type": "t_uint256", + "value": "0x0000000000000000000000000000000000000000000000000000000000000002", + "value_hint": "2", "comparison_operator": "Equal" }, { - "slot": "0x2", + "slot": "0x4", "offset": 0, - "var_name": "staticDynamic[2].length", + "var_name": "staticDynamicAddress[1].length", "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000001", - "value_hint": "1", + "value": "0x0000000000000000000000000000000000000000000000000000000000000002", + "value_hint": "2", "comparison_operator": "Equal" }, { - "slot": "0x405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace", + "slot": "0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563", "offset": 0, - "var_name": "staticDynamic[2][0]", + "var_name": "staticDynamic[0][0]", "var_type": "t_uint128", "value": "0x00000000000000000000000000100000", "value_hint": "1.048576 * 10^6", "comparison_operator": "Equal" }, { - "slot": "0x3", + "slot": "0x405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace", "offset": 0, - "var_name": "staticDynamicAddress[0].length", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000002", - "value_hint": "2", + "var_name": "staticDynamic[2][0]", + "var_type": "t_uint128", + "value": "0x00000000000000000000000000100000", + "value_hint": "1.048576 * 10^6", "comparison_operator": "Equal" }, { - "slot": "0xc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b", + "slot": "0x8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b", "offset": 0, - "var_name": "staticDynamicAddress[0][0]", + "var_name": "staticDynamicAddress[1][0]", "var_type": "t_address", - "value": "0x0000000000000000000000000000000000000001", + "value": "0x0000000000000000000000000000000000000011", "comparison_operator": "Equal" }, { - "slot": "0xc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c", + "slot": "0x8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c", "offset": 0, - "var_name": "staticDynamicAddress[0][1]", + "var_name": "staticDynamicAddress[1][1]", "var_type": "t_address", - "value": "0x0000000000000000000000000000000000000002", + "value": "0x0000000000000000000000000000000000000012", "comparison_operator": "Equal" }, { - "slot": "0x4", + "slot": "0xb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6", "offset": 0, - "var_name": "staticDynamicAddress[1].length", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000002", - "value_hint": "2", + "var_name": "staticDynamic[1][0]", + "var_type": "t_uint128", + "value": "0x000000000000000000000002540be400", + "value_hint": "1. * 10^10", "comparison_operator": "Equal" }, { - "slot": "0x8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b", + "slot": "0xb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6", + "offset": 16, + "var_name": "staticDynamic[1][1]", + "var_type": "t_uint128", + "value": "0x00000000000000000000000000100000", + "value_hint": "1.048576 * 10^6", + "comparison_operator": "Equal" + }, + { + "slot": "0xc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b", "offset": 0, - "var_name": "staticDynamicAddress[1][0]", + "var_name": "staticDynamicAddress[0][0]", "var_type": "t_address", - "value": "0x0000000000000000000000000000000000000011", + "value": "0x0000000000000000000000000000000000000001", "comparison_operator": "Equal" }, { - "slot": "0x8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c", + "slot": "0xc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c", "offset": 0, - "var_name": "staticDynamicAddress[1][1]", + "var_name": "staticDynamicAddress[0][1]", "var_type": "t_address", - "value": "0x0000000000000000000000000000000000000012", + "value": "0x0000000000000000000000000000000000000002", "comparison_operator": "Equal" } ], diff --git a/tests/expected_dvfs/Deploy_4_updated.dvf.json b/tests/expected_dvfs/Deploy_4_updated.dvf.json index 4afc97f1..63ebf8a7 100644 --- a/tests/expected_dvfs/Deploy_4_updated.dvf.json +++ b/tests/expected_dvfs/Deploy_4_updated.dvf.json @@ -19,15 +19,6 @@ "value": "0x0000000000000000000000000000000000000000000000000000000000000003", "comparison_operator": "Equal" }, - { - "slot": "0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563", - "offset": 0, - "var_name": "staticDynamic[0][0]", - "var_type": "t_uint128", - "value": "0x00000000000000000000000000100000", - "value_hint": "1.048576 * 10^6", - "comparison_operator": "Equal" - }, { "slot": "0x1", "offset": 0, @@ -38,89 +29,98 @@ "comparison_operator": "Equal" }, { - "slot": "0xb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6", + "slot": "0x2", "offset": 0, - "var_name": "staticDynamic[1][0]", - "var_type": "t_uint128", - "value": "0x000000000000000000000002540be400", - "value_hint": "1. * 10^10", + "var_name": "staticDynamic[2].length", + "var_type": "t_uint256", + "value": "0x0000000000000000000000000000000000000000000000000000000000000001", + "value_hint": "1", "comparison_operator": "Equal" }, { - "slot": "0xb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6", - "offset": 16, - "var_name": "staticDynamic[1][1]", - "var_type": "t_uint128", - "value": "0x00000000000000000000000000100000", - "value_hint": "1.048576 * 10^6", + "slot": "0x3", + "offset": 0, + "var_name": "staticDynamicAddress[0].length", + "var_type": "t_uint256", + "value": "0x0000000000000000000000000000000000000000000000000000000000000002", + "value_hint": "2", "comparison_operator": "Equal" }, { - "slot": "0x2", + "slot": "0x4", "offset": 0, - "var_name": "staticDynamic[2].length", + "var_name": "staticDynamicAddress[1].length", "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000001", - "value_hint": "1", + "value": "0x0000000000000000000000000000000000000000000000000000000000000002", + "value_hint": "2", "comparison_operator": "Equal" }, { - "slot": "0x405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace", + "slot": "0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563", "offset": 0, - "var_name": "staticDynamic[2][0]", + "var_name": "staticDynamic[0][0]", "var_type": "t_uint128", "value": "0x00000000000000000000000000100000", "value_hint": "1.048576 * 10^6", "comparison_operator": "Equal" }, { - "slot": "0x3", + "slot": "0x405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace", "offset": 0, - "var_name": "staticDynamicAddress[0].length", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000002", - "value_hint": "2", + "var_name": "staticDynamic[2][0]", + "var_type": "t_uint128", + "value": "0x00000000000000000000000000100000", + "value_hint": "1.048576 * 10^6", "comparison_operator": "Equal" }, { - "slot": "0xc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b", + "slot": "0x8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b", "offset": 0, - "var_name": "staticDynamicAddress[0][0]", + "var_name": "staticDynamicAddress[1][0]", "var_type": "t_address", - "value": "0x0000000000000000000000000000000000000001", + "value": "0x0000000000000000000000000000000000000011", "comparison_operator": "Equal" }, { - "slot": "0xc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c", + "slot": "0x8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c", "offset": 0, - "var_name": "staticDynamicAddress[0][1]", + "var_name": "staticDynamicAddress[1][1]", "var_type": "t_address", - "value": "0x0000000000000000000000000000000000000002", + "value": "0x0000000000000000000000000000000000000012", "comparison_operator": "Equal" }, { - "slot": "0x4", + "slot": "0xb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6", "offset": 0, - "var_name": "staticDynamicAddress[1].length", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000002", - "value_hint": "2", + "var_name": "staticDynamic[1][0]", + "var_type": "t_uint128", + "value": "0x000000000000000000000002540be400", + "value_hint": "1. * 10^10", "comparison_operator": "Equal" }, { - "slot": "0x8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b", + "slot": "0xb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6", + "offset": 16, + "var_name": "staticDynamic[1][1]", + "var_type": "t_uint128", + "value": "0x00000000000000000000000000100000", + "value_hint": "1.048576 * 10^6", + "comparison_operator": "Equal" + }, + { + "slot": "0xc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b", "offset": 0, - "var_name": "staticDynamicAddress[1][0]", + "var_name": "staticDynamicAddress[0][0]", "var_type": "t_address", - "value": "0x0000000000000000000000000000000000000011", + "value": "0x0000000000000000000000000000000000000001", "comparison_operator": "Equal" }, { - "slot": "0x8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c", + "slot": "0xc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c", "offset": 0, - "var_name": "staticDynamicAddress[1][1]", + "var_name": "staticDynamicAddress[0][1]", "var_type": "t_address", - "value": "0x0000000000000000000000000000000000000012", + "value": "0x0000000000000000000000000000000000000002", "comparison_operator": "Equal" } ], diff --git a/tests/expected_dvfs/Deploy_5.dvf.json b/tests/expected_dvfs/Deploy_5.dvf.json index 717131b2..3dac2d4a 100644 --- a/tests/expected_dvfs/Deploy_5.dvf.json +++ b/tests/expected_dvfs/Deploy_5.dvf.json @@ -1,6 +1,6 @@ { "version": "0.9.1", - "id": "0xab820566741872653419027b78e012baf4cc8e55d118261e5fde607565208093", + "id": "0x6b85828a46d13a623870f144107120d1b59b2de7b0d5a901ae99c4dea5ce5848", "contract_name": "NestedMapping", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", "chain_id": 1337, @@ -19,21 +19,12 @@ ], "critical_storage_variables": [ { - "slot": "0x59ddd120475e147f8702cb8a770930d245a85b520e2e162e93bb0709fb03bb2c", - "offset": 0, - "var_name": "mp[0x0000000000000000000000000000000000000000][0x5fbdb2315678afecb367f032d93f642f64180aa3]", - "var_type": "t_int128", - "value": "0xfffffffffffffffffffffffffffffffb", - "value_hint": "-5", - "comparison_operator": "Equal" - }, - { - "slot": "0xaeaa4766fab0139a99f9040cba20e61c0d910021e2af6e62c0e4ae73be96aa43", + "slot": "0x3", "offset": 0, - "var_name": "mp[0x5fbdb2315678afecb367f032d93f642f64180aa3][0x1111111254eeb25477b68fb85ed929f73a960582]", - "var_type": "t_int128", - "value": "0x00000000000000000000000005f5e100", - "value_hint": "1. * 10^8", + "var_name": "x", + "var_type": "t_int8", + "value": "0xfe", + "value_hint": "-2", "comparison_operator": "Equal" }, { @@ -45,6 +36,15 @@ "value_hint": "-1000", "comparison_operator": "Equal" }, + { + "slot": "0x59ddd120475e147f8702cb8a770930d245a85b520e2e162e93bb0709fb03bb2c", + "offset": 0, + "var_name": "mp[0x0000000000000000000000000000000000000000][0x5fbdb2315678afecb367f032d93f642f64180aa3]", + "var_type": "t_int128", + "value": "0xfffffffffffffffffffffffffffffffb", + "value_hint": "-5", + "comparison_operator": "Equal" + }, { "slot": "0x679449715eace5b6fab706dd943901e073e351285009cd8e03f12b4ba492c886", "offset": 0, @@ -64,12 +64,12 @@ "comparison_operator": "Equal" }, { - "slot": "0x3", + "slot": "0xaeaa4766fab0139a99f9040cba20e61c0d910021e2af6e62c0e4ae73be96aa43", "offset": 0, - "var_name": "x", - "var_type": "t_int8", - "value": "0xfe", - "value_hint": "-2", + "var_name": "mp[0x5fbdb2315678afecb367f032d93f642f64180aa3][0x1111111254eeb25477b68fb85ed929f73a960582]", + "var_type": "t_int128", + "value": "0x00000000000000000000000005f5e100", + "value_hint": "1. * 10^8", "comparison_operator": "Equal" } ], diff --git a/tests/expected_dvfs/Deploy_5_b1.dvf.json b/tests/expected_dvfs/Deploy_5_b1.dvf.json index cd62d76f..9519cf01 100644 --- a/tests/expected_dvfs/Deploy_5_b1.dvf.json +++ b/tests/expected_dvfs/Deploy_5_b1.dvf.json @@ -1,6 +1,6 @@ { "version": "0.9.1", - "id": "0x227ece469fe8344f2e7477ffce9a86069527c5396cf42830c356186d8cc351bb", + "id": "0x3a6d51f0800decd736f11cb7cea35f054026b004495623d4c0774f8493e79732", "contract_name": "NestedMapping", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", "chain_id": 1337, @@ -18,6 +18,15 @@ } ], "critical_storage_variables": [ + { + "slot": "0x3", + "offset": 0, + "var_name": "x", + "var_type": "t_int8", + "value": "0xfe", + "value_hint": "-2", + "comparison_operator": "Equal" + }, { "slot": "0x59ddd120475e147f8702cb8a770930d245a85b520e2e162e93bb0709fb03bb2c", "offset": 0, @@ -35,15 +44,6 @@ "value": "0x00000000000000000000000005f5e100", "value_hint": "1. * 10^8", "comparison_operator": "Equal" - }, - { - "slot": "0x3", - "offset": 0, - "var_name": "x", - "var_type": "t_int8", - "value": "0xfe", - "value_hint": "-2", - "comparison_operator": "Equal" } ], "critical_events": [], diff --git a/tests/expected_dvfs/Deploy_5_updated.dvf.json b/tests/expected_dvfs/Deploy_5_updated.dvf.json index 72cf0950..0fc12950 100644 --- a/tests/expected_dvfs/Deploy_5_updated.dvf.json +++ b/tests/expected_dvfs/Deploy_5_updated.dvf.json @@ -17,6 +17,15 @@ } ], "critical_storage_variables": [ + { + "slot": "0x3", + "offset": 0, + "var_name": "x", + "var_type": "t_int8", + "value": "0xfe", + "value_hint": "-2", + "comparison_operator": "Equal" + }, { "slot": "0x59ddd120475e147f8702cb8a770930d245a85b520e2e162e93bb0709fb03bb2c", "offset": 0, @@ -34,15 +43,6 @@ "value": "0x00000000000000000000000005f5e100", "value_hint": "1. * 10^8", "comparison_operator": "Equal" - }, - { - "slot": "0x3", - "offset": 0, - "var_name": "x", - "var_type": "t_int8", - "value": "0xfe", - "value_hint": "-2", - "comparison_operator": "Equal" } ], "critical_events": [], diff --git a/tests/expected_dvfs/HardhatUp.dvf.json b/tests/expected_dvfs/HardhatUp.dvf.json index b65e9a95..693709a7 100644 --- a/tests/expected_dvfs/HardhatUp.dvf.json +++ b/tests/expected_dvfs/HardhatUp.dvf.json @@ -1,6 +1,6 @@ { "version": "0.9.1", - "id": "0xc3ecb92c62ade78c884988eb2080701c81d4877dbb737a6017632573ead9b9f3", + "id": "0xb2d4a401181f234c28b3584d6bf83219b9b176106304c9ce5362126d3228a02f", "contract_name": "HardhatUp", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", "chain_id": 1337, @@ -21,23 +21,6 @@ "value_hint": "22", "comparison_operator": "Equal" }, - { - "slot": "0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300", - "offset": 0, - "var_name": "OwnableUpgradeable.OwnableStorageLocation.OwnableStorage._owner", - "var_type": "t_address", - "value": "0x0000000000000000000000000000000000000017", - "comparison_operator": "Equal" - }, - { - "slot": "0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00", - "offset": 0, - "var_name": "Initializable.INITIALIZABLE_STORAGE.InitializableStorage._initialized", - "var_type": "t_uint64", - "value": "0x0000000000000001", - "value_hint": "1", - "comparison_operator": "Equal" - }, { "slot": "0x41ef84cfd2398a02556624f13effd41aa790a48ce39e70d3a0dc298f7a4dec8a", "offset": 0, @@ -55,6 +38,23 @@ "value": "0x000000000000000000000000000000000000000000000015", "value_hint": "21", "comparison_operator": "Equal" + }, + { + "slot": "0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300", + "offset": 0, + "var_name": "OwnableUpgradeable.OwnableStorageLocation.OwnableStorage._owner", + "var_type": "t_address", + "value": "0x0000000000000000000000000000000000000017", + "comparison_operator": "Equal" + }, + { + "slot": "0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00", + "offset": 0, + "var_name": "Initializable.INITIALIZABLE_STORAGE.InitializableStorage._initialized", + "var_type": "t_uint64", + "value": "0x0000000000000001", + "value_hint": "1", + "comparison_operator": "Equal" } ], "critical_events": [ diff --git a/tests/expected_dvfs/TransparentUpgradeableProxy.dvf.json b/tests/expected_dvfs/TransparentUpgradeableProxy.dvf.json index a99b860e..2743d3bf 100644 --- a/tests/expected_dvfs/TransparentUpgradeableProxy.dvf.json +++ b/tests/expected_dvfs/TransparentUpgradeableProxy.dvf.json @@ -1,6 +1,6 @@ { "version": "0.9.1", - "id": "0x02573da1c0f82ea0685ff75857cf9260d6f31a724acb19e47c565da58d271df1", + "id": "0x55ec52c927550e57372994bc0e1b30a57a9ff451e91564af043a85faa1cb116b", "contract_name": "TransparentUpgradeableProxy", "address": "0xe7f1725e7734ce288f8367e1bb143e90bb3f0512", "chain_id": 1337, @@ -40,15 +40,6 @@ "value_hint": "1", "comparison_operator": "Equal" }, - { - "slot": "0xf6d04bbe1a75429862aa97cc198c639a5559580c07ae94016a2b25986f2e3abd", - "offset": 0, - "var_name": "_balances[0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000008ac7230489e80000", - "value_hint": "1. * 10^19", - "comparison_operator": "Equal" - }, { "slot": "0x35", "offset": 0, @@ -92,6 +83,15 @@ "var_type": "t_address", "value": "0xcafac3dd18ac6c6e92c921884f9e4176737c052c", "comparison_operator": "Equal" + }, + { + "slot": "0xf6d04bbe1a75429862aa97cc198c639a5559580c07ae94016a2b25986f2e3abd", + "offset": 0, + "var_name": "_balances[0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266]", + "var_type": "t_uint256", + "value": "0x0000000000000000000000000000000000000000000000008ac7230489e80000", + "value_hint": "1. * 10^19", + "comparison_operator": "Equal" } ], "critical_events": [