@@ -3,6 +3,7 @@ import { ANVIL_CHAIN } from "../../../test/src/chains.js";
33import { TEST_CLIENT } from "../../../test/src/test-clients.js" ;
44import { TEST_ACCOUNT_A } from "../../../test/src/test-wallets.js" ;
55import { getContract } from "../../contract/contract.js" ;
6+ import { getDeployedInfraContract } from "../../contract/deployment/utils/infra.js" ;
67import { readContract } from "../../transaction/read-contract.js" ;
78import { getInstalledModules } from "../modules/__generated__/IModularCore/read/getInstalledModules.js" ;
89import { deployPublishedContract } from "./deploy-published.js" ;
@@ -29,16 +30,16 @@ describe.runIf(process.env.TW_SECRET_KEY)(
2930 account : TEST_ACCOUNT_A ,
3031 contractId : "MultiSig" ,
3132 version : "0.0.4" ,
32- salt : "tw " ,
33+ salt : "" ,
3334 publisher : "0x6453a486d52e0EB6E79Ec4491038E2522a926936" ,
3435 } ) ;
3536 dummyContractAddress = await deployPublishedContract ( {
3637 client : TEST_CLIENT ,
3738 chain : ANVIL_CHAIN ,
3839 account : TEST_ACCOUNT_A ,
3940 contractId : "ContractWithBytes" ,
40- version : "0.0.1 " ,
41- salt : "tw " ,
41+ version : "0.0.2 " ,
42+ salt : "" ,
4243 publisher : "0x6453a486d52e0EB6E79Ec4491038E2522a926936" ,
4344 } ) ;
4445 mintfeeManagerModuleAddress = await deployPublishedContract ( {
@@ -47,35 +48,34 @@ describe.runIf(process.env.TW_SECRET_KEY)(
4748 account : TEST_ACCOUNT_A ,
4849 contractId : "MintFeeManagerModule" ,
4950 version : "0.0.1" ,
50- salt : "tw " ,
51+ salt : "" ,
5152 publisher : "0x6453a486d52e0EB6E79Ec4491038E2522a926936" ,
5253 } ) ;
5354 mintfeeManagerCoreAddress = await deployPublishedContract ( {
5455 client : TEST_CLIENT ,
5556 chain : ANVIL_CHAIN ,
5657 account : TEST_ACCOUNT_A ,
5758 contractId : "MintFeeManagerCore" ,
58- version : "0.0.25 " ,
59- salt : "tw " ,
59+ version : "0.0.26 " ,
60+ salt : "" ,
6061 publisher : "0x6453a486d52e0EB6E79Ec4491038E2522a926936" ,
6162 } ) ;
6263 claimableModuleAddress = await deployPublishedContract ( {
6364 client : TEST_CLIENT ,
6465 chain : ANVIL_CHAIN ,
6566 account : TEST_ACCOUNT_A ,
6667 contractId : "ClaimableERC721" ,
67- version : "0.0.13 " ,
68- salt : "tw " ,
68+ version : "0.0.14 " ,
69+ salt : "" ,
6970 publisher : "0x6453a486d52e0EB6E79Ec4491038E2522a926936" ,
7071 } ) ;
71-
7272 wethAddress = await deployPublishedContract ( {
7373 client : TEST_CLIENT ,
7474 chain : ANVIL_CHAIN ,
7575 account : TEST_ACCOUNT_A ,
7676 contractId : "WETH9" ,
7777 version : "0.0.1" ,
78- salt : "thirdweb " ,
78+ salt : "" ,
7979 publisher : "0x6453a486d52e0EB6E79Ec4491038E2522a926936" ,
8080 } ) ;
8181 forwarderAddress = await deployPublishedContract ( {
@@ -84,7 +84,7 @@ describe.runIf(process.env.TW_SECRET_KEY)(
8484 account : TEST_ACCOUNT_A ,
8585 contractId : "Forwarder" ,
8686 version : "0.0.1" ,
87- salt : "thirdweb " ,
87+ salt : "" ,
8888 publisher : "0x6453a486d52e0EB6E79Ec4491038E2522a926936" ,
8989 } ) ;
9090 multiwrapAddress = await deployPublishedContract ( {
@@ -192,5 +192,67 @@ describe.runIf(process.env.TW_SECRET_KEY)(
192192 expect ( fetchedWethAddress . toLowerCase ( ) ) . to . eq ( wethAddress ) ;
193193 expect ( isTrustedForwarder ) . to . be . true ;
194194 } ) ;
195+
196+ it ( "should correctly compute addresses for deployed contracts with refs" , async ( ) => {
197+ const [
198+ multisigAddressComputed ,
199+ dummyContractAddressComputed ,
200+ mintfeeManagerModuleAddressComputed ,
201+ mintfeeManagerCoreAddressComputed ,
202+ claimableModuleAddressComputed ,
203+ ] = await Promise . all ( [
204+ getDeployedInfraContract ( {
205+ client : TEST_CLIENT ,
206+ chain : ANVIL_CHAIN ,
207+ contractId : "MultiSig" ,
208+ version : "0.0.4" ,
209+ publisher : "0x6453a486d52e0EB6E79Ec4491038E2522a926936" ,
210+ } ) ,
211+ getDeployedInfraContract ( {
212+ client : TEST_CLIENT ,
213+ chain : ANVIL_CHAIN ,
214+ contractId : "ContractWithBytes" ,
215+ version : "0.0.2" ,
216+ publisher : "0x6453a486d52e0EB6E79Ec4491038E2522a926936" ,
217+ } ) ,
218+ getDeployedInfraContract ( {
219+ client : TEST_CLIENT ,
220+ chain : ANVIL_CHAIN ,
221+ contractId : "MintFeeManagerModule" ,
222+ version : "0.0.1" ,
223+ publisher : "0x6453a486d52e0EB6E79Ec4491038E2522a926936" ,
224+ } ) ,
225+ getDeployedInfraContract ( {
226+ client : TEST_CLIENT ,
227+ chain : ANVIL_CHAIN ,
228+ contractId : "MintFeeManagerCore" ,
229+ version : "0.0.26" ,
230+ publisher : "0x6453a486d52e0EB6E79Ec4491038E2522a926936" ,
231+ } ) ,
232+ getDeployedInfraContract ( {
233+ client : TEST_CLIENT ,
234+ chain : ANVIL_CHAIN ,
235+ contractId : "ClaimableERC721" ,
236+ version : "0.0.14" ,
237+ publisher : "0x6453a486d52e0EB6E79Ec4491038E2522a926936" ,
238+ } ) ,
239+ ] ) ;
240+
241+ expect ( multisigAddressComputed ?. address . toLowerCase ( ) ) . to . eq (
242+ multisigAddress ,
243+ ) ;
244+ expect ( dummyContractAddressComputed ?. address . toLowerCase ( ) ) . to . eq (
245+ dummyContractAddress ,
246+ ) ;
247+ expect ( mintfeeManagerModuleAddressComputed ?. address . toLowerCase ( ) ) . to . eq (
248+ mintfeeManagerModuleAddress ,
249+ ) ;
250+ expect ( mintfeeManagerCoreAddressComputed ?. address . toLowerCase ( ) ) . to . eq (
251+ mintfeeManagerCoreAddress ,
252+ ) ;
253+ expect ( claimableModuleAddressComputed ?. address . toLowerCase ( ) ) . to . eq (
254+ claimableModuleAddress ,
255+ ) ;
256+ } ) ;
195257 } ,
196258) ;
0 commit comments