diff --git a/README.md b/README.md index 36a45bc7..5b3cc555 100644 --- a/README.md +++ b/README.md @@ -212,6 +212,14 @@ dv init --project --address
--contractname --ini Please note that `` must be equal to or larger than the deployment block of the contract. Additionally, it is recommended to use only block numbers of **finalized blocks** in order to prevent the DVF containing wrong data due to possible re-orgs in the future. +Sometimes, you might want to know when a storage variable has been initialized before but then reset back to zero. You can add such variables to the DVF with the `--zerovalue` flag: + +``` +dv init --project --address
--contractname --zerovalue new.dvf.json +``` + +Attention: In rare edge cases, this can lead to false positives. + #### Step 2 - Validate data and select constraints After Step 1, a new JSON file has been created that contains the following data: diff --git a/lib/state/contract_state.rs b/lib/state/contract_state.rs index 2f274c93..c328a525 100644 --- a/lib/state/contract_state.rs +++ b/lib/state/contract_state.rs @@ -243,6 +243,7 @@ impl<'a> ContractState<'a> { table: &mut Table, pi_storage: &Vec, pi_types: &HashMap, + zerovalue: bool, ) -> Result, ValidationError> { let default_values = &ForgeInspect::default_values(); // Add default types as we might need them @@ -259,6 +260,7 @@ impl<'a> ContractState<'a> { state_variable, snapshot, table, + zerovalue, )?); } @@ -272,7 +274,8 @@ impl<'a> ContractState<'a> { // continue; // } - let new_critical_storage_variables = self.get_critical_variable(sv, snapshot, table)?; + let new_critical_storage_variables = + self.get_critical_variable(sv, snapshot, table, zerovalue)?; let mut has_nonzero = false; for crit_var in &new_critical_storage_variables { if !crit_var.is_zero() { @@ -367,6 +370,7 @@ impl<'a> ContractState<'a> { state_variable: &StateVariable, snapshot: &mut StorageSnapshot, table: &mut Table, + zerovalue: bool, ) -> Result, ValidationError> { if Self::is_basic_type(&state_variable.var_type) || Self::is_user_defined_type(&state_variable.var_type) @@ -385,7 +389,7 @@ impl<'a> ContractState<'a> { value_hint: None, comparison_operator: DVFStorageComparisonOperator::Equal, }; - if !entry.is_zero() { + if zerovalue || !entry.is_zero() { Self::add_to_table(&entry, table); if !Self::is_user_defined_type(&state_variable.var_type) { self.pretty_printer.add_decoded_to_table_from_bytes( @@ -402,9 +406,11 @@ impl<'a> ContractState<'a> { entry.value_hint = Some(short_val); } } + + return Ok(vec![entry]); } - return Ok(vec![entry]); + return Ok(vec![]); } if Self::is_struct(&state_variable.var_type) { let mut critical_storage_variables = Vec::::new(); @@ -421,6 +427,7 @@ impl<'a> ContractState<'a> { &adjusted_member, snapshot, table, + zerovalue, )?); } return Ok(critical_storage_variables); @@ -444,6 +451,7 @@ impl<'a> ContractState<'a> { &length_var, snapshot, table, + zerovalue, )?); } let mut current_slot = match self.is_dynamic_array(&state_variable.var_type) { @@ -459,7 +467,7 @@ impl<'a> ContractState<'a> { var_type: self.get_base_type(&state_variable.var_type), }; critical_storage_variables - .extend(self.get_critical_variable(&base, snapshot, table)?); + .extend(self.get_critical_variable(&base, snapshot, table, zerovalue)?); // Check if we need to skip multiple slots if base_num_bytes > 32 { current_slot = current_slot @@ -489,6 +497,16 @@ impl<'a> ContractState<'a> { sorted_keys.sort(); for (sorted_key, target_slot) in &sorted_keys { let key_type = self.get_key_type(&state_variable.var_type); + + // Skip if key is longer than actual key type of the mapping + // this prevents classifiying keccak calls as mapping keys when + // the last 32 bytes correspond to a slot + // we can still have false positives, so the --zerovalue option + // should be used with care + if self.has_inplace_encoding(&key_type) && sorted_key.len() > 64 { + continue; + } + let pretty_key: String = match self.has_inplace_encoding(&key_type) { true => self .pretty_printer @@ -515,7 +533,7 @@ impl<'a> ContractState<'a> { var_type: self.get_value_type(&state_variable.var_type), }; critical_storage_variables - .extend(self.get_critical_variable(&base, snapshot, table)?); + .extend(self.get_critical_variable(&base, snapshot, table, zerovalue)?); } return Ok(critical_storage_variables); } @@ -579,6 +597,7 @@ impl<'a> ContractState<'a> { &length_var, snapshot, table, + zerovalue, )?); let mut string_length = U256::from_be_slice(&snapshot.get_slot( &length_var.slot, diff --git a/src/dvf.rs b/src/dvf.rs index 01101caa..f8d11be1 100644 --- a/src/dvf.rs +++ b/src/dvf.rs @@ -459,6 +459,13 @@ fn main() { .help("Folder containing the project artifacts") .default_value("artifacts"), ) + .arg( + arg!(--zerovalue) + .help( + "Write initialized storage slots that have been reset to 0 to the DVF", + ) + .action(clap::ArgAction::SetTrue), + ) .arg(arg!(--buildcache ).help("Folder containing build-info files")) .arg( arg!(--implementationbuildcache ) @@ -530,6 +537,13 @@ fn main() { .help("The block number used for validation") .value_parser(is_valid_blocknum), ) + .arg( + arg!(--zerovalue) + .help( + "Write initialized storage slots that have been reset to 0 to the DVF", + ) + .action(clap::ArgAction::SetTrue), + ) .arg(arg!().help("The DVF file")), ) .subcommand( @@ -742,6 +756,7 @@ fn process(matches: ArgMatches) -> Result<(), ValidationError> { let event_topics = sub_m .get_many::>("eventtopics") .map(|v| v.flat_map(|x| x.clone()).collect::>()); + let zerovalue = sub_m.get_flag("zerovalue"); let mut imp_env = *sub_m.get_one::("implementationenv").unwrap(); let imp_project = sub_m.get_one::("implementationproject"); @@ -983,6 +998,7 @@ fn process(matches: ArgMatches) -> Result<(), ValidationError> { &mut storage_var_table, &storage, &types, + zerovalue, )?; let mut proxy_warning = critical_storage_variables @@ -1302,6 +1318,7 @@ fn process(matches: ArgMatches) -> Result<(), ValidationError> { Some(("update", sub_m)) => { let input_path: PathBuf = parse_input_path(&config, sub_m.get_one::("DVF").unwrap())?; + let zerovalue = sub_m.get_flag("zerovalue"); println!("input path {}", input_path.display()); let mut pc = 1_u64; @@ -1364,6 +1381,12 @@ fn process(matches: ArgMatches) -> Result<(), ValidationError> { storage_variable.value_hint = None; } } + if !zerovalue { + // Remove storage variables with value 0 + updated + .critical_storage_variables + .retain(|var| !var.is_zero()); + } print_progress("Checking Events.", &mut pc, &progress_mode); // Validate events diff --git a/src/gentest.rs b/src/gentest.rs index 360d2c1e..b3f0774e 100644 --- a/src/gentest.rs +++ b/src/gentest.rs @@ -108,6 +108,7 @@ fn gen_test(matches: &ArgMatches) -> Result<(), ValidationError> { &mut table, &vec![], &HashMap::new(), + true, )?; let serialized_res = serde_json::to_string_pretty(&critical_vars)?; diff --git a/tests/ci_tests.sh b/tests/ci_tests.sh index 87e9fb72..65f7974d 100755 --- a/tests/ci_tests.sh +++ b/tests/ci_tests.sh @@ -28,10 +28,10 @@ cd tests/hardhat_2_0 && yarn install -y && npx hardhat compile && cd - RUST_BACKTRACE=1 cargo test envsubst < tests/config.json > /tmp/eval_config.json cargo run --bin fetch-from-etherscan -- -c /tmp/eval_config.json --address 0x5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f --project /tmp/uni-factory -cargo run --bin dv -- --config /tmp/eval_config.json init --address 0x5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f --project /tmp/uni-factory --chainid 1 --factory --contractname UniswapV2Factory UniswapV2Factory_0x5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f.dvf.json +cargo run --bin dv -- --config /tmp/eval_config.json init --address 0x5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f --project /tmp/uni-factory --chainid 1 --factory --zerovalue --contractname UniswapV2Factory UniswapV2Factory_0x5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f.dvf.json # TODO: Parse output cargo run --bin dv -- -c /tmp/eval_config.json generate-build-cache --project /tmp/uni-factory -cargo run --bin dv -- --verbose --verbose --config /tmp/eval_config.json init --address 0x5e8422345238f34275888049021821e8e08caa1f --contractname frxETH --project examples/frxETH-public --initblock 15728402 examples/dvfs/frx_out.dvf.json +cargo run --bin dv -- --verbose --verbose --config /tmp/eval_config.json init --address 0x5e8422345238f34275888049021821e8e08caa1f --zerovalue --contractname frxETH --project examples/frxETH-public --initblock 15728402 examples/dvfs/frx_out.dvf.json cargo run --bin dv -- --config /tmp/eval_config.json sign examples/dvfs/frxETH_filtered.dvf.json cargo run --bin dv -- --config /tmp/eval_config.json validate --validationblock 15729502 examples/dvfs/frxETH_filtered.dvf.json cargo run --bin dv -- --config /tmp/eval_config.json validate --validationblock 15740402 examples/dvfs/CErc20Delegator_0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643.dvf.json || touch should_fail @@ -41,7 +41,7 @@ cargo run --bin dv -- --config /tmp/eval_config.json sign examples/dvfs/CErc20D cargo run --bin dv -- --config /tmp/eval_config.json validate --validationblock 15740402 examples/dvfs/CErc20Delegator_0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643_updated.dvf.json # Make sure libraries work cargo run --bin fetch-from-etherscan -- --config /tmp/eval_config.json --address 0x43506849D7C04F9138D1A2050bbF3A0c054402dd --project /tmp/usdc_implementation2 -cargo run --bin dv -- -c /tmp/eval_config.json init --address 0x43506849D7C04F9138D1A2050bbF3A0c054402dd --project /tmp/usdc_implementation2 --chainid 1 --contractname FiatTokenV2_2 FiatTokenV2_2_0x43506849D7C04F9138D1A2050bbF3A0c054402dd.dvf.json +cargo run --bin dv -- -c /tmp/eval_config.json init --address 0x43506849D7C04F9138D1A2050bbF3A0c054402dd --project /tmp/usdc_implementation2 --chainid 1 --zerovalue --contractname FiatTokenV2_2 FiatTokenV2_2_0x43506849D7C04F9138D1A2050bbF3A0c054402dd.dvf.json # - echo "DAI Tests" # - cargo run --bin fetch-from-etherscan -- --config tests/test_config.json --project /tmp/dai --address 0x6b175474e89094c44da98b954eedeac495271d0f # - cargo run --bin dv -- --config tests/test_config.json init --address 0x6b175474e89094c44da98b954eedeac495271d0f --project /tmp/dai --chainid 1 --contractname Dai Dai_0x6b175474e89094c44da98b954eedeac495271d0f.dvf.json diff --git a/tests/data/result_CrazyStruct.json b/tests/data/result_CrazyStruct.json index e45e6ff7..c231a536 100644 --- a/tests/data/result_CrazyStruct.json +++ b/tests/data/result_CrazyStruct.json @@ -41,6 +41,7 @@ "var_name": "S.D[0]", "var_type": "t_uint64", "value": "0x0000000000000000", + "value_hint": "0", "comparison_operator": "Equal" }, { @@ -58,6 +59,7 @@ "var_name": "S.D[2]", "var_type": "t_uint64", "value": "0x0000000000000000", + "value_hint": "0", "comparison_operator": "Equal" }, { @@ -66,6 +68,7 @@ "var_name": "S.D[3]", "var_type": "t_uint64", "value": "0x0000000000000000", + "value_hint": "0", "comparison_operator": "Equal" }, { @@ -74,6 +77,7 @@ "var_name": "S.D[4]", "var_type": "t_uint64", "value": "0x0000000000000000", + "value_hint": "0", "comparison_operator": "Equal" }, { @@ -100,6 +104,7 @@ "var_name": "S.mp[0xe7f1725e7734ce288f8367e1bb143e90bb3f0512][42]", "var_type": "t_bool", "value": "0x00", + "value_hint": "false", "comparison_operator": "Equal" }, { @@ -117,6 +122,7 @@ "var_name": "S.F.length", "var_type": "t_uint256", "value": "0x0000000000000000000000000000000000000000000000000000000000000000", + "value_hint": "0", "comparison_operator": "Equal" } ] \ No newline at end of file diff --git a/tests/data/result_DynamicArrayOfStaticArray.json b/tests/data/result_DynamicArrayOfStaticArray.json index 36a237ee..8028a1d0 100644 --- a/tests/data/result_DynamicArrayOfStaticArray.json +++ b/tests/data/result_DynamicArrayOfStaticArray.json @@ -68,7 +68,8 @@ "var_name": "dynamicStatic[1][0]", "var_type": "t_uint64", "value": "0x0000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" }, { "slot": "0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e565", @@ -76,7 +77,8 @@ "var_name": "dynamicStatic[1][1]", "var_type": "t_uint64", "value": "0x0000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" }, { "slot": "0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e565", @@ -93,7 +95,8 @@ "var_name": "dynamicStatic[1][3]", "var_type": "t_uint64", "value": "0x0000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" }, { "slot": "0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e566", @@ -101,7 +104,8 @@ "var_name": "dynamicStatic[1][4]", "var_type": "t_uint64", "value": "0x0000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" }, { "slot": "0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e566", @@ -109,6 +113,7 @@ "var_name": "dynamicStatic[1][5]", "var_type": "t_uint64", "value": "0x0000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" } ] \ No newline at end of file diff --git a/tests/data/result_StaticArray.json b/tests/data/result_StaticArray.json index bcf719a0..be44dc14 100644 --- a/tests/data/result_StaticArray.json +++ b/tests/data/result_StaticArray.json @@ -5,7 +5,8 @@ "var_name": "staticArray[0]", "var_type": "t_uint64", "value": "0x0000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" }, { "slot": "0x0", @@ -13,7 +14,8 @@ "var_name": "staticArray[1]", "var_type": "t_uint64", "value": "0x0000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" }, { "slot": "0x0", @@ -21,7 +23,8 @@ "var_name": "staticArray[2]", "var_type": "t_uint64", "value": "0x0000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" }, { "slot": "0x0", @@ -29,7 +32,8 @@ "var_name": "staticArray[3]", "var_type": "t_uint64", "value": "0x0000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" }, { "slot": "0x1", diff --git a/tests/data/result_StaticArrayOfDynamicArray.json b/tests/data/result_StaticArrayOfDynamicArray.json index 7faa82a0..9ff2bc65 100644 --- a/tests/data/result_StaticArrayOfDynamicArray.json +++ b/tests/data/result_StaticArrayOfDynamicArray.json @@ -118,6 +118,7 @@ "var_name": "staticDynamicAddress[2].length", "var_type": "t_uint256", "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" } ] \ No newline at end of file diff --git a/tests/data/result_StaticArrayOfStaticArray.json b/tests/data/result_StaticArrayOfStaticArray.json index 17b60143..de723b27 100644 --- a/tests/data/result_StaticArrayOfStaticArray.json +++ b/tests/data/result_StaticArrayOfStaticArray.json @@ -5,7 +5,8 @@ "var_name": "staticStatic[0][0]", "var_type": "t_uint64", "value": "0x0000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" }, { "slot": "0x0", @@ -22,7 +23,8 @@ "var_name": "staticStatic[0][2]", "var_type": "t_uint64", "value": "0x0000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" }, { "slot": "0x0", @@ -30,7 +32,8 @@ "var_name": "staticStatic[0][3]", "var_type": "t_uint64", "value": "0x0000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" }, { "slot": "0x1", @@ -38,7 +41,8 @@ "var_name": "staticStatic[0][4]", "var_type": "t_uint64", "value": "0x0000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" }, { "slot": "0x1", @@ -46,7 +50,8 @@ "var_name": "staticStatic[0][5]", "var_type": "t_uint64", "value": "0x0000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" }, { "slot": "0x2", @@ -54,7 +59,8 @@ "var_name": "staticStatic[1][0]", "var_type": "t_uint64", "value": "0x0000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" }, { "slot": "0x2", @@ -62,7 +68,8 @@ "var_name": "staticStatic[1][1]", "var_type": "t_uint64", "value": "0x0000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" }, { "slot": "0x2", @@ -70,7 +77,8 @@ "var_name": "staticStatic[1][2]", "var_type": "t_uint64", "value": "0x0000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" }, { "slot": "0x2", @@ -78,7 +86,8 @@ "var_name": "staticStatic[1][3]", "var_type": "t_uint64", "value": "0x0000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" }, { "slot": "0x3", @@ -86,7 +95,8 @@ "var_name": "staticStatic[1][4]", "var_type": "t_uint64", "value": "0x0000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" }, { "slot": "0x3", @@ -94,7 +104,8 @@ "var_name": "staticStatic[1][5]", "var_type": "t_uint64", "value": "0x0000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" }, { "slot": "0x4", @@ -102,7 +113,8 @@ "var_name": "staticStatic[2][0]", "var_type": "t_uint64", "value": "0x0000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" }, { "slot": "0x4", @@ -110,7 +122,8 @@ "var_name": "staticStatic[2][1]", "var_type": "t_uint64", "value": "0x0000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" }, { "slot": "0x4", @@ -118,7 +131,8 @@ "var_name": "staticStatic[2][2]", "var_type": "t_uint64", "value": "0x0000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" }, { "slot": "0x4", @@ -135,7 +149,8 @@ "var_name": "staticStatic[2][4]", "var_type": "t_uint64", "value": "0x0000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" }, { "slot": "0x5", @@ -143,6 +158,7 @@ "var_name": "staticStatic[2][5]", "var_type": "t_uint64", "value": "0x0000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" } ] \ No newline at end of file diff --git a/tests/data/result_StaticArrayOfStruct.json b/tests/data/result_StaticArrayOfStruct.json index 53fbbe01..4e033d19 100644 --- a/tests/data/result_StaticArrayOfStruct.json +++ b/tests/data/result_StaticArrayOfStruct.json @@ -5,7 +5,8 @@ "var_name": "buffer", "var_type": "t_uint256", "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" }, { "slot": "0x1", @@ -30,7 +31,8 @@ "var_name": "static_array_of_struct[0].C", "var_type": "t_bool", "value": "0x00", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "false" }, { "slot": "0x3", @@ -38,7 +40,8 @@ "var_name": "static_array_of_struct[1].A", "var_type": "t_uint256", "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" }, { "slot": "0x4", @@ -54,7 +57,8 @@ "var_name": "static_array_of_struct[1].C", "var_type": "t_bool", "value": "0x00", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "false" }, { "slot": "0x5", @@ -62,7 +66,8 @@ "var_name": "static_array_of_struct[2].A", "value": "0x0000000000000000000000000000000000000000000000000000000000000000", "var_type": "t_uint256", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" }, { "slot": "0x6", @@ -78,7 +83,8 @@ "var_name": "static_array_of_struct[2].C", "var_type": "t_bool", "value": "0x00", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "false" }, { "slot": "0x7", @@ -86,7 +92,8 @@ "var_name": "static_array_of_struct[3].A", "var_type": "t_uint256", "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" }, { "slot": "0x8", @@ -102,7 +109,8 @@ "var_name": "static_array_of_struct[3].C", "var_type": "t_bool", "value": "0x00", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "false" }, { "slot": "0x9", @@ -110,7 +118,8 @@ "var_name": "static_array_of_struct[4].A", "var_type": "t_uint256", "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" }, { "slot": "0xa", diff --git a/tests/data/result_StaticInMapping.json b/tests/data/result_StaticInMapping.json index 6fa4ac0d..c31e1612 100644 --- a/tests/data/result_StaticInMapping.json +++ b/tests/data/result_StaticInMapping.json @@ -14,7 +14,8 @@ "var_name": "static_in_mapping[0x2279b7a0a67db372996a5fab50d91eaa73d2ebe6][1]", "var_type": "t_uint128", "value": "0x00000000000000000000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" }, { "slot": "0xe0372278de572bbd5d63248f2b77bfb55ce05ca08cd67fd2db16096cd1520944", @@ -31,7 +32,8 @@ "var_name": "static_in_mapping[0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266][0]", "var_type": "t_uint128", "value": "0x00000000000000000000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" }, { "slot": "0x723077b8a1b173adc35e5f0e7e3662fd1208212cb629f9c128551ea7168da722", @@ -48,6 +50,7 @@ "var_name": "static_in_mapping[0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266][2]", "var_type": "t_uint128", "value": "0x00000000000000000000000000000000", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "0" } ] \ No newline at end of file diff --git a/tests/data/result_StructInMapping.json b/tests/data/result_StructInMapping.json index c99ca990..70d36a4d 100644 --- a/tests/data/result_StructInMapping.json +++ b/tests/data/result_StructInMapping.json @@ -50,7 +50,8 @@ "var_name": "struct_in_mapping[0x610178da211fef7d417bc0e6fed39f05609ad788].t[0].C", "var_type": "t_bool", "value": "0x00", - "comparison_operator": "Equal" + "comparison_operator": "Equal", + "value_hint": "false" }, { "slot": "0x42282cb97f9321ce3af58e0e24b033b8e626d34ab4c1176a9c222f81d51e8c33", diff --git a/tests/expected_dvfs/AllValueTypes.dvf.json b/tests/expected_dvfs/AllValueTypes.dvf.json index 30f2382f..e956f986 100644 --- a/tests/expected_dvfs/AllValueTypes.dvf.json +++ b/tests/expected_dvfs/AllValueTypes.dvf.json @@ -1,6 +1,6 @@ { "version": "0.9.1", - "id": "0x75b09431c899db2042cfe484d8db8442ab7d6f0c39851b8c79ec02d22b0852ca", + "id": "0x3cccbcf8829c5544b9448600dbb9236b73144f48570aa3cd4f226ace208c617d", "contract_name": "AllValueTypes", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", "chain_id": 1337, @@ -913,14 +913,6 @@ "value_hint": "313034", "comparison_operator": "Equal" }, - { - "slot": "0x46", - "offset": 0, - "var_name": "_enum", - "var_type": "t_uint8", - "value": "0x00", - "comparison_operator": "Equal" - }, { "slot": "0x46", "offset": 1, diff --git a/tests/expected_dvfs/CrazyHiddenStruct.dvf.json b/tests/expected_dvfs/CrazyHiddenStruct.dvf.json index 1450f2fd..96f1c041 100644 --- a/tests/expected_dvfs/CrazyHiddenStruct.dvf.json +++ b/tests/expected_dvfs/CrazyHiddenStruct.dvf.json @@ -1,6 +1,6 @@ { "version": "0.9.1", - "id": "0xae089608b66548be52d5d573af2f46bf32591d45b990f1945ec879c1d9fa3766", + "id": "0xf50233de5831580f52586919088c01292c21b2ca30f629b8f8c1b03d9b930337", "contract_name": "CrazyHiddenStruct", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", "chain_id": 1337, @@ -323,14 +323,6 @@ "value_hint": "-40", "comparison_operator": "Equal" }, - { - "slot": "0x852cbd6b186221cbf354c68826ab57cef1512cf2f5d959ca4501e155cbea7aea", - "offset": 24, - "var_name": "CrazyHiddenStruct.StorageLocation2.Struct1._bool", - "var_type": "t_bool", - "value": "0x00", - "comparison_operator": "Equal" - }, { "slot": "0x852cbd6b186221cbf354c68826ab57cef1512cf2f5d959ca4501e155cbea7aeb", "offset": 0, @@ -437,14 +429,6 @@ "value_hint": "74657374697465737432", "comparison_operator": "Equal" }, - { - "slot": "0x852cbd6b186221cbf354c68826ab57cef1512cf2f5d959ca4501e155cbea7af4", - "offset": 0, - "var_name": "CrazyHiddenStruct.StorageLocation2.Struct1._enum", - "var_type": "t_uint8", - "value": "0x00", - "comparison_operator": "Equal" - }, { "slot": "0x852cbd6b186221cbf354c68826ab57cef1512cf2f5d959ca4501e155cbea7af5", "offset": 0, diff --git a/tests/expected_dvfs/Deploy_3.dvf.json b/tests/expected_dvfs/Deploy_3.dvf.json index 4d7563eb..8c6b8fa2 100644 --- a/tests/expected_dvfs/Deploy_3.dvf.json +++ b/tests/expected_dvfs/Deploy_3.dvf.json @@ -1,6 +1,6 @@ { "version": "0.9.1", - "id": "0x171bad4cf0641e22ba9e207f32e7d5e6ffbe7eac9f38ecea1f5f634f5ff90ed3", + "id": "0xbc3e8ac7bad0b5b12172162e89c6f5124cbdd2e260bab72b4535a709d2074151", "contract_name": "StructInEvent", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", "chain_id": 1337, @@ -47,14 +47,6 @@ "value_hint": "true", "comparison_operator": "Equal" }, - { - "slot": "0x3", - "offset": 0, - "var_name": "S.D[0]", - "var_type": "t_uint64", - "value": "0x0000000000000000", - "comparison_operator": "Equal" - }, { "slot": "0x3", "offset": 8, @@ -64,14 +56,6 @@ "value_hint": "42", "comparison_operator": "Equal" }, - { - "slot": "0x3", - "offset": 16, - "var_name": "S.D[2]", - "var_type": "t_uint64", - "value": "0x0000000000000000", - "comparison_operator": "Equal" - }, { "slot": "0x3", "offset": 24, @@ -81,14 +65,6 @@ "value_hint": "3", "comparison_operator": "Equal" }, - { - "slot": "0x4", - "offset": 0, - "var_name": "S.D[4]", - "var_type": "t_uint64", - "value": "0x0000000000000000", - "comparison_operator": "Equal" - }, { "slot": "0x4", "offset": 8, diff --git a/tests/expected_dvfs/Deploy_3_b1.dvf.json b/tests/expected_dvfs/Deploy_3_b1.dvf.json index 25bd3b49..036c1771 100644 --- a/tests/expected_dvfs/Deploy_3_b1.dvf.json +++ b/tests/expected_dvfs/Deploy_3_b1.dvf.json @@ -1,6 +1,6 @@ { "version": "0.9.1", - "id": "0x07ad6b97283894cd7a05a9a4c03810a93b2ee455e62fe2410c3f46eb087f2e75", + "id": "0xa3bfeecaaef483be31339beb0d06237a231de693f8098e2b53dc9334cd8d5cc6", "contract_name": "StructInEvent", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", "chain_id": 1337, @@ -47,14 +47,6 @@ "value_hint": "true", "comparison_operator": "Equal" }, - { - "slot": "0x3", - "offset": 0, - "var_name": "S.D[0]", - "var_type": "t_uint64", - "value": "0x0000000000000000", - "comparison_operator": "Equal" - }, { "slot": "0x3", "offset": 8, @@ -64,30 +56,6 @@ "value_hint": "42", "comparison_operator": "Equal" }, - { - "slot": "0x3", - "offset": 16, - "var_name": "S.D[2]", - "var_type": "t_uint64", - "value": "0x0000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x3", - "offset": 24, - "var_name": "S.D[3]", - "var_type": "t_uint64", - "value": "0x0000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x4", - "offset": 0, - "var_name": "S.D[4]", - "var_type": "t_uint64", - "value": "0x0000000000000000", - "comparison_operator": "Equal" - }, { "slot": "0x4", "offset": 8, diff --git a/tests/expected_dvfs/Deploy_3_updated.dvf.json b/tests/expected_dvfs/Deploy_3_updated.dvf.json index 8c17ce26..7d444371 100644 --- a/tests/expected_dvfs/Deploy_3_updated.dvf.json +++ b/tests/expected_dvfs/Deploy_3_updated.dvf.json @@ -44,14 +44,6 @@ "value_hint": "true", "comparison_operator": "Equal" }, - { - "slot": "0x3", - "offset": 0, - "var_name": "S.D[0]", - "var_type": "t_uint64", - "value": "0x0000000000000000", - "comparison_operator": "Equal" - }, { "slot": "0x3", "offset": 8, @@ -61,30 +53,6 @@ "value_hint": "42", "comparison_operator": "Equal" }, - { - "slot": "0x3", - "offset": 16, - "var_name": "S.D[2]", - "var_type": "t_uint64", - "value": "0x0000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x3", - "offset": 24, - "var_name": "S.D[3]", - "var_type": "t_uint64", - "value": "0x0000000000000003", - "comparison_operator": "Equal" - }, - { - "slot": "0x4", - "offset": 0, - "var_name": "S.D[4]", - "var_type": "t_uint64", - "value": "0x0000000000000000", - "comparison_operator": "Equal" - }, { "slot": "0x4", "offset": 8, diff --git a/tests/expected_dvfs/Deploy_4.dvf.json b/tests/expected_dvfs/Deploy_4.dvf.json index 8218b278..190d4b81 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": "0xe37bdbff0b3eea9634d6aff5274d01a99a62abff6e538f229d00b87d8d8e953e", + "id": "0x084734e2af8f0401712700a73a919f0432c2c24c933751dd2814bc9b59bc21f3", "contract_name": "StaticArrayOfDynamicArray", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", "chain_id": 1337, @@ -142,14 +142,6 @@ "var_type": "t_address", "value": "0x0000000000000000000000000000000000000012", "comparison_operator": "Equal" - }, - { - "slot": "0x5", - "offset": 0, - "var_name": "staticDynamicAddress[2].length", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" } ], "critical_events": [ diff --git a/tests/expected_dvfs/Deploy_4_b1.dvf.json b/tests/expected_dvfs/Deploy_4_b1.dvf.json index 651b5f94..fcc89453 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": "0x92f80b3e4d61b30c63e56f1521ddc7b9f834d10af244ffe84679ea8e3bc25ab1", + "id": "0xece47ed3775266f0fec1b94431711810d08ca30302da7adbcf3a96f8f90f3dfe", "contract_name": "StaticArrayOfDynamicArray", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", "chain_id": 1337, @@ -124,14 +124,6 @@ "var_type": "t_address", "value": "0x0000000000000000000000000000000000000012", "comparison_operator": "Equal" - }, - { - "slot": "0x5", - "offset": 0, - "var_name": "staticDynamicAddress[2].length", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" } ], "critical_events": [ diff --git a/tests/expected_dvfs/Deploy_4_updated.dvf.json b/tests/expected_dvfs/Deploy_4_updated.dvf.json index e924852c..4afc97f1 100644 --- a/tests/expected_dvfs/Deploy_4_updated.dvf.json +++ b/tests/expected_dvfs/Deploy_4_updated.dvf.json @@ -122,14 +122,6 @@ "var_type": "t_address", "value": "0x0000000000000000000000000000000000000012", "comparison_operator": "Equal" - }, - { - "slot": "0x5", - "offset": 0, - "var_name": "staticDynamicAddress[2].length", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" } ], "critical_events": [ diff --git a/tests/expected_dvfs/Deploy_6_b1.dvf.json b/tests/expected_dvfs/Deploy_6_b1.dvf.json index 98366acd..84589e8b 100644 --- a/tests/expected_dvfs/Deploy_6_b1.dvf.json +++ b/tests/expected_dvfs/Deploy_6_b1.dvf.json @@ -1,6 +1,6 @@ { "version": "0.9.1", - "id": "0xe016ec69d1cacfc3dc7fefe45acc11fb2b7af643cc478299329be5e80b9f2223", + "id": "0x1979e57f83e0246b5dbefbeeb1cd0025a9701205415f2d1c1edaeb37e406561d", "contract_name": "Enum", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", "chain_id": 1337, @@ -20,22 +20,6 @@ "value": "0x01", "comparison_operator": "Equal" }, - { - "slot": "0x1", - "offset": 0, - "var_name": "a[0]", - "var_type": "t_uint8", - "value": "0x00", - "comparison_operator": "Equal" - }, - { - "slot": "0x1", - "offset": 1, - "var_name": "a[1]", - "var_type": "t_uint8", - "value": "0x00", - "comparison_operator": "Equal" - }, { "slot": "0x1", "offset": 2, diff --git a/tests/expected_dvfs/Deploy_6_updated.dvf.json b/tests/expected_dvfs/Deploy_6_updated.dvf.json index a077d24b..31b7cfa4 100644 --- a/tests/expected_dvfs/Deploy_6_updated.dvf.json +++ b/tests/expected_dvfs/Deploy_6_updated.dvf.json @@ -18,30 +18,6 @@ "var_type": "t_uint8", "value": "0x03", "comparison_operator": "Equal" - }, - { - "slot": "0x1", - "offset": 0, - "var_name": "a[0]", - "var_type": "t_uint8", - "value": "0x00", - "comparison_operator": "Equal" - }, - { - "slot": "0x1", - "offset": 1, - "var_name": "a[1]", - "var_type": "t_uint8", - "value": "0x01", - "comparison_operator": "Equal" - }, - { - "slot": "0x1", - "offset": 2, - "var_name": "a[2]", - "var_type": "t_uint8", - "value": "0x00", - "comparison_operator": "Equal" } ], "critical_events": [], diff --git a/tests/expected_dvfs/HardhatUp.dvf.json b/tests/expected_dvfs/HardhatUp.dvf.json index ae0c9f5d..b65e9a95 100644 --- a/tests/expected_dvfs/HardhatUp.dvf.json +++ b/tests/expected_dvfs/HardhatUp.dvf.json @@ -1,6 +1,6 @@ { "version": "0.9.1", - "id": "0xf022962b5e00eff4c06c71b712da1913c170d4bcf465a0ec0ebf01a20d556555", + "id": "0xc3ecb92c62ade78c884988eb2080701c81d4877dbb737a6017632573ead9b9f3", "contract_name": "HardhatUp", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", "chain_id": 1337, @@ -38,14 +38,6 @@ "value_hint": "1", "comparison_operator": "Equal" }, - { - "slot": "0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00", - "offset": 8, - "var_name": "Initializable.INITIALIZABLE_STORAGE.InitializableStorage._initializing", - "var_type": "t_bool", - "value": "0x00", - "comparison_operator": "Equal" - }, { "slot": "0x41ef84cfd2398a02556624f13effd41aa790a48ce39e70d3a0dc298f7a4dec8a", "offset": 0, diff --git a/tests/expected_dvfs/MyToken.dvf.json b/tests/expected_dvfs/MyToken.dvf.json index cff3eb6f..000e150d 100644 --- a/tests/expected_dvfs/MyToken.dvf.json +++ b/tests/expected_dvfs/MyToken.dvf.json @@ -1,6 +1,6 @@ { "version": "0.9.1", - "id": "0xf61ad87d043243f3bbc2408dcf2fcbff03999e4978592d31409eece5410f17a7", + "id": "0xea582136017acdbdec6da968a7c63c78c13e25b9d435e7fd72fb64a75ff786e6", "contract_name": "MyToken", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", "chain_id": 1337, @@ -31,422 +31,6 @@ "value_hint": "255", "comparison_operator": "Equal" }, - { - "slot": "0x0", - "offset": 1, - "var_name": "_initializing", - "var_type": "t_bool", - "value": "0x00", - "comparison_operator": "Equal" - }, - { - "slot": "0x1", - "offset": 0, - "var_name": "__gap[0]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x2", - "offset": 0, - "var_name": "__gap[1]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x3", - "offset": 0, - "var_name": "__gap[2]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x4", - "offset": 0, - "var_name": "__gap[3]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x5", - "offset": 0, - "var_name": "__gap[4]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x6", - "offset": 0, - "var_name": "__gap[5]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x7", - "offset": 0, - "var_name": "__gap[6]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x8", - "offset": 0, - "var_name": "__gap[7]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x9", - "offset": 0, - "var_name": "__gap[8]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0xa", - "offset": 0, - "var_name": "__gap[9]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0xb", - "offset": 0, - "var_name": "__gap[10]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0xc", - "offset": 0, - "var_name": "__gap[11]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0xd", - "offset": 0, - "var_name": "__gap[12]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0xe", - "offset": 0, - "var_name": "__gap[13]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0xf", - "offset": 0, - "var_name": "__gap[14]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x10", - "offset": 0, - "var_name": "__gap[15]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x11", - "offset": 0, - "var_name": "__gap[16]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x12", - "offset": 0, - "var_name": "__gap[17]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x13", - "offset": 0, - "var_name": "__gap[18]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x14", - "offset": 0, - "var_name": "__gap[19]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x15", - "offset": 0, - "var_name": "__gap[20]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x16", - "offset": 0, - "var_name": "__gap[21]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x17", - "offset": 0, - "var_name": "__gap[22]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x18", - "offset": 0, - "var_name": "__gap[23]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x19", - "offset": 0, - "var_name": "__gap[24]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x1a", - "offset": 0, - "var_name": "__gap[25]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x1b", - "offset": 0, - "var_name": "__gap[26]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x1c", - "offset": 0, - "var_name": "__gap[27]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x1d", - "offset": 0, - "var_name": "__gap[28]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x1e", - "offset": 0, - "var_name": "__gap[29]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x1f", - "offset": 0, - "var_name": "__gap[30]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x20", - "offset": 0, - "var_name": "__gap[31]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x21", - "offset": 0, - "var_name": "__gap[32]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x22", - "offset": 0, - "var_name": "__gap[33]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x23", - "offset": 0, - "var_name": "__gap[34]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x24", - "offset": 0, - "var_name": "__gap[35]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x25", - "offset": 0, - "var_name": "__gap[36]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x26", - "offset": 0, - "var_name": "__gap[37]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x27", - "offset": 0, - "var_name": "__gap[38]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x28", - "offset": 0, - "var_name": "__gap[39]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x29", - "offset": 0, - "var_name": "__gap[40]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x2a", - "offset": 0, - "var_name": "__gap[41]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x2b", - "offset": 0, - "var_name": "__gap[42]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x2c", - "offset": 0, - "var_name": "__gap[43]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x2d", - "offset": 0, - "var_name": "__gap[44]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x2e", - "offset": 0, - "var_name": "__gap[45]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x2f", - "offset": 0, - "var_name": "__gap[46]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x30", - "offset": 0, - "var_name": "__gap[47]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x31", - "offset": 0, - "var_name": "__gap[48]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x32", - "offset": 0, - "var_name": "__gap[49]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x35", - "offset": 0, - "var_name": "_totalSupply", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, { "slot": "0x36", "offset": 0, @@ -464,366 +48,6 @@ "value": "0x0000000000000000000000000000000000000000000000000000000000000000", "value_hint": "", "comparison_operator": "Equal" - }, - { - "slot": "0x38", - "offset": 0, - "var_name": "__gap[0]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x39", - "offset": 0, - "var_name": "__gap[1]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x3a", - "offset": 0, - "var_name": "__gap[2]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x3b", - "offset": 0, - "var_name": "__gap[3]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x3c", - "offset": 0, - "var_name": "__gap[4]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x3d", - "offset": 0, - "var_name": "__gap[5]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x3e", - "offset": 0, - "var_name": "__gap[6]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x3f", - "offset": 0, - "var_name": "__gap[7]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x40", - "offset": 0, - "var_name": "__gap[8]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x41", - "offset": 0, - "var_name": "__gap[9]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x42", - "offset": 0, - "var_name": "__gap[10]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x43", - "offset": 0, - "var_name": "__gap[11]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x44", - "offset": 0, - "var_name": "__gap[12]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x45", - "offset": 0, - "var_name": "__gap[13]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x46", - "offset": 0, - "var_name": "__gap[14]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x47", - "offset": 0, - "var_name": "__gap[15]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x48", - "offset": 0, - "var_name": "__gap[16]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x49", - "offset": 0, - "var_name": "__gap[17]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x4a", - "offset": 0, - "var_name": "__gap[18]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x4b", - "offset": 0, - "var_name": "__gap[19]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x4c", - "offset": 0, - "var_name": "__gap[20]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x4d", - "offset": 0, - "var_name": "__gap[21]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x4e", - "offset": 0, - "var_name": "__gap[22]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x4f", - "offset": 0, - "var_name": "__gap[23]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x50", - "offset": 0, - "var_name": "__gap[24]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x51", - "offset": 0, - "var_name": "__gap[25]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x52", - "offset": 0, - "var_name": "__gap[26]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x53", - "offset": 0, - "var_name": "__gap[27]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x54", - "offset": 0, - "var_name": "__gap[28]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x55", - "offset": 0, - "var_name": "__gap[29]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x56", - "offset": 0, - "var_name": "__gap[30]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x57", - "offset": 0, - "var_name": "__gap[31]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x58", - "offset": 0, - "var_name": "__gap[32]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x59", - "offset": 0, - "var_name": "__gap[33]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x5a", - "offset": 0, - "var_name": "__gap[34]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x5b", - "offset": 0, - "var_name": "__gap[35]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x5c", - "offset": 0, - "var_name": "__gap[36]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x5d", - "offset": 0, - "var_name": "__gap[37]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x5e", - "offset": 0, - "var_name": "__gap[38]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x5f", - "offset": 0, - "var_name": "__gap[39]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x60", - "offset": 0, - "var_name": "__gap[40]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x61", - "offset": 0, - "var_name": "__gap[41]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x62", - "offset": 0, - "var_name": "__gap[42]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x63", - "offset": 0, - "var_name": "__gap[43]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x64", - "offset": 0, - "var_name": "__gap[44]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" } ], "critical_events": [ diff --git a/tests/expected_dvfs/PullPayment.dvf.json b/tests/expected_dvfs/PullPayment.dvf.json index 140d59ef..803c02eb 100644 --- a/tests/expected_dvfs/PullPayment.dvf.json +++ b/tests/expected_dvfs/PullPayment.dvf.json @@ -1,13 +1,13 @@ { "version": "0.9.1", - "id": "0x1f9085f7983793563f4d835b22704a4ef2e543a792c2d2c38a74306605892aab", + "id": "0x63f4e0c8ddff41ebb5f9918cd3edfb7443e28f14444efdf5649a35ec54d72a6e", "contract_name": "PullPayment", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", - "chain_id": 31337, - "deployment_block_num": 1, + "chain_id": 1337, + "deployment_block_num": 2, "init_block_num": 3, - "deployment_tx": "0x880b946acafe61dab514f83b0366a46a3a9b10c2e637704bcc5427e6f5653132", - "codehash": "0xccc1bca53ef158eb1ee9e98588e569e215b13adfac46a89ca920e1a57a973be5", + "deployment_tx": "0x42d75b67073ebd107239df89b1f512be1972205d5bc728bcafeb3dc5675d0d15", + "codehash": "0x0d737bb1623f9f2c92d870330a5e6e657949fc96c0cd7b09d93be7565d352580", "insecure": false, "immutables": [ { @@ -16,16 +16,7 @@ } ], "constructor_args": [], - "critical_storage_variables": [ - { - "slot": "0x0", - "offset": 0, - "var_name": "var_escrow", - "var_type": "t_address", - "value": "0x0000000000000000000000000000000000000000", - "comparison_operator": "Equal" - } - ], + "critical_storage_variables": [], "critical_events": [], "unvalidated_metadata": { "author_name": "Author", @@ -38,4 +29,4 @@ "source_url": "https://github.com/source/code", "security_contact": "security@example.org" } -} +} \ No newline at end of file diff --git a/tests/expected_dvfs/TransparentUpgradeableProxy.dvf.json b/tests/expected_dvfs/TransparentUpgradeableProxy.dvf.json index f6827ece..a99b860e 100644 --- a/tests/expected_dvfs/TransparentUpgradeableProxy.dvf.json +++ b/tests/expected_dvfs/TransparentUpgradeableProxy.dvf.json @@ -1,6 +1,6 @@ { "version": "0.9.1", - "id": "0x67500690126beab1e3bbd362947503f5ddd17142dfecd966f3c03e012bad60eb", + "id": "0x02573da1c0f82ea0685ff75857cf9260d6f31a724acb19e47c565da58d271df1", "contract_name": "TransparentUpgradeableProxy", "address": "0xe7f1725e7734ce288f8367e1bb143e90bb3f0512", "chain_id": 1337, @@ -40,414 +40,6 @@ "value_hint": "1", "comparison_operator": "Equal" }, - { - "slot": "0x0", - "offset": 1, - "var_name": "_initializing", - "var_type": "t_bool", - "value": "0x00", - "comparison_operator": "Equal" - }, - { - "slot": "0x1", - "offset": 0, - "var_name": "__gap[0]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x2", - "offset": 0, - "var_name": "__gap[1]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x3", - "offset": 0, - "var_name": "__gap[2]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x4", - "offset": 0, - "var_name": "__gap[3]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x5", - "offset": 0, - "var_name": "__gap[4]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x6", - "offset": 0, - "var_name": "__gap[5]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x7", - "offset": 0, - "var_name": "__gap[6]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x8", - "offset": 0, - "var_name": "__gap[7]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x9", - "offset": 0, - "var_name": "__gap[8]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0xa", - "offset": 0, - "var_name": "__gap[9]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0xb", - "offset": 0, - "var_name": "__gap[10]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0xc", - "offset": 0, - "var_name": "__gap[11]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0xd", - "offset": 0, - "var_name": "__gap[12]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0xe", - "offset": 0, - "var_name": "__gap[13]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0xf", - "offset": 0, - "var_name": "__gap[14]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x10", - "offset": 0, - "var_name": "__gap[15]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x11", - "offset": 0, - "var_name": "__gap[16]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x12", - "offset": 0, - "var_name": "__gap[17]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x13", - "offset": 0, - "var_name": "__gap[18]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x14", - "offset": 0, - "var_name": "__gap[19]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x15", - "offset": 0, - "var_name": "__gap[20]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x16", - "offset": 0, - "var_name": "__gap[21]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x17", - "offset": 0, - "var_name": "__gap[22]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x18", - "offset": 0, - "var_name": "__gap[23]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x19", - "offset": 0, - "var_name": "__gap[24]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x1a", - "offset": 0, - "var_name": "__gap[25]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x1b", - "offset": 0, - "var_name": "__gap[26]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x1c", - "offset": 0, - "var_name": "__gap[27]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x1d", - "offset": 0, - "var_name": "__gap[28]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x1e", - "offset": 0, - "var_name": "__gap[29]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x1f", - "offset": 0, - "var_name": "__gap[30]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x20", - "offset": 0, - "var_name": "__gap[31]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x21", - "offset": 0, - "var_name": "__gap[32]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x22", - "offset": 0, - "var_name": "__gap[33]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x23", - "offset": 0, - "var_name": "__gap[34]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x24", - "offset": 0, - "var_name": "__gap[35]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x25", - "offset": 0, - "var_name": "__gap[36]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x26", - "offset": 0, - "var_name": "__gap[37]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x27", - "offset": 0, - "var_name": "__gap[38]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x28", - "offset": 0, - "var_name": "__gap[39]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x29", - "offset": 0, - "var_name": "__gap[40]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x2a", - "offset": 0, - "var_name": "__gap[41]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x2b", - "offset": 0, - "var_name": "__gap[42]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x2c", - "offset": 0, - "var_name": "__gap[43]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x2d", - "offset": 0, - "var_name": "__gap[44]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x2e", - "offset": 0, - "var_name": "__gap[45]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x2f", - "offset": 0, - "var_name": "__gap[46]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x30", - "offset": 0, - "var_name": "__gap[47]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x31", - "offset": 0, - "var_name": "__gap[48]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x32", - "offset": 0, - "var_name": "__gap[49]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, { "slot": "0xf6d04bbe1a75429862aa97cc198c639a5559580c07ae94016a2b25986f2e3abd", "offset": 0, @@ -484,366 +76,6 @@ "value_hint": "MTK", "comparison_operator": "Equal" }, - { - "slot": "0x38", - "offset": 0, - "var_name": "__gap[0]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x39", - "offset": 0, - "var_name": "__gap[1]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x3a", - "offset": 0, - "var_name": "__gap[2]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x3b", - "offset": 0, - "var_name": "__gap[3]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x3c", - "offset": 0, - "var_name": "__gap[4]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x3d", - "offset": 0, - "var_name": "__gap[5]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x3e", - "offset": 0, - "var_name": "__gap[6]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x3f", - "offset": 0, - "var_name": "__gap[7]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x40", - "offset": 0, - "var_name": "__gap[8]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x41", - "offset": 0, - "var_name": "__gap[9]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x42", - "offset": 0, - "var_name": "__gap[10]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x43", - "offset": 0, - "var_name": "__gap[11]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x44", - "offset": 0, - "var_name": "__gap[12]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x45", - "offset": 0, - "var_name": "__gap[13]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x46", - "offset": 0, - "var_name": "__gap[14]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x47", - "offset": 0, - "var_name": "__gap[15]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x48", - "offset": 0, - "var_name": "__gap[16]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x49", - "offset": 0, - "var_name": "__gap[17]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x4a", - "offset": 0, - "var_name": "__gap[18]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x4b", - "offset": 0, - "var_name": "__gap[19]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x4c", - "offset": 0, - "var_name": "__gap[20]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x4d", - "offset": 0, - "var_name": "__gap[21]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x4e", - "offset": 0, - "var_name": "__gap[22]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x4f", - "offset": 0, - "var_name": "__gap[23]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x50", - "offset": 0, - "var_name": "__gap[24]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x51", - "offset": 0, - "var_name": "__gap[25]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x52", - "offset": 0, - "var_name": "__gap[26]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x53", - "offset": 0, - "var_name": "__gap[27]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x54", - "offset": 0, - "var_name": "__gap[28]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x55", - "offset": 0, - "var_name": "__gap[29]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x56", - "offset": 0, - "var_name": "__gap[30]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x57", - "offset": 0, - "var_name": "__gap[31]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x58", - "offset": 0, - "var_name": "__gap[32]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x59", - "offset": 0, - "var_name": "__gap[33]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x5a", - "offset": 0, - "var_name": "__gap[34]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x5b", - "offset": 0, - "var_name": "__gap[35]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x5c", - "offset": 0, - "var_name": "__gap[36]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x5d", - "offset": 0, - "var_name": "__gap[37]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x5e", - "offset": 0, - "var_name": "__gap[38]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x5f", - "offset": 0, - "var_name": "__gap[39]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x60", - "offset": 0, - "var_name": "__gap[40]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x61", - "offset": 0, - "var_name": "__gap[41]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x62", - "offset": 0, - "var_name": "__gap[42]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x63", - "offset": 0, - "var_name": "__gap[43]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, - { - "slot": "0x64", - "offset": 0, - "var_name": "__gap[44]", - "var_type": "t_uint256", - "value": "0x0000000000000000000000000000000000000000000000000000000000000000", - "comparison_operator": "Equal" - }, { "slot": "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc", "offset": 0, diff --git a/tests/test_decoding.rs b/tests/test_decoding.rs index 918471ef..a25cd536 100644 --- a/tests/test_decoding.rs +++ b/tests/test_decoding.rs @@ -1,10 +1,10 @@ #[cfg(test)] mod tests { - use std::collections::HashMap; use std::fs; - use std::path::Path; + use std::path::{Path, PathBuf}; + use dvf_libs::bytecode_verification::parse_json::{Environment, ProjectInfo}; use dvf_libs::dvf::config::DVFConfig; use dvf_libs::dvf::parse::DVFStorageEntry; use dvf_libs::state::contract_state::ContractState; @@ -20,6 +20,14 @@ mod tests { ) -> Vec { let mut empty_config = DVFConfig::default(); empty_config.set_chain_id(1).unwrap(); + let project_info = ProjectInfo::new( + &String::from(contract_name), + PathBuf::from("tests/Contracts").as_path(), + Environment::Foundry, + PathBuf::from("").as_path(), + None, + ) + .unwrap(); let pretty_printer = PrettyPrinter::new(&empty_config, None); let mut global_state = ContractState::new_with_address(&trace_w_a.address, &pretty_printer); let forge_inspect = forge_inspect::ForgeInspect::generate_and_parse_layout( @@ -34,7 +42,13 @@ mod tests { let mut table = Table::new(); global_state - .get_critical_storage_variables(snapshot, &mut table, &vec![], &HashMap::new()) + .get_critical_storage_variables( + snapshot, + &mut table, + &project_info.storage, + &project_info.types, + true, + ) .unwrap() } diff --git a/tests/test_end_to_end.rs b/tests/test_end_to_end.rs index 974f7d50..0f84a922 100644 --- a/tests/test_end_to_end.rs +++ b/tests/test_end_to_end.rs @@ -553,6 +553,9 @@ mod tests { .success(); println!("{}", &String::from_utf8_lossy(&assert.get_output().stdout)); + // Uncomment to regenerate expected files + // std::fs::copy(factory_outfile.path(), Path::new("tests/expected_dvfs/PullPayment.dvf.json")).unwrap(); + // Remove the extra byte again truncate_last_byte(src_name);