computePublishedContractAddress

Predicts the implementation address of any published contract

Example

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<ChainOptions & { rpc: string }>;
client: ThirdwebClient;
constructorParams: Array<unknown>;
contractId: string;
publisher?: string;
salt?: string;
version?: string;
}): Promise<string>;

Parameters

The arguments for predicting the address of a published contract.

Type

let args: {
chain: Readonly<ChainOptions & { rpc: string }>;
client: ThirdwebClient;
constructorParams: Array<unknown>;
contractId: string;
publisher?: string;
salt?: string;
version?: string;
};

Returns

let returnType: Promise<string>;

A promise that resolves to the predicted address of the contract.