注意: このページはまだ日本語に翻訳されていません。以下は英語の原文です。A ContractFactory is used to deploy a Contract to the blockchain.
Type parameters
Type parameter | Value |
---|---|
A extends any [] | any [] |
I | BaseContract |
Constructors
new ContractFactory()
abi
and bytecode
, optionally connected to runner
.
The bytecode
may be the bytecode
property within the standard Solidity JSON output.
Parameters
Parameter | Type | Default value |
---|---|---|
abi | Interface | InterfaceAbi | undefined |
bytecode | BytesLike | { "object" : string ; } | undefined |
runner ? | null | ContractRunner | undefined |
IPFSHash ? | null | string | null |
Returns
ContractFactory
<A
, I
>
Source
contract/factory.ts:50Properties
Property | Modifier | Type | Description |
---|---|---|---|
bytecode | readonly | string | The Contract deployment bytecode. Often called the initcode. |
interface | readonly | Interface | The Contract Interface. |
runner | readonly | null | ContractRunner | The ContractRunner to deploy the Contract as. |
Methods
connect()
runner
.
Parameters
Parameter | Type | Description |
---|---|---|
runner | null | ContractRunner | The runner to connect to. |
Returns
ContractFactory
<A
, I
>
A new ContractFactory.
Source
contract/factory.ts:218deploy()
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
Parameter | Type | Description |
---|---|---|
…args | ContractMethodArgs <A > | The arguments to the constructor. |
Returns
Promise
<BaseContract
& {
"deploymentTransaction"
: ContractTransactionResponse
;
} & Omit
<I
, keyof BaseContract
>>
A promise resolving to the Contract.
Source
contract/factory.ts:126getDeployTransaction()
args
into the constructor.
Parameters
Parameter | Type | Description |
---|---|---|
…args | ContractMethodArgs <A > | The arguments to the constructor. |
Returns
Promise
<ContractDeployTransaction
>
A promise resolving to the deployment transaction.
Source
contract/factory.ts:89fromSolidity()
Type parameters
Type parameter | Value |
---|---|
A extends any [] | any [] |
I | ContractInterface |
Parameters
Parameter | Type | Description |
---|---|---|
output | any | The Solidity JSON output. |
runner ? | ContractRunner | The runner to connect to. |
Returns
ContractFactory
<A
, I
>
A new ContractFactory.