注意: 此页面尚未翻译成中文。以下内容为英文原版。A ContractFactory is used to deploy a Contract to the blockchain.
Type parameter | Value |
---|---|
A extends any [] | any [] |
I | BaseContract |
abi
and bytecode
, optionally connected to runner
.
The bytecode
may be the bytecode
property within the standard Solidity JSON output.
Parameter | Type | Default value |
---|---|---|
abi | Interface | InterfaceAbi | undefined |
bytecode | BytesLike | { "object" : string ; } | undefined |
runner ? | null | ContractRunner | undefined |
IPFSHash ? | null | string | null |
ContractFactory
<A
, I
>
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. |
runner
.
Parameter | Type | Description |
---|---|---|
runner | null | ContractRunner | The runner to connect to. |
ContractFactory
<A
, I
>
A new ContractFactory.
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.
Parameter | Type | Description |
---|---|---|
…args | ContractMethodArgs <A > | The arguments to the constructor. |
Promise
<BaseContract
& {
"deploymentTransaction"
: ContractTransactionResponse
;
} & Omit
<I
, keyof BaseContract
>>
A promise resolving to the Contract.
args
into the constructor.
Parameter | Type | Description |
---|---|---|
…args | ContractMethodArgs <A > | The arguments to the constructor. |
Promise
<ContractDeployTransaction
>
A promise resolving to the deployment transaction.
Type parameter | Value |
---|---|
A extends any [] | any [] |
I | ContractInterface |
Parameter | Type | Description |
---|---|---|
output | any | The Solidity JSON output. |
runner ? | ContractRunner | The runner to connect to. |
ContractFactory
<A
, I
>
A new ContractFactory.