isContractDeployed

Checks if a contract is deployed by verifying its bytecode.

Example

import { getContract } from "thirdweb/contract";
import { isContractDeployed } from "thirdweb/contract/utils";
const contract = getContract({ ... });
const isDeployed = await isContractDeployed(contract);
console.log(isDeployed);
function isContractDeployed(
contract: Readonly<ContractOptions<[]>>,
): Promise<boolean>;

Parameters

The contract to check.

Type

let contract: Readonly<ContractOptions<[]>>;

Returns

let returnType: Promise<boolean>;

A promise that resolves to a boolean indicating whether the contract is deployed or not.