getBytecode

Retrieves the bytecode of a contract.

Example

import { getBytecode } from "thirdweb/contract";
const bytecode = await getBytecode(contract);
function getBytecode(
contract: Readonly<ContractOptions<[], `0x${string}`>>,
): Promise<Hex>;

Parameters

The ThirdwebContract instance.

Type

let contract: Readonly<ContractOptions<[], `0x${string}`>>;

Returns

let returnType: ox__Hex.Hex;

A Promise that resolves to the bytecode of the contract.