deployContract
Deploy a contract on a given chain
import { deployContract } from "thirdweb/deployContract"; const address = await deployContract({ client, chain, bytecode: "0x...", constructorAbi: { inputs: [{ type: "uint256", name: "value" }], type: "constructor", }, constructorParams: [123],});
function deployContract(options: ({ bytecode: `0x${string}`; chain: Readonly<(ChainOptions) & ({ rpc: string })>; client: ThirdwebClient; constructorAbi: TConstructor; constructorParams: {[key in string | number | symbol] : {[key in string | number | symbol] : AbiParameterToPrimitiveType<TConstructor["inputs"][key<key>], AbiParameterKind>}[key]} extends readonly Array<AbiParameter> ? (readonly Array<AbiParameter>) & ({[key in string | number | symbol] : {[key in string | number | symbol] : AbiParameterToPrimitiveType<TConstructor["inputs"][key<key>], AbiParameterKind>}[key]}) : readonly Array<unknown> }) & ({ account: Account })) : Promise<string>
the deploy options
let options: ({ bytecode: `0x${string}`; chain: Readonly<(ChainOptions) & ({ rpc: string })>; client: ThirdwebClient; constructorAbi: TConstructor; constructorParams: {[key in string | number | symbol] : {[key in string | number | symbol] : AbiParameterToPrimitiveType<TConstructor["inputs"][key<key>], AbiParameterKind>}[key]} extends readonly Array<AbiParameter> ? (readonly Array<AbiParameter>) & ({[key in string | number | symbol] : {[key in string | number | symbol] : AbiParameterToPrimitiveType<TConstructor["inputs"][key<key>], AbiParameterKind>}[key]}) : readonly Array<unknown> }) & ({ account: Account })