@fuel-ts/contract .ContractFactory
ContractFactory
provides utilities for deploying and configuring contracts.
• new ContractFactory(bytecode
, abi
, accountOrProvider?
): ContractFactory
Create a ContractFactory instance.
Name | Type | Default value | Description |
---|---|---|---|
bytecode | BytesLike | undefined | The bytecode of the contract. |
abi | JsonAbi | Interface <JsonAbi > | undefined | The contract's ABI (Application Binary Interface). |
accountOrProvider | null | Provider | Account | null | An account or provider to be associated with the factory. |
• account: null
| Account
• bytecode: BytesLike
• interface: Interface
<JsonAbi
>
• provider: null
| Provider
▸ connect(provider
): ContractFactory
Connect the factory to a provider.
Name | Type | Description |
---|---|---|
provider | Provider | The provider to be associated with the factory. |
A new ContractFactory instance.
▸ createTransactionRequest(deployContractOptions?
): Object
Create a transaction request to deploy a contract with the specified options.
Name | Type | Description |
---|---|---|
deployContractOptions? | DeployContractOptions | Options for deploying the contract. |
Object
The CreateTransactionRequest object for deploying the contract.
Name | Type |
---|---|
contractId | string |
transactionRequest | CreateTransactionRequest |
▸ deployContract(deployContractOptions?
): Promise
<Contract
>
Deploy a contract with the specified options.
Name | Type | Description |
---|---|---|
deployContractOptions | DeployContractOptions | Options for deploying the contract. |
Promise
<Contract
>
A promise that resolves to the deployed contract instance.
▸ setConfigurableConstants(configurableConstants
): void
Set configurable constants of the contract with the specified values.
Name | Type | Description |
---|---|---|
configurableConstants | Object | An object containing configurable names and their values. |
void