Class: ContractFactory
Constructors​
constructor​
• new ContractFactory(params
)
Parameters​
Name | Type | Description |
---|---|---|
params | ContractFactoryParams | CFParams - compiledContract: CompiledContract; - account: AccountInterface; - casm?: CairoAssembly; - classHash?: string; - compiledClassHash?: string; - abi?: Abi; |
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​
Name | Type | Description |
---|---|---|
...args | ArgsOrCalldataWithOptions | Array of the constructor arguments for deployment |
Returns​
Promise
<Contract
>
deployed Contract
Defined in​
src/contract/contractFactory.ts:64
connect​
â–¸ connect(account
): ContractFactory
Attaches to new Account
Parameters​
Name | Type | Description |
---|---|---|
account | AccountInterface | new Provider or Account to attach to |
Returns​
ContractFactory
Defined in​
src/contract/contractFactory.ts:105
attach​
â–¸ attach(address
): Contract
Attaches current abi and account to the new address
Parameters​
Name | Type | Description |
---|---|---|
address | string | Contract address |
Returns​
Contract