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
bytecodeBytesLike undefinedThe 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

Icon LinkDefined in

Icon LinkProperties

Icon Linkaccount

account: null | Account

Icon LinkDefined in


Icon Linkbytecode

bytecode: BytesLike

Icon LinkDefined in


Icon Linkinterface

interface: Interface<JsonAbi>

Icon LinkDefined in


Icon Linkprovider

provider: null | Provider

Icon LinkDefined in

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

A new ContractFactory instance.

Icon LinkDefined in


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


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


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