Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/breezy-items-relate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"thirdweb": patch
---

Fix deploy version for published contracts
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ export const CustomContractForm: React.FC<CustomContractFormProps> = ({
? JSON.parse(params.deployParams._trustedForwarders as string)
: undefined,
},
version: metadata.version,
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ export type MarketplaceContractParams = {
export type DeployMarketplaceContractOptions = Prettify<
ClientAndChainAndAccount & {
params: MarketplaceContractParams;
} & {
version?: string;
}
>;

Expand All @@ -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,
Expand Down Expand Up @@ -127,6 +129,7 @@ export async function deployMarketplaceContract(
nativeTokenWrapper: WETH.address,
} as MarketplaceConstructorParams[number],
},
version,
});

const initializeTransaction = await getInitializeTransaction({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export async function deployPackContract(options: DeployPackContractOptions) {
chain,
client,
account,
contractId: "Forwarder",
contractId: "ForwarderEOAOnly",
}),
]);
const { cloneFactoryContract, implementationContract } =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ async function getTransactionsForImplementation(options: {
(await getAllDefaultConstructorParamsForImplementation({
chain,
client,
contractId: deployMetadata.name,
}));

const result = await getDeployedInfraContract({
Expand Down Expand Up @@ -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);
Expand All @@ -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,
Expand Down
Loading