Class ContractDeployer

Handles deploying new contracts

Hierarchy

  • RPCConnectionHandler
    • ContractDeployer

Constructors

  • Parameters

    • network: NetworkInput
    • options: undefined | {
          clientId?: string;
          gasSettings?: { maxPriceInGwei?: number | undefined; speed?: "standard" | "fast" | "fastest" | undefined; };
          gasless?: ({ openzeppelin: { relayerUrl: string; relayerForwarderAddress?: string | undefined; useEOAForwarder?: boolean | undefined; domainName?: string | undefined; domainVersion?: string | undefined; }; experimentalChainlessSupport?: boolean | undefined; }) | ({ biconomy: { apiId: string; apiKey: string; deadlineSeconds?: number | undefined; }; }) | ({ engine: { relayerUrl: string; }; });
          gatewayUrls?: string[];
          readonlySettings?: { rpcUrl: string; chainId?: number | undefined; };
          secretKey?: string;
          supportedChains?: ({ rpc: string[]; chainId: number; nativeCurrency: { symbol: string; name: string; decimals: number; }; slug: string; })[];
      }
    • storage: ThirdwebStorage<IpfsUploadBatchOptions>

    Returns ContractDeployer

Properties

deployAirdropERC1155: {
    prepare: ((...args) => Promise<DeployTransaction>);
    (...args): Promise<string>;
} = ...

Type declaration

deployAirdropERC20: {
    prepare: ((...args) => Promise<DeployTransaction>);
    (...args): Promise<string>;
} = ...

Type declaration

deployAirdropERC721: {
    prepare: ((...args) => Promise<DeployTransaction>);
    (...args): Promise<string>;
} = ...

Type declaration

deployEdition: {
    prepare: ((...args) => Promise<DeployTransaction>);
    (...args): Promise<string>;
} = ...

Type declaration

deployEditionDrop: {
    prepare: ((...args) => Promise<DeployTransaction>);
    (...args): Promise<string>;
} = ...

Type declaration

    • (...args): Promise<string>
    • Deploys a new EditionDrop contract

      Parameters

      Returns Promise<string>

      the address of the deployed contract

      Remarks

      Deploys an Edition Drop contract and returns the address of the deployed contract

      Example

      const contractAddress = await sdk.deployer.deployEditionDrop({
      name: "My Edition Drop",
      primary_sale_recipient: "your-address",
      });
  • prepare: ((...args) => Promise<DeployTransaction>)
deployLoyaltyCard: {
    prepare: ((...args) => Promise<DeployTransaction>);
    (...args): Promise<string>;
} = ...

Type declaration

    • (...args): Promise<string>
    • Deploys a new LoyaltyCard contract

      Parameters

      Returns Promise<string>

      the address of the deployed contract

      Remarks

      Deploys a LoyaltyCard contract and returns the address of the deployed contract

      Example

      const contractAddress = await sdk.deployer.deployLoyaltyCard({
      name: "My Loyalty Program",
      primary_sale_recipient: "your-address",
      });
  • prepare: ((...args) => Promise<DeployTransaction>)
deployMarketplace: {
    prepare: ((...args) => Promise<DeployTransaction>);
    (...args): Promise<string>;
} = ...

Type declaration

deployMarketplaceV3: {
    prepare: ((...args) => Promise<DeployTransaction>);
    (...args): Promise<string>;
} = ...

Type declaration

deployMultiwrap: {
    prepare: ((...args) => Promise<DeployTransaction>);
    (...args): Promise<string>;
} = ...

Type declaration

deployNFTCollection: {
    prepare: ((...args) => Promise<DeployTransaction>);
    (...args): Promise<string>;
} = ...

Type declaration

    • (...args): Promise<string>
    • Deploys an NFT Collection contract

      Parameters

      Returns Promise<string>

      the address of the deployed contract

      Remarks

      Deploys an NFT Collection contract and returns the address of the deployed contract

      Example

      const contractAddress = await sdk.deployer.deployNFTCollection({
      name: "My Collection",
      primary_sale_recipient: "your-address",
      });
  • prepare: ((...args) => Promise<DeployTransaction>)
deployNFTDrop: {
    prepare: ((...args) => Promise<DeployTransaction>);
    (...args): Promise<string>;
} = ...

Type declaration

deployOpenEdition: {
    prepare: ((...args) => Promise<DeployTransaction>);
    (...args): Promise<string>;
} = ...

Type declaration

deployPack: {
    prepare: ((...args) => Promise<DeployTransaction>);
    (...args): Promise<string>;
} = ...

Type declaration

deployProxy: {
    prepare: ((...args) => Promise<DeployTransaction>);
    (...args): Promise<string>;
} = ...

Type declaration

    • (...args): Promise<string>
    • Deploy a proxy contract of a given implementation directly

      Parameters

      • Rest ...args: [implementationAddress: string, implementationAbi: ContractInterface, initializerFunction: string, initializerArgs: any[]]

      Returns Promise<string>

  • prepare: ((...args) => Promise<DeployTransaction>)
      • (...args): Promise<DeployTransaction>
      • Parameters

        • Rest ...args: [implementationAddress: string, implementationAbi: ContractInterface, initializerFunction: string, initializerArgs: any[]]

        Returns Promise<DeployTransaction>

deployPublishedContract: {
    prepare: ((...args) => Promise<DeployTransaction>);
    (...args): Promise<string>;
} = ...

Type declaration

    • (...args): Promise<string>
    • Deploy any published contract by its name

      Parameters

      • Rest ...args: [publisherAddress: string, contractName: string, constructorParams: any[], version: any, options?: DeployOptions]

      Returns Promise<string>

  • prepare: ((...args) => Promise<DeployTransaction>)
deployReleasedContract: {
    prepare: ((...args) => Promise<DeployTransaction>);
    (...args): Promise<string>;
} = ...

Type declaration

    • (...args): Promise<string>
    • Deploy any published contract by its name

      Parameters

      • Rest ...args: [publisherAddress: string, contractName: string, constructorParams: any[], version: any, options?: DeployOptions]

      Returns Promise<string>

      Deprecated

      use deployPublishedContract instead

  • prepare: ((...args) => Promise<DeployTransaction>)
deploySignatureDrop: {
    prepare: ((...args) => Promise<DeployTransaction>);
    (...args): Promise<string>;
} = ...

Type declaration

    • (...args): Promise<string>
    • Deploys a new SignatureDrop contract

      Parameters

      Returns Promise<string>

      the address of the deployed contract

      Remarks

      Deploys a SignatureDrop contract and returns the address of the deployed contract

      Example

      const contractAddress = await sdk.deployer.deploySignatureDrop({
      name: "My Signature Drop",
      primary_sale_recipient: "your-address",
      });
  • prepare: ((...args) => Promise<DeployTransaction>)
deploySplit: {
    prepare: ((...args) => Promise<DeployTransaction>);
    (...args): Promise<string>;
} = ...

Type declaration

    • (...args): Promise<string>
    • Deploys a new Split contract

      Parameters

      Returns Promise<string>

      the address of the deployed contract

      Remarks

      Deploys a Split contract and returns the address of the deployed contract

      Example

      const contractAddress = await sdk.deployer.deploySplit({
      name: "My Split",
      primary_sale_recipient: "your-address",
      recipients: [
      {
      address: "your-address",
      sharesBps: 80 * 100, // 80%
      },
      {
      address: "another-address",
      sharesBps: 20 * 100, // 20%
      },
      ],
      });
  • prepare: ((...args) => Promise<DeployTransaction>)
deployToken: {
    prepare: ((...args) => Promise<DeployTransaction>);
    (...args): Promise<string>;
} = ...

Type declaration

deployTokenDrop: {
    prepare: ((...args) => Promise<DeployTransaction>);
    (...args): Promise<string>;
} = ...

Type declaration

deployViaAutoFactory: {
    prepare: ((...args) => Promise<DeployTransaction>);
    (...args): Promise<string>;
} = ...

Type declaration

    • (...args): Promise<string>
    • Deploy a proxy contract of a given implementation via thirdweb's Clone factory

      Parameters

      • Rest ...args: [publishMetadataUri: string, deployMetadata: DeployMetadata, signer: Signer, initializerFunction: string, paramValues: any[], options?: DeployOptions]

      Returns Promise<string>

  • prepare: ((...args) => Promise<DeployTransaction>)
deployViaCustomFactory: {
    prepare: ((...args) => Promise<DeployTransaction>);
    (...args): Promise<string>;
} = ...

Type declaration

    • (...args): Promise<string>
    • Deploy a proxy contract of a given implementation via a custom factory

      Parameters

      • Rest ...args: [constructorParamValues: any[], deployMetadata: DeployMetadata, signer: Signer, chainId: number]

      Returns Promise<string>

  • prepare: ((...args) => Promise<DeployTransaction>)
deployViaFactory: {
    prepare: ((...args) => Promise<Transaction<string>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Deploy a proxy contract of a given implementation via the given factory

      Parameters

      • Rest ...args: [factoryAddress: string, implementationAddress: string, implementationAbi: ContractInterface, initializerFunction: string, initializerArgs: any[], saltForProxyDeploy?: string]

      Returns Promise<TResult>

  • prepare: ((...args) => Promise<Transaction<string>>)
      • (...args): Promise<Transaction<string>>
      • Parameters

        • Rest ...args: [factoryAddress: string, implementationAddress: string, implementationAbi: ContractInterface, initializerFunction: string, initializerArgs: any[], saltForProxyDeploy?: string]

        Returns Promise<Transaction<string>>

deployVote: {
    prepare: ((...args) => Promise<DeployTransaction>);
    (...args): Promise<string>;
} = ...

Type declaration

    • (...args): Promise<string>
    • Deploys a new Vote contract

      Parameters

      Returns Promise<string>

      the address of the deployed contract

      Remarks

      Deploys an Vote contract and returns the address of the deployed contract

      Example

      const contractAddress = await sdk.deployer.deployVote({
      name: "My Vote",
      primary_sale_recipient: "your-address",
      voting_token_address: "your-token-contract-address",
      });
  • prepare: ((...args) => Promise<DeployTransaction>)
events: EventEmitter<DeployEvents, any>
network: NetworkInput
options: {
    clientId?: string;
    gasSettings: { maxPriceInGwei: number; speed: "standard" | "fast" | "fastest"; };
    gasless?: ({ openzeppelin: { relayerUrl: string; useEOAForwarder: boolean; domainName: string; domainVersion: string; relayerForwarderAddress?: string | undefined; }; experimentalChainlessSupport: boolean; }) | ({ biconomy: { apiId: string; apiKey: string; deadlineSeconds: number; }; }) | ({ engine: { relayerUrl: string; }; });
    gatewayUrls?: string[];
    readonlySettings?: { rpcUrl: string; chainId?: number | undefined; };
    secretKey?: string;
    supportedChains: ({ rpc: string[]; chainId: number; nativeCurrency: { symbol: string; name: string; decimals: number; }; slug: string; })[];
}

Type declaration

  • Optional clientId?: string
  • gasSettings: { maxPriceInGwei: number; speed: "standard" | "fast" | "fastest"; }
  • Optional gasless?: ({ openzeppelin: { relayerUrl: string; useEOAForwarder: boolean; domainName: string; domainVersion: string; relayerForwarderAddress?: string | undefined; }; experimentalChainlessSupport: boolean; }) | ({ biconomy: { apiId: string; apiKey: string; deadlineSeconds: number; }; }) | ({ engine: { relayerUrl: string; }; })
  • Optional gatewayUrls?: string[]
  • Optional readonlySettings?: { rpcUrl: string; chainId?: number | undefined; }
  • Optional secretKey?: string
  • supportedChains: ({ rpc: string[]; chainId: number; nativeCurrency: { symbol: string; name: string; decimals: number; }; slug: string; })[]
storage: ThirdwebStorage<IpfsUploadBatchOptions>

Methods

  • Listen to all deploy transactions from this deployer

    Parameters

    • listener: ((event) => void)

      the listener to add

    Returns void

  • Deploy any published contract by its name

    Parameters

    • contractName: string

      the name of the contract to deploy

    • constructorParams: any[]

      the constructor params to pass to the contract

    • publisherAddress: string = THIRDWEB_DEPLOYER

      the address of the publisher

    • contractVersion: string = "latest"
    • Optional saltForCreate2: string

      Optional: salt for create2 deployment, will determine deployment address

    Returns Promise<string>

  • Parameters

    • publisherAddress: string
    • contractName: string
    • version: string

    Returns Promise<{
        id: string;
        metadataUri: string;
        timestamp: string;
    }>

  • Parameters

    • publishMetadataUri: string

      the uri of the publish metadata

    • Optional options: DeployOptions

      the deploy options

    Returns Promise<DeploymentTransaction[]>

  • Predict Create2 address of a contract

    Parameters

    • contractName: string

      the name of the contract

    • constructorParams: any[]

      the constructor params to pass to the contract

    • publisherAddress: string = THIRDWEB_DEPLOYER
    • contractVersion: string = "latest"
    • Optional saltForCreate2: string

      Optional: salt for create2 deployment, will determine deployment address

    Returns Promise<string>

Generated using TypeDoc