@@ -38,8 +38,9 @@ pub fn collect_preprocessor_data(
3838 continue ;
3939 }
4040
41- let contract_data = ContractData :: new ( hir, contract, path, source, sess. source_map ( ) ) ;
42- data. insert ( contract_data. hir_id , contract_data) ;
41+ let contract_data =
42+ ContractData :: new ( hir, contract_id, contract, path, source, sess. source_map ( ) ) ;
43+ data. insert ( contract_id, contract_data) ;
4344 }
4445 data
4546}
@@ -49,9 +50,9 @@ pub fn collect_preprocessor_data(
4950/// See [`ContractData::build_helper`] for more details.
5051pub fn create_deploy_helpers ( data : & BTreeMap < u32 , ContractData > ) -> Sources {
5152 let mut deploy_helpers = Sources :: new ( ) ;
52- for ( hir_id , contract) in data {
53+ for ( contract_id , contract) in data {
5354 if let Some ( code) = contract. build_helper ( ) {
54- let path = format ! ( "foundry-pp/DeployHelper{hir_id }.sol" ) ;
55+ let path = format ! ( "foundry-pp/DeployHelper{contract_id }.sol" ) ;
5556 deploy_helpers. insert ( path. into ( ) , Source :: new ( code) ) ;
5657 }
5758 }
@@ -71,7 +72,7 @@ pub struct ContractConstructorData {
7172#[ derive( Debug ) ]
7273pub struct ContractData {
7374 /// HIR Id of the contract.
74- hir_id : u32 ,
75+ contract_id : u32 ,
7576 /// Path of the source file.
7677 path : PathBuf ,
7778 /// Name of the contract
@@ -85,6 +86,7 @@ pub struct ContractData {
8586impl ContractData {
8687 fn new (
8788 hir : & Hir < ' _ > ,
89+ contract_id : u32 ,
8890 contract : & Contract < ' _ > ,
8991 path : & Path ,
9092 source : & solar_sema:: hir:: Source < ' _ > ,
@@ -121,7 +123,7 @@ impl ContractData {
121123 } ) ;
122124
123125 Self {
124- hir_id : contract . linearized_bases [ 0 ] . get ( ) ,
126+ contract_id ,
125127 path : path. to_path_buf ( ) ,
126128 name : contract. name . to_string ( ) ,
127129 constructor_data,
@@ -173,12 +175,12 @@ impl ContractData {
173175 /// vm.deployCode("artifact path", encodeArgs335(DeployHelper335.ConstructorArgs({name: name, symbol: symbol})))
174176 /// ```
175177 pub fn build_helper ( & self ) -> Option < String > {
176- let Self { hir_id , path, name, constructor_data, artifact } = self ;
178+ let Self { contract_id , path, name, constructor_data, artifact } = self ;
177179
178180 let Some ( constructor_details) = constructor_data else { return None } ;
179181 let struct_fields = & constructor_details. struct_fields ;
180182 let abi_encode_args = & constructor_details. abi_encode_args ;
181- let vm_interface_name = format ! ( "VmContractHelper{hir_id }" ) ;
183+ let vm_interface_name = format ! ( "VmContractHelper{contract_id }" ) ;
182184 let vm = format ! ( "{vm_interface_name}(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D)" ) ;
183185
184186 let helper = format ! (
@@ -187,18 +189,18 @@ pragma solidity >=0.4.0;
187189
188190import "{path}";
189191
190- abstract contract DeployHelper{hir_id } is {name} {{
192+ abstract contract DeployHelper{contract_id } is {name} {{
191193 struct ConstructorArgs {{
192194 {struct_fields};
193195 }}
194196}}
195197
196- function encodeArgs{hir_id }(DeployHelper{hir_id }.ConstructorArgs memory args) pure returns (bytes memory) {{
198+ function encodeArgs{contract_id }(DeployHelper{contract_id }.ConstructorArgs memory args) pure returns (bytes memory) {{
197199 return abi.encode({abi_encode_args});
198200}}
199201
200- function deployCode{hir_id }(DeployHelper{hir_id }.ConstructorArgs memory args) returns({name}) {{
201- return {name}(payable({vm}.deployCode("{artifact}", encodeArgs{hir_id }(args))));
202+ function deployCode{contract_id }(DeployHelper{contract_id }.ConstructorArgs memory args) returns({name}) {{
203+ return {name}(payable({vm}.deployCode("{artifact}", encodeArgs{contract_id }(args))));
202204}}
203205
204206interface {vm_interface_name} {{
0 commit comments