From 6773b83b20390419a09a684abfc55707e0199b7b Mon Sep 17 00:00:00 2001 From: Hubert Ritzdorf Date: Wed, 26 Mar 2025 18:53:47 +0100 Subject: [PATCH 1/5] Automatically Generate ID during init --- lib/dvf/parse.rs | 157 +++++++++++++++++++---------------------------- src/dvf.rs | 5 +- 2 files changed, 65 insertions(+), 97 deletions(-) diff --git a/lib/dvf/parse.rs b/lib/dvf/parse.rs index 09694ce0..d0fb3fbb 100644 --- a/lib/dvf/parse.rs +++ b/lib/dvf/parse.rs @@ -174,28 +174,7 @@ impl fmt::Display for ValidationError { } } -pub trait BasicDVF: Serialize { - fn check_version(&self) -> Result<(), ValidationError> { - let version = self.get_version(); - if version < &LOWEST_SUPPORTED_VERSION { - return Err(ValidationError::Error("DV Version too old.".to_string())); - } - if version > &HIGHEST_SUPPORTED_VERSION { - return Err(ValidationError::Error("DV Version too new.".to_string())); - } - Ok(()) - } - - fn get_version(&self) -> &Version; - - fn write_to_file(&self, path: &Path) -> Result<(), ValidationError> { - let output = serde_json::to_string_pretty(&self)?; - - let mut file = File::create(path)?; - file.write_all(output.as_bytes())?; - Ok(()) - } -} +pub trait BasicDVF: Serialize {} fn bytes_to_hex(bytes: &T, serializer: S) -> Result where @@ -351,9 +330,23 @@ pub struct Unvalidated { implementation_address: Option
, } -#[derive(Serialize, Deserialize, Debug)] -pub struct DumpedDVF { - version: Version, +#[derive(Serialize, Deserialize, Debug, Clone)] +pub struct DVFSignature { + pub sig_data: Option, + pub signer: Address, +} + +#[derive(Serialize, Deserialize, Debug, Clone)] +pub struct NamedReference { + pub id: String, + pub contract_name: String, +} + +#[derive(Serialize, Deserialize, Debug, Clone)] +pub struct CompleteDVF { + pub version: Version, + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, pub contract_name: String, pub address: Address, pub chain_id: u64, @@ -361,25 +354,44 @@ pub struct DumpedDVF { pub init_block_num: u64, pub deployment_tx: String, pub codehash: String, - pub insecure: bool, + #[serde(skip_serializing_if = "Option::is_none")] + pub insecure: Option, pub immutables: Vec, pub constructor_args: Vec, pub critical_storage_variables: Vec, pub critical_events: Vec, + #[serde(skip_serializing_if = "Option::is_none")] pub expiry_in_epoch_seconds: Option, #[serde(skip_serializing_if = "Option::is_none")] + pub references: Option>, + #[serde(skip_serializing_if = "Option::is_none")] pub unvalidated_metadata: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub signature: Option, } -impl DumpedDVF { +impl CompleteDVF { + pub fn from_path(path: &Path) -> Result { + let mut file = File::open(path)?; + let mut content = String::new(); + file.read_to_string(&mut content)?; + debug!("{}", content); + + let filled: CompleteDVF = serde_json::from_str(&content)?; + filled.check_version()?; + + Ok(filled) + } + pub fn from_cli(matches: &ArgMatches) -> Result { let immutables: Vec = vec![]; let critical_storage_variables: Vec = vec![]; let critical_events: Vec = vec![]; let constructor_args: Vec = vec![]; let implementation_name = matches.get_one::("implementation").cloned(); - let dumped = DumpedDVF { + let dumped = CompleteDVF { version: CURRENT_VERSION, + id: None, contract_name: matches.get_one::("contractname").unwrap().clone(), address: *matches.get_one::
("address").unwrap(), chain_id: *matches.get_one("chainid").unwrap(), @@ -387,12 +399,13 @@ impl DumpedDVF { deployment_tx: String::new(), deployment_block_num: 0, init_block_num: 0, - insecure: false, + insecure: Some(false), immutables, constructor_args, critical_storage_variables, critical_events, expiry_in_epoch_seconds: None, + references: None, unvalidated_metadata: Some(Unvalidated { author_name: Some(String::from("Author")), description: Some(String::from("System Description")), @@ -403,15 +416,12 @@ impl DumpedDVF { implementation_name, implementation_address: None, // currently no source for this }), + signature: None, }; dumped.check_version()?; Ok(dumped) } - pub fn get_fname(&self) -> String { - format!("dumped_{:?}.dvf.json", &self.address) - } - pub fn copy_immutables(&mut self, project_info: &ProjectInfo, pretty_printer: &PrettyPrinter) { self.immutables = project_info .immutables @@ -460,66 +470,6 @@ impl DumpedDVF { }) .collect::>(); } -} - -impl BasicDVF for DumpedDVF { - fn get_version(&self) -> &Version { - &self.version - } -} - -#[derive(Serialize, Deserialize, Debug, Clone)] -pub struct DVFSignature { - pub sig_data: Option, - pub signer: Address, -} - -#[derive(Serialize, Deserialize, Debug, Clone)] -pub struct NamedReference { - pub id: String, - pub contract_name: String, -} - -#[derive(Serialize, Deserialize, Debug, Clone)] -pub struct CompleteDVF { - pub version: Version, - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - pub contract_name: String, - pub address: Address, - pub chain_id: u64, - pub deployment_block_num: u64, - pub init_block_num: u64, - pub deployment_tx: String, - pub codehash: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub insecure: Option, - pub immutables: Vec, - pub constructor_args: Vec, - pub critical_storage_variables: Vec, - pub critical_events: Vec, - #[serde(skip_serializing_if = "Option::is_none")] - pub expiry_in_epoch_seconds: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub references: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub unvalidated_metadata: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub signature: Option, -} - -impl CompleteDVF { - pub fn from_path(path: &Path) -> Result { - let mut file = File::open(path)?; - let mut content = String::new(); - file.read_to_string(&mut content)?; - debug!("{}", content); - - let filled: CompleteDVF = serde_json::from_str(&content)?; - filled.check_version()?; - - Ok(filled) - } pub fn add_reference(&mut self, new_ref_id: &str, new_ref_name: &str) { let named_ref = NamedReference { @@ -688,9 +638,26 @@ impl CompleteDVF { None => String::from("generated.dvf.json"), } } -} -impl BasicDVF for CompleteDVF { + fn check_version(&self) -> Result<(), ValidationError> { + let version = self.get_version(); + if version < &LOWEST_SUPPORTED_VERSION { + return Err(ValidationError::Error("DV Version too old.".to_string())); + } + if version > &HIGHEST_SUPPORTED_VERSION { + return Err(ValidationError::Error("DV Version too new.".to_string())); + } + Ok(()) + } + + pub fn write_to_file(&self, path: &Path) -> Result<(), ValidationError> { + let output = serde_json::to_string_pretty(&self)?; + + let mut file = File::create(path)?; + file.write_all(output.as_bytes())?; + Ok(()) + } + fn get_version(&self) -> &Version { &self.version } diff --git a/src/dvf.rs b/src/dvf.rs index 146cec50..9a83667b 100644 --- a/src/dvf.rs +++ b/src/dvf.rs @@ -14,7 +14,7 @@ use dvf_libs::bytecode_verification::compare_bytecodes::{CompareBytecode, Compar use dvf_libs::bytecode_verification::parse_json::{Environment, ProjectInfo}; use dvf_libs::bytecode_verification::verify_bytecode; use dvf_libs::dvf::config::{replace_tilde, DVFConfig}; -use dvf_libs::dvf::parse::{self, BasicDVF, ValidationError, CURRENT_VERSION_STRING}; +use dvf_libs::dvf::parse::{self, ValidationError, CURRENT_VERSION_STRING}; use dvf_libs::dvf::registry::{self, Registry}; use dvf_libs::state::contract_state::ContractState; use dvf_libs::state::forge_inspect::{self, StateVariable, TypeDescription}; @@ -998,7 +998,7 @@ fn process(matches: ArgMatches) -> Result<(), ValidationError> { user_output_path }; - let mut dumped = parse::DumpedDVF::from_cli(sub_m)?; + let mut dumped = parse::CompleteDVF::from_cli(sub_m)?; config.set_chain_id(dumped.chain_id)?; let registry = registry::Registry::from_config(&config)?; @@ -1388,6 +1388,7 @@ fn process(matches: ArgMatches) -> Result<(), ValidationError> { "{}. Decide if this validation should have an expiry date. Also you can fill in additional, unvalidated metadata.", pc ); + dumped.generate_id()?; dumped.write_to_file(output_path)?; println!("Wrote DVF to {}!", output_path.display()); exit(0); From f2015bc33a591c2df9cb93daa7958f41a34e1f35 Mon Sep 17 00:00:00 2001 From: Hubert Ritzdorf Date: Wed, 26 Mar 2025 18:57:10 +0100 Subject: [PATCH 2/5] Forgot to remove completely --- lib/dvf/parse.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/dvf/parse.rs b/lib/dvf/parse.rs index d0fb3fbb..6b689c2e 100644 --- a/lib/dvf/parse.rs +++ b/lib/dvf/parse.rs @@ -174,8 +174,6 @@ impl fmt::Display for ValidationError { } } -pub trait BasicDVF: Serialize {} - fn bytes_to_hex(bytes: &T, serializer: S) -> Result where T: AsRef<[u8]>, From 7e7063acee86a8917c6b1d2d735ee67b8df9d5cb Mon Sep 17 00:00:00 2001 From: Hubert Ritzdorf Date: Wed, 26 Mar 2025 19:57:29 +0100 Subject: [PATCH 3/5] New Testdata --- tests/expected_dvfs/AllValueTypes.dvf.json | 10 ++-- .../expected_dvfs/CrazyHiddenStruct.dvf.json | 8 ++-- tests/expected_dvfs/Deploy_0.dvf.json | 10 ++-- tests/expected_dvfs/Deploy_0_b1.dvf.json | 10 ++-- tests/expected_dvfs/Deploy_0_updated.dvf.json | 8 ++-- tests/expected_dvfs/Deploy_1.dvf.json | 10 ++-- tests/expected_dvfs/Deploy_1_b1.dvf.json | 10 ++-- tests/expected_dvfs/Deploy_1_updated.dvf.json | 8 ++-- tests/expected_dvfs/Deploy_3.dvf.json | 10 ++-- tests/expected_dvfs/Deploy_3_b1.dvf.json | 10 ++-- tests/expected_dvfs/Deploy_3_updated.dvf.json | 8 ++-- tests/expected_dvfs/Deploy_4.dvf.json | 10 ++-- tests/expected_dvfs/Deploy_4_b1.dvf.json | 10 ++-- tests/expected_dvfs/Deploy_4_updated.dvf.json | 8 ++-- tests/expected_dvfs/Deploy_5.dvf.json | 10 ++-- tests/expected_dvfs/Deploy_5_b1.dvf.json | 10 ++-- tests/expected_dvfs/Deploy_5_updated.dvf.json | 8 ++-- tests/expected_dvfs/Deploy_6_b1.dvf.json | 10 ++-- tests/expected_dvfs/Deploy_6_updated.dvf.json | 8 ++-- tests/expected_dvfs/Hardhat.dvf.json | 8 ++-- tests/expected_dvfs/HardhatUp.dvf.json | 8 ++-- tests/expected_dvfs/MyToken.dvf.json | 10 ++-- tests/expected_dvfs/PullPayment.dvf.json | 2 +- tests/expected_dvfs/PureChild.dvf.json | 10 ++-- tests/expected_dvfs/PureDeployer.dvf.json | 10 ++-- .../TransparentUpgradeableProxy.dvf.json | 12 ++--- ...79259ebcbaaed0c83eec09ca0b89a5bcc.dvf.json | 10 ++-- ...5c80eb753c815079f2b32ddefd562c3e4.dvf.json | 10 ++-- ...c0756308ac4aabfd76c05c4f3088b8883.dvf.json | 10 ++-- tests/test_end_to_end.rs | 47 +++++++++++++++++-- tests/with_metadata/foundry.toml | 1 + 31 files changed, 177 insertions(+), 137 deletions(-) diff --git a/tests/expected_dvfs/AllValueTypes.dvf.json b/tests/expected_dvfs/AllValueTypes.dvf.json index 2f937572..30f2382f 100644 --- a/tests/expected_dvfs/AllValueTypes.dvf.json +++ b/tests/expected_dvfs/AllValueTypes.dvf.json @@ -1,11 +1,12 @@ { "version": "0.9.1", + "id": "0x75b09431c899db2042cfe484d8db8442ab7d6f0c39851b8c79ec02d22b0852ca", "contract_name": "AllValueTypes", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", - "chain_id": 31337, - "deployment_block_num": 1, + "chain_id": 1337, + "deployment_block_num": 2, "init_block_num": 4, - "deployment_tx": "0x4c0eda23fa858c9ec88a7004c80c78a606561025d2d8b2c85f825957cab8fc9b", + "deployment_tx": "0xa4d8274d878bbd569325fa0f6ff44503319eea7c8f8debae356e4c4e9e4ecf2a", "codehash": "0xc5f9a009f6b4fe853fa6d949876dedd2594d797a7aa57fcf9c58031f7911dfe5", "insecure": false, "immutables": [], @@ -1722,7 +1723,6 @@ } ], "critical_events": [], - "expiry_in_epoch_seconds": null, "unvalidated_metadata": { "author_name": "Author", "description": "System Description", @@ -1734,4 +1734,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/CrazyHiddenStruct.dvf.json b/tests/expected_dvfs/CrazyHiddenStruct.dvf.json index 13f058c0..1450f2fd 100644 --- a/tests/expected_dvfs/CrazyHiddenStruct.dvf.json +++ b/tests/expected_dvfs/CrazyHiddenStruct.dvf.json @@ -1,11 +1,12 @@ { "version": "0.9.1", + "id": "0xae089608b66548be52d5d573af2f46bf32591d45b990f1945ec879c1d9fa3766", "contract_name": "CrazyHiddenStruct", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", - "chain_id": 31337, - "deployment_block_num": 1, + "chain_id": 1337, + "deployment_block_num": 2, "init_block_num": 4, - "deployment_tx": "0x63940866317040d31a0739fe1bbf6199eed3bddc5ae96e0944c00620fa3bbf60", + "deployment_tx": "0x43a6f8eca22724591b2256ccbb6969d99ccf29b120b611cbd86aeb408b51d76a", "codehash": "0xc5f9a009f6b4fe853fa6d949876dedd2594d797a7aa57fcf9c58031f7911dfe5", "insecure": false, "immutables": [], @@ -532,7 +533,6 @@ } ], "critical_events": [], - "expiry_in_epoch_seconds": null, "unvalidated_metadata": { "author_name": "Author", "description": "System Description", diff --git a/tests/expected_dvfs/Deploy_0.dvf.json b/tests/expected_dvfs/Deploy_0.dvf.json index 55b3149a..e807e925 100644 --- a/tests/expected_dvfs/Deploy_0.dvf.json +++ b/tests/expected_dvfs/Deploy_0.dvf.json @@ -1,11 +1,12 @@ { "version": "0.9.1", + "id": "0xd5c2ba6466b7c6138861f139a9c71fc2c62202a847c354eed6084bbb8fd93c0c", "contract_name": "BytesMapping", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", - "chain_id": 31337, - "deployment_block_num": 1, + "chain_id": 1337, + "deployment_block_num": 2, "init_block_num": 4, - "deployment_tx": "0x59c8b137812162541e4fdcc68f3072ce16a5ed7793565af73af88cced3ce20e6", + "deployment_tx": "0x11819f70620f7d3a7a69eee5e9ad55cedec78c9fc5a83ab743fdec42a77ab504", "codehash": "0x3867a08d0f6ad7f18a522cb18383fa3eb688bbde257d84652a614fda9167b190", "insecure": false, "immutables": [], @@ -76,7 +77,6 @@ ] } ], - "expiry_in_epoch_seconds": null, "unvalidated_metadata": { "author_name": "Author", "description": "System Description", @@ -88,4 +88,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/Deploy_0_b1.dvf.json b/tests/expected_dvfs/Deploy_0_b1.dvf.json index ae3dfd27..a492e012 100644 --- a/tests/expected_dvfs/Deploy_0_b1.dvf.json +++ b/tests/expected_dvfs/Deploy_0_b1.dvf.json @@ -1,11 +1,12 @@ { "version": "0.9.1", + "id": "0x4904d0056d9b5ffe89e7e2daeeb7134331ccc30b933f6a94f63867dc08686439", "contract_name": "BytesMapping", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", - "chain_id": 31337, - "deployment_block_num": 1, + "chain_id": 1337, + "deployment_block_num": 2, "init_block_num": 2, - "deployment_tx": "0x59c8b137812162541e4fdcc68f3072ce16a5ed7793565af73af88cced3ce20e6", + "deployment_tx": "0x11819f70620f7d3a7a69eee5e9ad55cedec78c9fc5a83ab743fdec42a77ab504", "codehash": "0x3867a08d0f6ad7f18a522cb18383fa3eb688bbde257d84652a614fda9167b190", "insecure": false, "immutables": [], @@ -51,7 +52,6 @@ "occurrences": [] } ], - "expiry_in_epoch_seconds": null, "unvalidated_metadata": { "author_name": "Author", "description": "System Description", @@ -63,4 +63,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/Deploy_0_updated.dvf.json b/tests/expected_dvfs/Deploy_0_updated.dvf.json index dd8799f6..f891bff6 100644 --- a/tests/expected_dvfs/Deploy_0_updated.dvf.json +++ b/tests/expected_dvfs/Deploy_0_updated.dvf.json @@ -2,10 +2,10 @@ "version": "0.9.1", "contract_name": "BytesMapping", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", - "chain_id": 31337, - "deployment_block_num": 1, + "chain_id": 1337, + "deployment_block_num": 2, "init_block_num": 2, - "deployment_tx": "0x59c8b137812162541e4fdcc68f3072ce16a5ed7793565af73af88cced3ce20e6", + "deployment_tx": "0x11819f70620f7d3a7a69eee5e9ad55cedec78c9fc5a83ab743fdec42a77ab504", "codehash": "0x3867a08d0f6ad7f18a522cb18383fa3eb688bbde257d84652a614fda9167b190", "insecure": false, "immutables": [], @@ -68,4 +68,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/Deploy_1.dvf.json b/tests/expected_dvfs/Deploy_1.dvf.json index 059fc2d9..ed5f5927 100644 --- a/tests/expected_dvfs/Deploy_1.dvf.json +++ b/tests/expected_dvfs/Deploy_1.dvf.json @@ -1,11 +1,12 @@ { "version": "0.9.1", + "id": "0xb0473a5acbcc746d6997b0523f4ced4dff4e55c189b2a6bffb9a05e8754dbb30", "contract_name": "StringMapping", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", - "chain_id": 31337, - "deployment_block_num": 1, + "chain_id": 1337, + "deployment_block_num": 2, "init_block_num": 4, - "deployment_tx": "0x302e304f1c19cf8fc0adf0175ae301fdbfaa7d5e0a02e49a8418af54ec6eab16", + "deployment_tx": "0xbd44492ce35b11b438be83b11fef8e1f18f3dd1f847c791083f3659d2a66885c", "codehash": "0x2feab59f98325c0ad112156daca7c79dc9e9e17c16be3e374874788370b91e02", "insecure": false, "immutables": [], @@ -126,7 +127,6 @@ ] } ], - "expiry_in_epoch_seconds": null, "unvalidated_metadata": { "author_name": "Author", "description": "System Description", @@ -138,4 +138,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/Deploy_1_b1.dvf.json b/tests/expected_dvfs/Deploy_1_b1.dvf.json index e03bfc15..8fb2ee11 100644 --- a/tests/expected_dvfs/Deploy_1_b1.dvf.json +++ b/tests/expected_dvfs/Deploy_1_b1.dvf.json @@ -1,11 +1,12 @@ { "version": "0.9.1", + "id": "0x7ed8ac4896d783d244402fe86b3b34a0bb870379a825d468efc1dd09363c33d6", "contract_name": "StringMapping", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", - "chain_id": 31337, - "deployment_block_num": 1, + "chain_id": 1337, + "deployment_block_num": 2, "init_block_num": 2, - "deployment_tx": "0x302e304f1c19cf8fc0adf0175ae301fdbfaa7d5e0a02e49a8418af54ec6eab16", + "deployment_tx": "0xbd44492ce35b11b438be83b11fef8e1f18f3dd1f847c791083f3659d2a66885c", "codehash": "0x2feab59f98325c0ad112156daca7c79dc9e9e17c16be3e374874788370b91e02", "insecure": false, "immutables": [], @@ -90,7 +91,6 @@ ] } ], - "expiry_in_epoch_seconds": null, "unvalidated_metadata": { "author_name": "Author", "description": "System Description", @@ -102,4 +102,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/Deploy_1_updated.dvf.json b/tests/expected_dvfs/Deploy_1_updated.dvf.json index 083609e3..ee6f1369 100644 --- a/tests/expected_dvfs/Deploy_1_updated.dvf.json +++ b/tests/expected_dvfs/Deploy_1_updated.dvf.json @@ -2,10 +2,10 @@ "version": "0.9.1", "contract_name": "StringMapping", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", - "chain_id": 31337, - "deployment_block_num": 1, + "chain_id": 1337, + "deployment_block_num": 2, "init_block_num": 2, - "deployment_tx": "0x302e304f1c19cf8fc0adf0175ae301fdbfaa7d5e0a02e49a8418af54ec6eab16", + "deployment_tx": "0xbd44492ce35b11b438be83b11fef8e1f18f3dd1f847c791083f3659d2a66885c", "codehash": "0x2feab59f98325c0ad112156daca7c79dc9e9e17c16be3e374874788370b91e02", "insecure": false, "immutables": [], @@ -100,4 +100,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/Deploy_3.dvf.json b/tests/expected_dvfs/Deploy_3.dvf.json index 182004da..4d7563eb 100644 --- a/tests/expected_dvfs/Deploy_3.dvf.json +++ b/tests/expected_dvfs/Deploy_3.dvf.json @@ -1,11 +1,12 @@ { "version": "0.9.1", + "id": "0x171bad4cf0641e22ba9e207f32e7d5e6ffbe7eac9f38ecea1f5f634f5ff90ed3", "contract_name": "StructInEvent", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", - "chain_id": 31337, - "deployment_block_num": 1, + "chain_id": 1337, + "deployment_block_num": 2, "init_block_num": 4, - "deployment_tx": "0xab14e75869d39a0e11bdbb2f3e1f06ddfc44e60caf73f1f74f12cd91c5ae76a5", + "deployment_tx": "0x6e3482192028814aaf7d25796faf2cae5dc51e34f8cab42633f330b6b76e35b7", "codehash": "0x5948787aac497637d2b6ede7bb077e2b1a14822d661e2fcf5cee4b79c4a81898", "insecure": false, "immutables": [], @@ -133,7 +134,6 @@ ] } ], - "expiry_in_epoch_seconds": null, "unvalidated_metadata": { "author_name": "Author", "description": "System Description", @@ -145,4 +145,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/Deploy_3_b1.dvf.json b/tests/expected_dvfs/Deploy_3_b1.dvf.json index f40d93c5..25bd3b49 100644 --- a/tests/expected_dvfs/Deploy_3_b1.dvf.json +++ b/tests/expected_dvfs/Deploy_3_b1.dvf.json @@ -1,11 +1,12 @@ { "version": "0.9.1", + "id": "0x07ad6b97283894cd7a05a9a4c03810a93b2ee455e62fe2410c3f46eb087f2e75", "contract_name": "StructInEvent", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", - "chain_id": 31337, - "deployment_block_num": 1, + "chain_id": 1337, + "deployment_block_num": 2, "init_block_num": 2, - "deployment_tx": "0xab14e75869d39a0e11bdbb2f3e1f06ddfc44e60caf73f1f74f12cd91c5ae76a5", + "deployment_tx": "0x6e3482192028814aaf7d25796faf2cae5dc51e34f8cab42633f330b6b76e35b7", "codehash": "0x5948787aac497637d2b6ede7bb077e2b1a14822d661e2fcf5cee4b79c4a81898", "insecure": false, "immutables": [], @@ -120,7 +121,6 @@ ] } ], - "expiry_in_epoch_seconds": null, "unvalidated_metadata": { "author_name": "Author", "description": "System Description", @@ -132,4 +132,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/Deploy_3_updated.dvf.json b/tests/expected_dvfs/Deploy_3_updated.dvf.json index e7e48d74..8c17ce26 100644 --- a/tests/expected_dvfs/Deploy_3_updated.dvf.json +++ b/tests/expected_dvfs/Deploy_3_updated.dvf.json @@ -2,10 +2,10 @@ "version": "0.9.1", "contract_name": "StructInEvent", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", - "chain_id": 31337, - "deployment_block_num": 1, + "chain_id": 1337, + "deployment_block_num": 2, "init_block_num": 2, - "deployment_tx": "0xab14e75869d39a0e11bdbb2f3e1f06ddfc44e60caf73f1f74f12cd91c5ae76a5", + "deployment_tx": "0x6e3482192028814aaf7d25796faf2cae5dc51e34f8cab42633f330b6b76e35b7", "codehash": "0x5948787aac497637d2b6ede7bb077e2b1a14822d661e2fcf5cee4b79c4a81898", "insecure": false, "immutables": [], @@ -141,4 +141,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/Deploy_4.dvf.json b/tests/expected_dvfs/Deploy_4.dvf.json index d6dc1570..8218b278 100644 --- a/tests/expected_dvfs/Deploy_4.dvf.json +++ b/tests/expected_dvfs/Deploy_4.dvf.json @@ -1,11 +1,12 @@ { "version": "0.9.1", + "id": "0xe37bdbff0b3eea9634d6aff5274d01a99a62abff6e538f229d00b87d8d8e953e", "contract_name": "StaticArrayOfDynamicArray", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", - "chain_id": 31337, - "deployment_block_num": 1, + "chain_id": 1337, + "deployment_block_num": 2, "init_block_num": 4, - "deployment_tx": "0xf987d47264d6e2686af932d2349402b3884dd378a8ee8735e8c7721b5005cebb", + "deployment_tx": "0xadab5cbca15f98f7c62e8df8db128ce822850fff911257a17abdda387b84865b", "codehash": "0x98440240f09ca68357ad2941cc60206b89121be940ac906c18d730f0ece6f380", "insecure": false, "immutables": [], @@ -183,7 +184,6 @@ ] } ], - "expiry_in_epoch_seconds": null, "unvalidated_metadata": { "author_name": "Author", "description": "System Description", @@ -195,4 +195,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/Deploy_4_b1.dvf.json b/tests/expected_dvfs/Deploy_4_b1.dvf.json index 38f24737..651b5f94 100644 --- a/tests/expected_dvfs/Deploy_4_b1.dvf.json +++ b/tests/expected_dvfs/Deploy_4_b1.dvf.json @@ -1,11 +1,12 @@ { "version": "0.9.1", + "id": "0x92f80b3e4d61b30c63e56f1521ddc7b9f834d10af244ffe84679ea8e3bc25ab1", "contract_name": "StaticArrayOfDynamicArray", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", - "chain_id": 31337, - "deployment_block_num": 1, + "chain_id": 1337, + "deployment_block_num": 2, "init_block_num": 2, - "deployment_tx": "0xf987d47264d6e2686af932d2349402b3884dd378a8ee8735e8c7721b5005cebb", + "deployment_tx": "0xadab5cbca15f98f7c62e8df8db128ce822850fff911257a17abdda387b84865b", "codehash": "0x98440240f09ca68357ad2941cc60206b89121be940ac906c18d730f0ece6f380", "insecure": false, "immutables": [], @@ -152,7 +153,6 @@ "occurrences": [] } ], - "expiry_in_epoch_seconds": null, "unvalidated_metadata": { "author_name": "Author", "description": "System Description", @@ -164,4 +164,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/Deploy_4_updated.dvf.json b/tests/expected_dvfs/Deploy_4_updated.dvf.json index bc4ba281..e924852c 100644 --- a/tests/expected_dvfs/Deploy_4_updated.dvf.json +++ b/tests/expected_dvfs/Deploy_4_updated.dvf.json @@ -2,10 +2,10 @@ "version": "0.9.1", "contract_name": "StaticArrayOfDynamicArray", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", - "chain_id": 31337, - "deployment_block_num": 1, + "chain_id": 1337, + "deployment_block_num": 2, "init_block_num": 2, - "deployment_tx": "0xf987d47264d6e2686af932d2349402b3884dd378a8ee8735e8c7721b5005cebb", + "deployment_tx": "0xadab5cbca15f98f7c62e8df8db128ce822850fff911257a17abdda387b84865b", "codehash": "0x98440240f09ca68357ad2941cc60206b89121be940ac906c18d730f0ece6f380", "insecure": false, "immutables": [], @@ -175,4 +175,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/Deploy_5.dvf.json b/tests/expected_dvfs/Deploy_5.dvf.json index edd01218..717131b2 100644 --- a/tests/expected_dvfs/Deploy_5.dvf.json +++ b/tests/expected_dvfs/Deploy_5.dvf.json @@ -1,11 +1,12 @@ { "version": "0.9.1", + "id": "0xab820566741872653419027b78e012baf4cc8e55d118261e5fde607565208093", "contract_name": "NestedMapping", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", - "chain_id": 31337, - "deployment_block_num": 1, + "chain_id": 1337, + "deployment_block_num": 2, "init_block_num": 4, - "deployment_tx": "0x50bb38f92b0019a4223dec8daa2fbece6c15ee663038cbc3d49ee01d475aeb03", + "deployment_tx": "0xfea37b5686071d5db4b35ab845ad14dfec1cfb370d5a524f517b29ae3d9de17e", "codehash": "0xb90589f7f813485c98adfbd6f20b54f4a3a71dfe251e7794215f347c2c34f120", "insecure": false, "immutables": [], @@ -73,7 +74,6 @@ } ], "critical_events": [], - "expiry_in_epoch_seconds": null, "unvalidated_metadata": { "author_name": "Author", "description": "System Description", @@ -85,4 +85,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/Deploy_5_b1.dvf.json b/tests/expected_dvfs/Deploy_5_b1.dvf.json index ccd3ebf1..cd62d76f 100644 --- a/tests/expected_dvfs/Deploy_5_b1.dvf.json +++ b/tests/expected_dvfs/Deploy_5_b1.dvf.json @@ -1,11 +1,12 @@ { "version": "0.9.1", + "id": "0x227ece469fe8344f2e7477ffce9a86069527c5396cf42830c356186d8cc351bb", "contract_name": "NestedMapping", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", - "chain_id": 31337, - "deployment_block_num": 1, + "chain_id": 1337, + "deployment_block_num": 2, "init_block_num": 2, - "deployment_tx": "0x50bb38f92b0019a4223dec8daa2fbece6c15ee663038cbc3d49ee01d475aeb03", + "deployment_tx": "0xfea37b5686071d5db4b35ab845ad14dfec1cfb370d5a524f517b29ae3d9de17e", "codehash": "0xb90589f7f813485c98adfbd6f20b54f4a3a71dfe251e7794215f347c2c34f120", "insecure": false, "immutables": [], @@ -46,7 +47,6 @@ } ], "critical_events": [], - "expiry_in_epoch_seconds": null, "unvalidated_metadata": { "author_name": "Author", "description": "System Description", @@ -58,4 +58,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/Deploy_5_updated.dvf.json b/tests/expected_dvfs/Deploy_5_updated.dvf.json index 64204e32..72cf0950 100644 --- a/tests/expected_dvfs/Deploy_5_updated.dvf.json +++ b/tests/expected_dvfs/Deploy_5_updated.dvf.json @@ -2,10 +2,10 @@ "version": "0.9.1", "contract_name": "NestedMapping", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", - "chain_id": 31337, - "deployment_block_num": 1, + "chain_id": 1337, + "deployment_block_num": 2, "init_block_num": 2, - "deployment_tx": "0x50bb38f92b0019a4223dec8daa2fbece6c15ee663038cbc3d49ee01d475aeb03", + "deployment_tx": "0xfea37b5686071d5db4b35ab845ad14dfec1cfb370d5a524f517b29ae3d9de17e", "codehash": "0xb90589f7f813485c98adfbd6f20b54f4a3a71dfe251e7794215f347c2c34f120", "insecure": false, "immutables": [], @@ -57,4 +57,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/Deploy_6_b1.dvf.json b/tests/expected_dvfs/Deploy_6_b1.dvf.json index f5d23e25..98366acd 100644 --- a/tests/expected_dvfs/Deploy_6_b1.dvf.json +++ b/tests/expected_dvfs/Deploy_6_b1.dvf.json @@ -1,11 +1,12 @@ { "version": "0.9.1", + "id": "0xe016ec69d1cacfc3dc7fefe45acc11fb2b7af643cc478299329be5e80b9f2223", "contract_name": "Enum", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", - "chain_id": 31337, - "deployment_block_num": 1, + "chain_id": 1337, + "deployment_block_num": 2, "init_block_num": 2, - "deployment_tx": "0x5372999234f0c2ffdfaf3cf73831ee3d851f3e4a261f368b8d36c3a7c09b94a1", + "deployment_tx": "0x9d0a8a19c51cc9c5ce1a8a6b93e180994893fe4991fca5c4f0777b0dc6718395", "codehash": "0xaa85798b7052600bb0e89b6f6d2961d857c6838df3e7a653e5f6bba624ff20a5", "insecure": false, "immutables": [], @@ -45,7 +46,6 @@ } ], "critical_events": [], - "expiry_in_epoch_seconds": null, "unvalidated_metadata": { "author_name": "Author", "description": "System Description", @@ -57,4 +57,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/Deploy_6_updated.dvf.json b/tests/expected_dvfs/Deploy_6_updated.dvf.json index be3ca47c..a077d24b 100644 --- a/tests/expected_dvfs/Deploy_6_updated.dvf.json +++ b/tests/expected_dvfs/Deploy_6_updated.dvf.json @@ -2,10 +2,10 @@ "version": "0.9.1", "contract_name": "Enum", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", - "chain_id": 31337, - "deployment_block_num": 1, + "chain_id": 1337, + "deployment_block_num": 2, "init_block_num": 2, - "deployment_tx": "0x5372999234f0c2ffdfaf3cf73831ee3d851f3e4a261f368b8d36c3a7c09b94a1", + "deployment_tx": "0x9d0a8a19c51cc9c5ce1a8a6b93e180994893fe4991fca5c4f0777b0dc6718395", "codehash": "0xaa85798b7052600bb0e89b6f6d2961d857c6838df3e7a653e5f6bba624ff20a5", "insecure": false, "immutables": [], @@ -56,4 +56,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/Hardhat.dvf.json b/tests/expected_dvfs/Hardhat.dvf.json index f5200898..4e08351f 100644 --- a/tests/expected_dvfs/Hardhat.dvf.json +++ b/tests/expected_dvfs/Hardhat.dvf.json @@ -1,11 +1,12 @@ { "version": "0.9.1", + "id": "0x6ed973cd9102a7ae9411dadb18136715f45be470673477da3f18133c0e11af7d", "contract_name": "Hardhat", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", - "chain_id": 31337, - "deployment_block_num": 1, + "chain_id": 1337, + "deployment_block_num": 2, "init_block_num": 2, - "deployment_tx": "0x30ed560dda15ef4ebc622204085ec569a421b71c76c86ce66ac784fe5f7ef16e", + "deployment_tx": "0xb264412cc8abfe95406a4b6ae5d76c4ce6ab0697433ce4de2c98d73bd3c85510", "codehash": "0xbce107a9a9e3b91927625e76119fa0960066f24f9c9962b9c892d3991dbace2c", "insecure": false, "immutables": [], @@ -63,7 +64,6 @@ ] } ], - "expiry_in_epoch_seconds": null, "unvalidated_metadata": { "author_name": "Author", "description": "System Description", diff --git a/tests/expected_dvfs/HardhatUp.dvf.json b/tests/expected_dvfs/HardhatUp.dvf.json index a13a414c..ae0c9f5d 100644 --- a/tests/expected_dvfs/HardhatUp.dvf.json +++ b/tests/expected_dvfs/HardhatUp.dvf.json @@ -1,11 +1,12 @@ { "version": "0.9.1", + "id": "0xf022962b5e00eff4c06c71b712da1913c170d4bcf465a0ec0ebf01a20d556555", "contract_name": "HardhatUp", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", - "chain_id": 31337, - "deployment_block_num": 1, + "chain_id": 1337, + "deployment_block_num": 2, "init_block_num": 2, - "deployment_tx": "0xa673888f2bbbf84718493f2803ee98c43328880010376b9bf46eb3c9ca452b63", + "deployment_tx": "0x9a8f6be15880eb4aac68dae3abc72794e64a8d2cc18f2600eebbdf8393176e7e", "codehash": "0xaef83c18cc20c535cf14be2c96be668cb67e7aee22d6bfe88db894bf8e3536bb", "insecure": false, "immutables": [], @@ -92,7 +93,6 @@ ] } ], - "expiry_in_epoch_seconds": null, "unvalidated_metadata": { "author_name": "Author", "description": "System Description", diff --git a/tests/expected_dvfs/MyToken.dvf.json b/tests/expected_dvfs/MyToken.dvf.json index c127a97a..cff3eb6f 100644 --- a/tests/expected_dvfs/MyToken.dvf.json +++ b/tests/expected_dvfs/MyToken.dvf.json @@ -1,11 +1,12 @@ { "version": "0.9.1", + "id": "0xf61ad87d043243f3bbc2408dcf2fcbff03999e4978592d31409eece5410f17a7", "contract_name": "MyToken", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", - "chain_id": 31337, - "deployment_block_num": 1, + "chain_id": 1337, + "deployment_block_num": 2, "init_block_num": 3, - "deployment_tx": "0x378c3abf73ec6e2517b843e52c858a21b54b87a476b837053b0c1619a8d5d92f", + "deployment_tx": "0x42d8e1a6dc338ecb42716c59dce82a58e56c067dff2a20975f28e05970e89400", "codehash": "0xa77e382f36db7714068fa97e6bc080fbc6b04a900a3199ab1aba56c9dea88f4d", "insecure": false, "immutables": [ @@ -849,7 +850,6 @@ "occurrences": [] } ], - "expiry_in_epoch_seconds": null, "unvalidated_metadata": { "author_name": "Author", "description": "System Description", @@ -861,4 +861,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/PullPayment.dvf.json b/tests/expected_dvfs/PullPayment.dvf.json index 8e586ea1..140d59ef 100644 --- a/tests/expected_dvfs/PullPayment.dvf.json +++ b/tests/expected_dvfs/PullPayment.dvf.json @@ -1,5 +1,6 @@ { "version": "0.9.1", + "id": "0x1f9085f7983793563f4d835b22704a4ef2e543a792c2d2c38a74306605892aab", "contract_name": "PullPayment", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", "chain_id": 31337, @@ -26,7 +27,6 @@ } ], "critical_events": [], - "expiry_in_epoch_seconds": null, "unvalidated_metadata": { "author_name": "Author", "description": "System Description", diff --git a/tests/expected_dvfs/PureChild.dvf.json b/tests/expected_dvfs/PureChild.dvf.json index 4a215e5a..88d5a01b 100644 --- a/tests/expected_dvfs/PureChild.dvf.json +++ b/tests/expected_dvfs/PureChild.dvf.json @@ -1,12 +1,13 @@ { "version": "0.9.1", + "id": "0xe3af1644de7c8d3e9cde8f4fbba500b7eb3d88034d557a8e4966cc6602397b5d", "contract_name": "PureChild", "address": "0xa16e02e87b7454126e5e10d957a927a7f5b5d2be", - "chain_id": 31337, - "deployment_block_num": 1, + "chain_id": 1337, + "deployment_block_num": 2, "init_block_num": 3, - "deployment_tx": "0x6eb47896d68f12f29c9ccbedac5ff3490195cb9d47606d2ff3db92c9093e5b80", - "codehash": "0xc5eec0d383cb629c5a5259e04cc18b18293b04ce07dc5fca488e7edb3bc8e007", + "deployment_tx": "0xc3f03c210e501eaca1459141ce84bb36675ca2a1cc28d6d716c9794d2b9d4e88", + "codehash": "0x58f7c91b706c7b2e5694cdb86ba16504d4d8851df9522b29299fe8bb95403d57", "insecure": false, "immutables": [], "constructor_args": [], @@ -40,7 +41,6 @@ } ], "critical_events": [], - "expiry_in_epoch_seconds": null, "unvalidated_metadata": { "author_name": "Author", "description": "System Description", diff --git a/tests/expected_dvfs/PureDeployer.dvf.json b/tests/expected_dvfs/PureDeployer.dvf.json index 50c07088..83b64af6 100644 --- a/tests/expected_dvfs/PureDeployer.dvf.json +++ b/tests/expected_dvfs/PureDeployer.dvf.json @@ -1,12 +1,13 @@ { "version": "0.9.1", + "id": "0x4cc83924a541f52063cc5cf4e9302b92467d67e6fad32c23b5bfbbc3c3df557a", "contract_name": "PureDeployer", "address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", - "chain_id": 31337, - "deployment_block_num": 1, + "chain_id": 1337, + "deployment_block_num": 2, "init_block_num": 3, - "deployment_tx": "0x6eb47896d68f12f29c9ccbedac5ff3490195cb9d47606d2ff3db92c9093e5b80", - "codehash": "0xb4bd419689374d181bf6d99bfe21966c11dbb528a6714672ada87bc05cd66e24", + "deployment_tx": "0xc3f03c210e501eaca1459141ce84bb36675ca2a1cc28d6d716c9794d2b9d4e88", + "codehash": "0xaf3123d8bc1c73c93f3c9b0176b44bd11c0db94032b5a1326f28b7ce6967a06b", "insecure": false, "immutables": [], "constructor_args": [], @@ -21,7 +22,6 @@ } ], "critical_events": [], - "expiry_in_epoch_seconds": null, "unvalidated_metadata": { "author_name": "Author", "description": "System Description", diff --git a/tests/expected_dvfs/TransparentUpgradeableProxy.dvf.json b/tests/expected_dvfs/TransparentUpgradeableProxy.dvf.json index cbddccd2..f6827ece 100644 --- a/tests/expected_dvfs/TransparentUpgradeableProxy.dvf.json +++ b/tests/expected_dvfs/TransparentUpgradeableProxy.dvf.json @@ -1,12 +1,13 @@ { "version": "0.9.1", + "id": "0x67500690126beab1e3bbd362947503f5ddd17142dfecd966f3c03e012bad60eb", "contract_name": "TransparentUpgradeableProxy", "address": "0xe7f1725e7734ce288f8367e1bb143e90bb3f0512", - "chain_id": 31337, - "deployment_block_num": 2, + "chain_id": 1337, + "deployment_block_num": 3, "init_block_num": 3, - "deployment_tx": "0x30d3bb8f5b22cab0ec6643f7bcbd69a3d2ead0af29e9cd28a2a583e3c3ad4efd", - "codehash": "0x39882c05f46981e5d43622ad2aa327df73cfad4fd1eb9fd85caece0871f8f84c", + "deployment_tx": "0x24811768184c2a69ffecf63c4906d6153da730faf384eadf8ebe738be3b96576", + "codehash": "0x07a3f582ceb15f50e21a238db7f4aab8320b4fac8d78379d05feaf2721f139b1", "insecure": false, "immutables": [ { @@ -919,7 +920,6 @@ ] } ], - "expiry_in_epoch_seconds": null, "unvalidated_metadata": { "author_name": "Author", "description": "System Description", @@ -932,4 +932,4 @@ "security_contact": "security@example.org", "implementation_name": "MyToken" } -} +} \ No newline at end of file diff --git a/tests/expected_dvfs/WorkingChild_0x603e1bd79259ebcbaaed0c83eec09ca0b89a5bcc.dvf.json b/tests/expected_dvfs/WorkingChild_0x603e1bd79259ebcbaaed0c83eec09ca0b89a5bcc.dvf.json index 826689d1..1ccbebfb 100644 --- a/tests/expected_dvfs/WorkingChild_0x603e1bd79259ebcbaaed0c83eec09ca0b89a5bcc.dvf.json +++ b/tests/expected_dvfs/WorkingChild_0x603e1bd79259ebcbaaed0c83eec09ca0b89a5bcc.dvf.json @@ -1,11 +1,12 @@ { "version": "0.9.1", + "id": "0x59adbe3a0d423dcf41595b0927a0341726c524b8669bd81756042f5f8b80df7b", "contract_name": "WorkingChild", "address": "0x603e1bd79259ebcbaaed0c83eec09ca0b89a5bcc", - "chain_id": 31337, - "deployment_block_num": 2, + "chain_id": 1337, + "deployment_block_num": 3, "init_block_num": 5, - "deployment_tx": "0x6769005f064ca38f7f6eb8c3c732952827ae8305645de1aa187d406574088224", + "deployment_tx": "0x549259ca8f7c354bcd0c6461a7c308fdc9003fc7eeb7883b01364c64965aa5e5", "codehash": "0xa7c8a24c66b8f0e45eaa82bab7cd8615df1fa218f6a7bb9a89981581d3654658", "insecure": false, "immutables": [], @@ -40,7 +41,6 @@ } ], "critical_events": [], - "expiry_in_epoch_seconds": null, "unvalidated_metadata": { "author_name": "Author", "description": "System Description", @@ -52,4 +52,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/WorkingChild_0x9cfa6d15c80eb753c815079f2b32ddefd562c3e4.dvf.json b/tests/expected_dvfs/WorkingChild_0x9cfa6d15c80eb753c815079f2b32ddefd562c3e4.dvf.json index 34e3e868..b7591bb4 100644 --- a/tests/expected_dvfs/WorkingChild_0x9cfa6d15c80eb753c815079f2b32ddefd562c3e4.dvf.json +++ b/tests/expected_dvfs/WorkingChild_0x9cfa6d15c80eb753c815079f2b32ddefd562c3e4.dvf.json @@ -1,11 +1,12 @@ { "version": "0.9.1", + "id": "0x8ccaada6bd4f4b4f0d9dfdfecbcfa989904c5ab8e62f7dcdcb3a8504c791669d", "contract_name": "WorkingChild", "address": "0x9cfa6d15c80eb753c815079f2b32ddefd562c3e4", - "chain_id": 31337, - "deployment_block_num": 3, + "chain_id": 1337, + "deployment_block_num": 4, "init_block_num": 5, - "deployment_tx": "0x806e4d4bd119db054722e208bea7693052e4956b5fdcee2718c05c033b4bc850", + "deployment_tx": "0xb904722d527d3153851dae57a93a55d2c86e774cd6fb611246b0e5d8462947e3", "codehash": "0xa7c8a24c66b8f0e45eaa82bab7cd8615df1fa218f6a7bb9a89981581d3654658", "insecure": false, "immutables": [], @@ -40,7 +41,6 @@ } ], "critical_events": [], - "expiry_in_epoch_seconds": null, "unvalidated_metadata": { "author_name": "Author", "description": "System Description", @@ -52,4 +52,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/WorkingChild_0xeebe00ac0756308ac4aabfd76c05c4f3088b8883.dvf.json b/tests/expected_dvfs/WorkingChild_0xeebe00ac0756308ac4aabfd76c05c4f3088b8883.dvf.json index c4d1064e..180fe794 100644 --- a/tests/expected_dvfs/WorkingChild_0xeebe00ac0756308ac4aabfd76c05c4f3088b8883.dvf.json +++ b/tests/expected_dvfs/WorkingChild_0xeebe00ac0756308ac4aabfd76c05c4f3088b8883.dvf.json @@ -1,11 +1,12 @@ { "version": "0.9.1", + "id": "0x3633b5b0a7e77f20e60b72d3f94a128866052e3e751c314cb44f2496a5669b64", "contract_name": "WorkingChild", "address": "0xeebe00ac0756308ac4aabfd76c05c4f3088b8883", - "chain_id": 31337, - "deployment_block_num": 1, + "chain_id": 1337, + "deployment_block_num": 2, "init_block_num": 5, - "deployment_tx": "0xc62230d0039dbc1728f5a8e5eae93710c5cd747fce917eb5d06c11ae8bf5e573", + "deployment_tx": "0x99e86a436005f8e212adda98b38bcf8da549a4f934b56c773324d0f52eaa8172", "codehash": "0xa7c8a24c66b8f0e45eaa82bab7cd8615df1fa218f6a7bb9a89981581d3654658", "insecure": false, "immutables": [], @@ -40,7 +41,6 @@ } ], "critical_events": [], - "expiry_in_epoch_seconds": null, "unvalidated_metadata": { "author_name": "Author", "description": "System Description", @@ -52,4 +52,4 @@ "source_url": "https://github.com/source/code", "security_contact": "security@example.org" } -} +} \ No newline at end of file diff --git a/tests/test_end_to_end.rs b/tests/test_end_to_end.rs index 955f1258..ae5a85d8 100644 --- a/tests/test_end_to_end.rs +++ b/tests/test_end_to_end.rs @@ -394,6 +394,9 @@ mod tests { .success(); println!("{}", &String::from_utf8_lossy(&assert.get_output().stdout)); + // Uncomment to regenerate expected files + // std::fs::copy(outfile.path(), Path::new(&testcase.expected)).unwrap(); + assert_eq_files( &outfile.path(), &Path::new(&testcase.expected), @@ -445,6 +448,10 @@ mod tests { println!("{}", &String::from_utf8_lossy(&assert.get_output().stdout)); let updated_path = format!("{}_updated.dvf.json", outfile.path().to_string_lossy()); + + // Uncomment to regenerate expected files + // std::fs::copy(Path::new(&updated_path), Path::new(&testcase.updated)).unwrap(); + assert_eq_files( &Path::new(&updated_path), &Path::new(&testcase.updated), @@ -640,6 +647,15 @@ mod tests { .success(); println!("{}", &String::from_utf8_lossy(&assert.get_output().stdout)); + // Uncomment to regenerate expected files + /* + std::fs::copy( + outfile.path(), + Path::new("tests/expected_dvfs/MyToken.dvf.json"), + ) + .unwrap(); + */ + assert_eq_files( &outfile.path(), &Path::new("tests/expected_dvfs/MyToken.dvf.json"), @@ -692,6 +708,15 @@ mod tests { .success(); println!("{}", &String::from_utf8_lossy(&assert.get_output().stdout)); + // Uncomment to regenerate expected files + /* + std::fs::copy( + proxy_outfile.path(), + Path::new("tests/expected_dvfs/TransparentUpgradeableProxy.dvf.json"), + ) + .unwrap(); + */ + // @note that this fails, since the wrong name is stored in the registry assert_eq_files( &proxy_outfile.path(), @@ -851,6 +876,9 @@ mod tests { .success(); println!("{}", &String::from_utf8_lossy(&assert.get_output().stdout)); + // Uncomment to regenerate expected files + // std::fs::copy(outfile.path(), Path::new(&testcase.expected)).unwrap(); + assert_eq_files( &outfile.path(), &Path::new(&testcase.expected), @@ -1116,12 +1144,17 @@ mod tests { // Remove the extra byte again truncate_last_byte(src_name); + let new_fname = &format!( + "tests/expected_dvfs/WorkingChild_{}.dvf.json", + deployed_address + ); + + // Uncomment to regenerate expected files + // std::fs::copy(child_outfile.path(), Path::new(new_fname)).unwrap(); + assert_eq_files( &child_outfile.path(), - &Path::new(&format!( - "tests/expected_dvfs/WorkingChild_{}.dvf.json", - deployed_address - )), + &Path::new(new_fname), client_type.clone(), ) .unwrap(); @@ -1233,6 +1266,9 @@ mod tests { // Remove the extra byte again truncate_last_byte(src_name); + // Uncomment to regenerate expected files + // std::fs::copy(factory_outfile.path(), Path::new(dvf_path)).unwrap(); + assert_eq_files( &factory_outfile.path(), &Path::new(dvf_path), @@ -1538,6 +1574,9 @@ mod tests { .success(); println!("{}", &String::from_utf8_lossy(&assert.get_output().stdout)); + // Uncomment to regenerate expected files + // std::fs::copy(outfile.path(), Path::new(&testcase.expected)).unwrap(); + assert_eq_files( &outfile.path(), &Path::new(&testcase.expected), diff --git a/tests/with_metadata/foundry.toml b/tests/with_metadata/foundry.toml index 960ce960..480b617c 100644 --- a/tests/with_metadata/foundry.toml +++ b/tests/with_metadata/foundry.toml @@ -4,5 +4,6 @@ out = "out" libs = ["lib"] bytecode_hash = "ipfs" solc_version = "0.8.12" +optimizer = false # See more config options https://github.com/foundry-rs/foundry/tree/master/config From be1666d458f16de161d6ebae487285ccb425df1d Mon Sep 17 00:00:00 2001 From: Stefan Effenberger Date: Wed, 30 Apr 2025 17:16:46 +0200 Subject: [PATCH 4/5] updated readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1f3a8254..61dd17d4 100644 --- a/README.md +++ b/README.md @@ -244,7 +244,7 @@ When the DVF is finished, you can sign it using the following command: dv sign new.dvf.json ``` -If you do not wish to sign the DVF, you can instead finalize it by generating an ID: +DVFs automatically get an ID when they are created. When you change the contents of the DVF, the ID has to be regenerated. When signing, this is automatically done. However, in some circumstances, you might not want to sign the DVF. In that case, you can regenerate the ID as follows: ``` dv id new.dvf.json From 80452dfe538615a86c3986af208533cf684d3d55 Mon Sep 17 00:00:00 2001 From: Stefan Effenberger Date: Mon, 12 May 2025 13:24:21 +0200 Subject: [PATCH 5/5] fix for new foundry version --- src/fetch.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/fetch.rs b/src/fetch.rs index 129d55f7..db554230 100644 --- a/src/fetch.rs +++ b/src/fetch.rs @@ -298,7 +298,6 @@ fn fetch(matches: &ArgMatches) -> Result<(), ValidationError> { let forge_init_out = Command::new("forge") .current_dir(foundry_path) .arg("init") - .arg("--no-commit") .output() .unwrap(); if !forge_init_out.status.success() {