diff --git a/.changeset/breezy-items-relate.md b/.changeset/breezy-items-relate.md new file mode 100644 index 00000000000..edaa244004e --- /dev/null +++ b/.changeset/breezy-items-relate.md @@ -0,0 +1,5 @@ +--- +"thirdweb": patch +--- + +Fix deploy version for published contracts diff --git a/apps/dashboard/src/components/contract-components/contract-deploy-form/custom-contract.tsx b/apps/dashboard/src/components/contract-components/contract-deploy-form/custom-contract.tsx index d89eff422eb..2377170962f 100644 --- a/apps/dashboard/src/components/contract-components/contract-deploy-form/custom-contract.tsx +++ b/apps/dashboard/src/components/contract-components/contract-deploy-form/custom-contract.tsx @@ -447,6 +447,7 @@ export const CustomContractForm: React.FC = ({ ? JSON.parse(params.deployParams._trustedForwarders as string) : undefined, }, + version: metadata.version, }); } diff --git a/packages/thirdweb/src/extensions/prebuilts/deploy-marketplace.ts b/packages/thirdweb/src/extensions/prebuilts/deploy-marketplace.ts index ef01e4ee16e..b1ba887f682 100644 --- a/packages/thirdweb/src/extensions/prebuilts/deploy-marketplace.ts +++ b/packages/thirdweb/src/extensions/prebuilts/deploy-marketplace.ts @@ -36,6 +36,8 @@ export type MarketplaceContractParams = { export type DeployMarketplaceContractOptions = Prettify< ClientAndChainAndAccount & { params: MarketplaceContractParams; + } & { + version?: string; } >; @@ -46,7 +48,7 @@ export type DeployMarketplaceContractOptions = Prettify< export async function deployMarketplaceContract( options: DeployMarketplaceContractOptions, ) { - const { chain, client, account, params } = options; + const { chain, client, account, params, version } = options; const WETH = await getOrDeployInfraContract({ chain, client, @@ -127,6 +129,7 @@ export async function deployMarketplaceContract( nativeTokenWrapper: WETH.address, } as MarketplaceConstructorParams[number], }, + version, }); const initializeTransaction = await getInitializeTransaction({ diff --git a/packages/thirdweb/src/extensions/prebuilts/deploy-pack.ts b/packages/thirdweb/src/extensions/prebuilts/deploy-pack.ts index 9d215cbad5b..378f14c9713 100644 --- a/packages/thirdweb/src/extensions/prebuilts/deploy-pack.ts +++ b/packages/thirdweb/src/extensions/prebuilts/deploy-pack.ts @@ -88,7 +88,7 @@ export async function deployPackContract(options: DeployPackContractOptions) { chain, client, account, - contractId: "Forwarder", + contractId: "ForwarderEOAOnly", }), ]); const { cloneFactoryContract, implementationContract } = diff --git a/packages/thirdweb/src/extensions/prebuilts/deploy-published.ts b/packages/thirdweb/src/extensions/prebuilts/deploy-published.ts index ce0e0f662ff..febff3be3bd 100644 --- a/packages/thirdweb/src/extensions/prebuilts/deploy-published.ts +++ b/packages/thirdweb/src/extensions/prebuilts/deploy-published.ts @@ -211,8 +211,10 @@ export async function deployContractfromDeployMetadata( (await getAllDefaultConstructorParamsForImplementation({ chain, client, + contractId: deployMetadata.name, })), publisher: deployMetadata.publisher, + version: deployMetadata.version, }); const initializeTransaction = await getInitializeTransaction({ diff --git a/packages/thirdweb/src/extensions/prebuilts/get-required-transactions.ts b/packages/thirdweb/src/extensions/prebuilts/get-required-transactions.ts index 3b4179b45cb..a7aa74b80dc 100644 --- a/packages/thirdweb/src/extensions/prebuilts/get-required-transactions.ts +++ b/packages/thirdweb/src/extensions/prebuilts/get-required-transactions.ts @@ -136,6 +136,7 @@ async function getTransactionsForImplementation(options: { (await getAllDefaultConstructorParamsForImplementation({ chain, client, + contractId: deployMetadata.name, })); const result = await getDeployedInfraContract({ @@ -224,6 +225,7 @@ async function getTransactionsForMaketplaceV3(options: { export async function getAllDefaultConstructorParamsForImplementation(args: { chain: Chain; client: ThirdwebClient; + contractId: string; }) { const { chain, client } = args; const isZkSync = await isZkSyncChain(chain); @@ -234,11 +236,14 @@ export async function getAllDefaultConstructorParamsForImplementation(args: { nativeTokenWrapper: weth, }; } + + const forwarderContractId = + args.contractId === "Pack" ? "ForwarderEOAOnly" : "Forwarder"; const [forwarder, weth] = await Promise.all([ computePublishedContractAddress({ chain, client, - contractId: "Forwarder", + contractId: forwarderContractId, }), computePublishedContractAddress({ chain,