Icon HelpCircleForumIcon Link

⌘K

Icon HelpCircleForumIcon Link
Contractfactory

@fuel-ts/contract v0.97.0 Docs


Icon LinkClass: ContractFactory

ContractFactory provides utilities for deploying and configuring contracts.

Icon LinkConstructors

Icon Linknew ContractFactory()

Icon InfoCircle

new ContractFactory(bytecode, abi, accountOrProvider): ContractFactory

Create a ContractFactory instance.

Icon LinkParameters

bytecode: BytesLike

The bytecode of the contract.

abi: Interface | JsonAbi

The contract's ABI (Application Binary Interface).

accountOrProvider: null | Provider | Account = null

An account or provider to be associated with the factory.

Icon LinkReturns

ContractFactory

Icon LinkDefined in

packages/contract/src/contract-factory.ts:68 Icon Link

Icon LinkProperties

Icon Linkaccount

Icon InfoCircle

account: null | Account

Icon LinkDefined in

packages/contract/src/contract-factory.ts:59 Icon Link


Icon Linkbytecode

Icon InfoCircle

bytecode: BytesLike

Icon LinkDefined in

packages/contract/src/contract-factory.ts:56 Icon Link


Icon Linkinterface

Icon InfoCircle

interface: Interface

Icon LinkDefined in

packages/contract/src/contract-factory.ts:57 Icon Link


Icon Linkprovider

Icon InfoCircle

provider: null | Provider

Icon LinkDefined in

packages/contract/src/contract-factory.ts:58 Icon Link

Icon LinkMethods

Icon Linkconnect()

Icon InfoCircle

connect(provider): ContractFactory

Connect the factory to a provider.

Icon LinkParameters

provider: Provider

The provider to be associated with the factory.

Icon LinkReturns

ContractFactory

A new ContractFactory instance.

Icon LinkDefined in

packages/contract/src/contract-factory.ts:110 Icon Link


Icon LinkcreateTransactionRequest()

Icon InfoCircle

createTransactionRequest(deployOptions?): object

Create a transaction request to deploy a contract with the specified options.

Icon LinkParameters

deployOptions?: object & CreateTransactionRequestLike & object

Options for deploying the contract.

Icon LinkReturns

object

The CreateTransactionRequest object for deploying the contract.

Icon LinkcontractId

Icon InfoCircle

contractId: string

Icon LinktransactionRequest

Icon InfoCircle

transactionRequest: CreateTransactionRequest

Icon LinkDefined in

packages/contract/src/contract-factory.ts:120 Icon Link


Icon Linkdeploy()

Icon InfoCircle

deploy<TContract>(deployOptions): Promise<DeployContractResult <TContract>>

Deploy a contract of any length with the specified options.

Icon LinkType Parameters

TContract extends Contract = Contract

Icon LinkParameters

deployOptions: DeployContractOptions = {}

Options for deploying the contract.

Icon LinkReturns

Promise<DeployContractResult <TContract>>

A promise that resolves to the deployed contract instance.

Icon LinkDefined in

packages/contract/src/contract-factory.ts:195 Icon Link


Icon LinkdeployAsBlobTx()

Icon InfoCircle

deployAsBlobTx<TContract>(deployOptions): Promise<DeployContractResult <TContract>>

Chunks and deploys a contract via a loader contract. Suitable for deploying contracts larger than the max contract size.

Icon LinkType Parameters

TContract extends Contract = Contract

Icon LinkParameters

deployOptions: DeployContractOptions = ...

Options for deploying the contract.

Icon LinkReturns

Promise<DeployContractResult <TContract>>

A promise that resolves to the deployed contract instance.

Icon LinkDefined in

packages/contract/src/contract-factory.ts:251 Icon Link


Icon LinkdeployAsCreateTx()

Icon InfoCircle

deployAsCreateTx<TContract>(deployOptions): Promise<DeployContractResult <TContract>>

Deploy a contract with the specified options.

Icon LinkType Parameters

TContract extends Contract = Contract

Icon LinkParameters

deployOptions: DeployContractOptions = {}

Options for deploying the contract.

Icon LinkReturns

Promise<DeployContractResult <TContract>>

A promise that resolves to the deployed contract instance.

Icon LinkDefined in

packages/contract/src/contract-factory.ts:213 Icon Link


Icon LinksetConfigurableConstants()

Icon InfoCircle

setConfigurableConstants(configurableConstants): void

Set configurable constants of the contract with the specified values.

Icon LinkParameters

configurableConstants

An object containing configurable names and their values.

Icon LinkReturns

void

Icon LinkDefined in

packages/contract/src/contract-factory.ts:380 Icon Link