Skip to main content
Version: Next

Class: ContractFactory

Constructors​

constructor​

• new ContractFactory(params): ContractFactory

Parameters​

NameTypeDescription
paramsContractFactoryParamsCFParams - compiledContract: CompiledContract; - account: AccountInterface; - casm?: CairoAssembly; - classHash?: string; - compiledClassHash?: string; - abi?: Abi;

Returns​

ContractFactory

Defined in​

src/contract/contractFactory.ts:46

Properties​

compiledContract​

• compiledContract: CompiledContract

Defined in​

src/contract/contractFactory.ts:23


account​

• account: AccountInterface

Defined in​

src/contract/contractFactory.ts:25


abi​

• abi: Abi

Defined in​

src/contract/contractFactory.ts:27


classHash​

• Optional classHash: string

Defined in​

src/contract/contractFactory.ts:29


casm​

• Optional casm: CairoAssembly

Defined in​

src/contract/contractFactory.ts:31


compiledClassHash​

• Optional compiledClassHash: string

Defined in​

src/contract/contractFactory.ts:33


CallData​

• Private CallData: CallData

Defined in​

src/contract/contractFactory.ts:35

Methods​

deploy​

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

Deploys contract and returns new instance of the Contract

If contract is not declared it will first declare it, and then deploy

Parameters​

NameType
...argsArgsOrCalldataWithOptions

Returns​

Promise<Contract>

Defined in​

src/contract/contractFactory.ts:61


connect​

â–¸ connect(account): ContractFactory

Attaches to new Account

Parameters​

NameTypeDescription
accountAccountInterfacenew Account to attach to

Returns​

ContractFactory

Defined in​

src/contract/contractFactory.ts:101


attach​

â–¸ attach(address): Contract

Attaches current abi and account to the new address

Parameters​

NameType
addressstring

Returns​

Contract

Defined in​

src/contract/contractFactory.ts:109