diff --git a/packages/thirdweb/src/extensions/prebuilts/deploy-published.ts b/packages/thirdweb/src/extensions/prebuilts/deploy-published.ts index fbdb48aefbd..ce0e0f662ff 100644 --- a/packages/thirdweb/src/extensions/prebuilts/deploy-published.ts +++ b/packages/thirdweb/src/extensions/prebuilts/deploy-published.ts @@ -150,28 +150,35 @@ export async function deployContractfromDeployMetadata( salt, } = options; - const processedImplParams: Record = {}; - for (const key in implementationConstructorParams) { - processedImplParams[key] = await processRefDeployments({ - client, - account, - chain, - paramValue: implementationConstructorParams[key] as - | string - | ImplementationConstructorParam, - }); + let processedImplParams: Record | undefined; + let processedInitializeParams: Record | undefined; + + if (implementationConstructorParams) { + processedImplParams = {}; + for (const key in implementationConstructorParams) { + processedImplParams[key] = await processRefDeployments({ + client, + account, + chain, + paramValue: implementationConstructorParams[key] as + | string + | ImplementationConstructorParam, + }); + } } - const processedInitializeParams: Record = {}; - for (const key in initializeParams) { - processedInitializeParams[key] = await processRefDeployments({ - client, - account, - chain, - paramValue: initializeParams[key] as - | string - | ImplementationConstructorParam, - }); + if (initializeParams) { + processedInitializeParams = {}; + for (const key in initializeParams) { + processedInitializeParams[key] = await processRefDeployments({ + client, + account, + chain, + paramValue: initializeParams[key] as + | string + | ImplementationConstructorParam, + }); + } } switch (deployMetadata?.deployType) {