From b052428df970fb03444f4de1ae9d214f670ab11a Mon Sep 17 00:00:00 2001 From: Johann Date: Tue, 8 Mar 2022 17:55:37 -0700 Subject: [PATCH] ABI replacement working? --- ethers-solc/src/artifact_output/mod.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ethers-solc/src/artifact_output/mod.rs b/ethers-solc/src/artifact_output/mod.rs index 759b4ec5..fb9dc430 100644 --- a/ethers-solc/src/artifact_output/mod.rs +++ b/ethers-solc/src/artifact_output/mod.rs @@ -320,7 +320,7 @@ where } fn replace_abi(self, new_abi: Option) { - let artifact = self.into_compact_contract(); + let mut artifact = self.into_compact_contract(); artifact.abi = new_abi; } @@ -571,7 +571,13 @@ pub trait ArtifactOutput { //get the artifact file from the entry let artifact_file = &_entries.get(&artifact_tuple.0).unwrap()[0]; //inject the abi into the yul artifact - let abi = &artifact_file.clone().artifact.into_inner(); + + let mut temp_yul_artifact = + &self.contract_to_artifact(&yul_target_path, &artifact_tuple.0, artifact_tuple.1); + + let new_yul_abi = temp_yul_artifact.clone().into_inner().0; + + let abi = &artifact_file.clone().artifact.replace_abi(new_yul_abi); println!("{:?}", artifact_file); println!("{:?}", abi);