Icon HelpCircleForumIcon Link

⌘K

Icon HelpCircleForumIcon Link
Contractfactory

Icon LinkClass: ContractFactory

@fuel-ts/contract .ContractFactory

ContractFactory provides utilities for deploying and configuring contracts.

Icon LinkConstructors

Icon Linkconstructor

new ContractFactory(bytecode, abi, accountOrProvider?): ContractFactory

Create a ContractFactory instance.

Icon LinkParameters

NameTypeDefault valueDescription
bytecodeBytesLikeundefinedThe bytecode of the contract.
abiJsonAbi | Interface<JsonAbi>undefinedThe contract's ABI (Application Binary Interface).
accountOrProvidernull | Provider | Account nullAn account or provider to be associated with the factory.

Icon LinkReturns

ContractFactory

Icon LinkDefined in

contract-factory.ts:40 Icon Link

Icon LinkProperties

Icon Linkaccount

account: null | Account

Icon LinkDefined in

contract-factory.ts:31 Icon Link


Icon Linkbytecode

bytecode: BytesLike

Icon LinkDefined in

contract-factory.ts:28 Icon Link


Icon Linkinterface

interface: Interface<JsonAbi>

Icon LinkDefined in

contract-factory.ts:29 Icon Link


Icon Linkprovider

provider: null | Provider

Icon LinkDefined in

contract-factory.ts:30 Icon Link

Icon LinkMethods

Icon Linkconnect

connect(provider): ContractFactory

Connect the factory to a provider.

Icon LinkParameters

NameTypeDescription
providerProvider The provider to be associated with the factory.

Icon LinkReturns

ContractFactory

A new ContractFactory instance.

Icon LinkDefined in

contract-factory.ts:82 Icon Link


Icon LinkcreateTransactionRequest

createTransactionRequest(deployContractOptions?): Object

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

Icon LinkParameters

NameTypeDescription
deployContractOptions?DeployContractOptions Options for deploying the contract.

Icon LinkReturns

Object

The CreateTransactionRequest object for deploying the contract.

NameType
contractIdstring
transactionRequestCreateTransactionRequest

Icon LinkDefined in

contract-factory.ts:92 Icon Link


Icon LinkdeployContract

deployContract(deployContractOptions?): Promise<Contract >

Deploy a contract with the specified options.

Icon LinkParameters

NameTypeDescription
deployContractOptionsDeployContractOptions Options for deploying the contract.

Icon LinkReturns

Promise<Contract >

A promise that resolves to the deployed contract instance.

Icon LinkDefined in

contract-factory.ts:135 Icon Link


Icon LinksetConfigurableConstants

setConfigurableConstants(configurableConstants): void

Set configurable constants of the contract with the specified values.

Icon LinkParameters

NameTypeDescription
configurableConstantsObjectAn object containing configurable names and their values.

Icon LinkReturns

void

Icon LinkDefined in

contract-factory.ts:167 Icon Link