Skip to main content
Version: 5.14.1

Class: ContractFactory

Constructors​

constructor​

• new ContractFactory(compiledContract, classHash, account, abi?)

Parameters​

NameTypeDefault value
compiledContractCompiledContractundefined
classHashstringundefined
accountAccountInterfaceundefined
abiAbicompiledContract.abi

Defined in​

src/contract/contractFactory.ts:18

Properties​

abi​

• abi: Abi

Defined in​

src/contract/contractFactory.ts:8


compiledContract​

• compiledContract: CompiledContract

Defined in​

src/contract/contractFactory.ts:10


classHash​

• classHash: string

Defined in​

src/contract/contractFactory.ts:12


account​

• account: AccountInterface

Defined in​

src/contract/contractFactory.ts:14


CallData​

• Private CallData: CallData

Defined in​

src/contract/contractFactory.ts:16

Methods​

deploy​

â–¸ deploy(...args): Promise<Contract>

Deploys contract and returns new instance of the Contract

Parameters​

NameTypeDescription
...argsArgsOrCalldataWithOptionsArray of the constructor arguments for deployment

Returns​

Promise<Contract>

deployed Contract

Defined in​

src/contract/contractFactory.ts:38


connect​

â–¸ connect(account): ContractFactory

Attaches to new Account

Parameters​

NameTypeDescription
accountAccountInterfacenew Provider or Account to attach to

Returns​

ContractFactory

ContractFactory

Defined in​

src/contract/contractFactory.ts:76


attach​

â–¸ attach(address): Contract

Attaches current abi and account to the new address

Parameters​

NameTypeDescription
addressstringContract address

Returns​

Contract

Contract

Defined in​

src/contract/contractFactory.ts:87