@@ -21,7 +21,12 @@ import {
2121 getDeployedInfraContractFromMetadata ,
2222 prepareInfraContractDeployTransactionFromMetadata ,
2323} from "./infra.js" ;
24- import { getDeployedMintFeeManagerContract } from "./mintfee-manager.js" ;
24+ import { getDeployedMintFeeManagerContract , getDeployedMultisigContract } from "./mintfee-manager.js" ;
25+
26+ export interface ReplacementValues {
27+ mintFeeManager ?: string ;
28+ multisig ?: string ;
29+ }
2530
2631/**
2732 * @internal
@@ -86,11 +91,15 @@ export async function getOrDeployInfraForPublishedContract(
8691 } ;
8792 }
8893
89- let [ cloneFactoryContract , mintfeeManagerContract , implementationContract ] = await Promise . all ( [
94+ let [ cloneFactoryContract , mintfeeManagerContract , multisig , implementationContract ] = await Promise . all ( [
9095 getDeployedCloneFactoryContract ( {
9196 chain,
9297 client,
9398 } ) ,
99+ getDeployedMultisigContract ( {
100+ chain,
101+ client,
102+ } ) ,
94103 getDeployedMintFeeManagerContract ( {
95104 chain,
96105 client,
@@ -105,13 +114,18 @@ export async function getOrDeployInfraForPublishedContract(
105114 } ) ,
106115 ] ) ;
107116
108- if ( ! implementationContract || ! cloneFactoryContract || ! mintfeeManagerContract ) {
117+ if ( ! implementationContract || ! cloneFactoryContract || ! multisig || ! mintfeeManagerContract ) {
109118 // deploy the infra and implementation contracts if not found
110119 cloneFactoryContract = await deployCloneFactory ( {
111120 client,
112121 chain,
113122 account,
114123 } ) ;
124+ multisig = await deployMultisig ( {
125+ client,
126+ chain,
127+ account,
128+ } ) ;
115129 mintfeeManagerContract = await deployMintFeeManager ( {
116130 client,
117131 chain,
@@ -125,6 +139,10 @@ export async function getOrDeployInfraForPublishedContract(
125139 constructorParams,
126140 publisher,
127141 version,
142+ replacementValues : {
143+ mintFeeManager : mintfeeManagerContract . address ,
144+ multisig : multisig . address
145+ }
128146 } ) ;
129147 }
130148 return { cloneFactoryContract, mintfeeManagerContract, implementationContract } ;
@@ -212,6 +230,7 @@ export async function deployImplementation(
212230 constructorParams ?: Record < string , unknown > ;
213231 publisher ?: string ;
214232 version ?: string ;
233+ replacementValues ?: ReplacementValues
215234 } ,
216235) {
217236 return getOrDeployInfraContract ( {
@@ -220,6 +239,7 @@ export async function deployImplementation(
220239 constructorParams : options . constructorParams ,
221240 publisher : options . publisher ,
222241 version : options . version ,
242+ replacementValues : options . replacementValues
223243 } ) ;
224244}
225245
@@ -233,6 +253,7 @@ export async function getOrDeployInfraContract(
233253 constructorParams ?: Record < string , unknown > ;
234254 publisher ?: string ;
235255 version ?: string ;
256+ replacementValues ?: ReplacementValues
236257 } ,
237258) {
238259 const contractMetadata = await fetchPublishedContractMetadata ( {
@@ -254,6 +275,7 @@ export async function getOrDeployInfraContractFromMetadata(
254275 options : ClientAndChainAndAccount & {
255276 contractMetadata : FetchDeployMetadataResult ;
256277 constructorParams ?: Record < string , unknown > ;
278+ replacementValues ?: ReplacementValues
257279 } ,
258280) {
259281 const infraContract = await getDeployedInfraContractFromMetadata ( options ) ;
0 commit comments