deployPublishedContract

Deploy an instance of a published contract on a given chain

Example

Deploying a published contract

import { deployPublishedContract } from "thirdweb/deploys";
const address = await deployedPublishedContract({
client,
chain,
account,
contractId: "MyPublishedContract",
contractParams: {
param1: "value1",
param2: 123,
},
publisher: "0x...", // optional, defaults to the thirdweb deployer
});

Deploying a published contract deterministically

import { deployPublishedContract } from "thirdweb/deploys";
const address = await deployedPublishedContract({
client,
chain,
account,
contractId: "MyPublishedContract",
contractParams: {
param1: "value1",
param2: 123,
},
publisher: "0x...",
salt: "your-salt", // this will deterministically deploy the contract at the same address on all chains
});
function deployPublishedContract(
): Promise<string>;

Parameters

the deploy options

Type

let options: {
account: Account;
chain: Chain;
client: ThirdwebClient;
contractId: string;
contractParams?: Record<string, unknown>;
implementationConstructorParams?: Record<string, unknown>;
publisher?: string;
salt?: string;
version?: string;
};

Returns

let returnType: Promise<string>;

a promise that resolves to the deployed contract address