Icon HelpCircleForumIcon Link

⌘K

Icon HelpCircleForumIcon Link
Nightly /
Contractfactory

@fuel-ts/contract v0.96.1 • 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:73 Icon Link

Icon LinkProperties

Icon Linkaccount

Icon InfoCircle

account: null | Account

Icon LinkDefined in

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


Icon Linkbytecode

Icon InfoCircle

bytecode: BytesLike

Icon LinkDefined in

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


Icon Linkinterface

Icon InfoCircle

interface: Interface

Icon LinkDefined in

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


Icon Linkprovider

Icon InfoCircle

provider: null | Provider

Icon LinkDefined in

packages/contract/src/contract-factory.ts:63 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:115 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:125 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:200 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:256 Icon Link


Icon LinkdeployAsBlobTxForScript()

Icon InfoCircle

deployAsBlobTxForScript(): Promise<object>

Icon LinkReturns

Promise<object>

Icon LinkblobId

Icon InfoCircle

blobId: string

Icon LinkwaitForResult()

Icon InfoCircle

waitForResult: () => Promise<object>

Icon LinkReturns

Promise<object>

Icon LinkconfigurableOffsetDiff

Icon InfoCircle

configurableOffsetDiff: number

Icon LinkloaderBytecode

Icon InfoCircle

loaderBytecode: string

Icon LinkDefined in

packages/contract/src/contract-factory.ts:380 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:218 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:467 Icon Link