computePublishedContractAddress
Predicts the implementation address of any published contract
import { computePublishedContractAddress } from "thirdweb/deploys"; const contractMetadata = await fetchPublishedContractMetadata({ client, chain,});const address = await computePublishedContractAddress({ client, chain, contractId: "AccountFactory", constructorParams,});
function computePublishedContractAddress(args: { chain: { readonly blockExplorers?: Array<{ apiUrl?: string; name: string; url: string; }>; readonly experimental?: { increaseZeroByteCount?: boolean }; readonly faucets?: Array<string>; readonly icon?: Icon; readonly id: number; readonly name?: string; readonly nativeCurrency?: { decimals?: number; name?: string; symbol?: string; }; readonly rpc: string; readonly testnet?: true; }; constructorParams: Array<unknown>; contractId: string; publisher?: string; salt?: string; version?: string;}): Promise<string>;
The arguments for predicting the address of a published contract.
let args: { chain: { readonly blockExplorers?: Array<{ apiUrl?: string; name: string; url: string; }>; readonly experimental?: { increaseZeroByteCount?: boolean }; readonly faucets?: Array<string>; readonly icon?: Icon; readonly id: number; readonly name?: string; readonly nativeCurrency?: { decimals?: number; name?: string; symbol?: string; }; readonly rpc: string; readonly testnet?: true; }; constructorParams: Array<unknown>; contractId: string; publisher?: string; salt?: string; version?: string;};