Skip to main content
A ContractFactory is used to deploy a Contract to the blockchain.

Type parameters

Constructors

new ContractFactory()

Create a new ContractFactory with abi and bytecode, optionally connected to runner. The bytecode may be the bytecode property within the standard Solidity JSON output.

Parameters

Returns

ContractFactory<A, I>

Source

contract/factory.ts:50

Properties

Methods

connect()

Return a new ContractFactory with the same ABI and bytecode, but connected to runner.

Parameters

Returns

ContractFactory<A, I> A new ContractFactory.

Source

contract/factory.ts:218

deploy()

Resolves to the Contract deployed by passing args into the constructor. This will resovle to the Contract before it has been deployed to the network, so the baseContract.waitForDeployment should be used before sending any transactions to it.

Parameters

Returns

Promise<BaseContract & { "deploymentTransaction": ContractTransactionResponse; } & Omit<I, keyof BaseContract>> A promise resolving to the Contract.

Source

contract/factory.ts:126

getDeployTransaction()

Resolves to the transaction to deploy the contract, passing args into the constructor.

Parameters

Returns

Promise<ContractDeployTransaction> A promise resolving to the deployment transaction.

Source

contract/factory.ts:89

fromSolidity()

Create a new ContractFactory from the standard Solidity JSON output.

Type parameters

Parameters

Returns

ContractFactory<A, I> A new ContractFactory.

Source

contract/factory.ts:229