deployModularContract

Deploys an thirdweb ERC20 contract of the given type. On chains where the thirdweb infrastructure contracts are not deployed, this function will deploy them as well.

Example

import { deployModularContract } from "thirdweb/modules";
const contractAddress = await deployModularContract({
chain,
client,
account,
core: "ERC20",
params: {
name: "MyToken",
description: "My Token contract",
symbol: "MT",
},
modules: [
ClaimableERC721.module({
primarySaleRecipient: "0x...",
}),
RoyaltyERC721.module({
royaltyRecipient: "0x...",
royaltyBps: 500n,
}),
],
});
function deployModularContract(options: {
account: Account;
chain: Readonly<ChainOptions & { rpc: string }>;
client: ThirdwebClient;
core: CoreType;
modules?: Array<ModuleInstaller>;
publisher?: string;
salt?: string;
}): Promise<string>;

Parameters

The deployment options.

Type

let options: {
account: Account;
chain: Readonly<ChainOptions & { rpc: string }>;
client: ThirdwebClient;
core: CoreType;
modules?: Array<ModuleInstaller>;
publisher?: string;
salt?: string;
};

Returns

let returnType: Promise<string>;

The deployed contract address.