Icon LinkClass: ContractFactory

@fuel-ts/contract.ContractFactory

ContractFactory provides utilities for deploying and configuring contracts.

Icon LinkConstructors

Icon Linkconstructor

new ContractFactory(bytecode, abi, accountOrProvider?)

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 | AccountnullAn account or provider to be associated with the factory.

Icon LinkDefined in

contract-factory.ts:45 Icon Link

Icon LinkProperties

Icon Linkaccount

account: null | Account

Icon LinkDefined in

contract-factory.ts:36 Icon Link


Icon Linkbytecode

bytecode: BytesLike

Icon LinkDefined in

contract-factory.ts:33 Icon Link


Icon Linkinterface

interface: Interface<JsonAbi>

Icon LinkDefined in

contract-factory.ts:34 Icon Link


Icon Linkprovider

provider: null | Provider

Icon LinkDefined in

contract-factory.ts:35 Icon Link

Icon LinkMethods

Icon Linkconnect

connect(provider): ContractFactory

Connect the factory to a provider.

Icon LinkParameters

NameTypeDescription
providernull | ProviderThe provider to be associated with the factory.

Icon LinkReturns

ContractFactory

A new ContractFactory instance.

Icon LinkDefined in

contract-factory.ts:87 Icon Link


Icon LinkcreateTransactionRequest

createTransactionRequest(deployContractOptions?): Object

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

Icon LinkParameters

NameTypeDescription
deployContractOptions?DeployContractOptionsOptions for deploying the contract.

Icon LinkReturns

Object

The CreateTransactionRequest object for deploying the contract.

NameType
contractIdstring
transactionRequestCreateTransactionRequest

Icon LinkDefined in

contract-factory.ts:97 Icon Link


Icon LinkdeployContract

deployContract(deployContractOptions?): Promise<Contract>

Deploy a contract with the specified options.

Icon LinkParameters

NameTypeDescription
deployContractOptionsDeployContractOptionsOptions for deploying the contract.

Icon LinkReturns

Promise<Contract>

A promise that resolves to the deployed contract instance.

Icon LinkDefined in

contract-factory.ts:134 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:162 Icon Link