Class: DeployMethod<TContract>
contract.DeployMethod
Contract interaction for deployment. Handles class registration, public instance deployment, and initialization of the contract. Extends the BaseContractInteraction class.
Type parameters
Name | Type |
---|---|
TContract | extends ContractBase = Contract |
Hierarchy
-
BaseContractInteraction
↳
DeployMethod
Constructors
constructor
• new DeployMethod<TContract
>(publicKeys
, wallet
, artifact
, postDeployCtor
, args?
, constructorNameOrArtifact?
): DeployMethod
<TContract
>
Type parameters
Name | Type |
---|---|
TContract | extends ContractBase = Contract |
Parameters
Name | Type | Default value |
---|---|---|
publicKeys | PublicKeys | undefined |
wallet | Wallet | undefined |
artifact | ContractArtifact | undefined |
postDeployCtor | (address : AztecAddress , wallet : Wallet ) => Promise <TContract > | undefined |
args | any [] | [] |
constructorNameOrArtifact? | string | FunctionArtifact | undefined |
Returns
DeployMethod
<TContract
>
Overrides
BaseContractInteraction.constructor
Properties
args
• Private
args: any
[] = []
artifact
• Private
artifact: ContractArtifact
constructorArtifact
• Private
constructorArtifact: undefined
| FunctionArtifact
Constructor function to call.
instance
• Private
Optional
instance: ContractInstanceWithAddress
= undefined
The contract instance to be deployed.
log
• Protected
log: Logger
Inherited from
BaseContractInteraction.log
postDeployCtor
• Private
postDeployCtor: (address
: AztecAddress
, wallet
: Wallet
) => Promise
<TContract
>
Type declaration
▸ (address
, wallet
): Promise
<TContract
>
Parameters
Name | Type |
---|---|
address | AztecAddress |
wallet | Wallet |
Returns
Promise
<TContract
>
publicKeys
• Private
publicKeys: PublicKeys
wallet
• Protected
wallet: Wallet
Inherited from
BaseContractInteraction.wallet
Accessors
address
• get
address(): undefined
| AztecAddress
Return this deployment address.
Returns
undefined
| AztecAddress
partialAddress
• get
partialAddress(): undefined
| Promise
<Fr
>
Returns the partial address for this deployment.
Returns
undefined
| Promise
<Fr
>
Methods
create
▸ create(options?
): Promise
<TxExecutionRequest
>
Create a contract deployment transaction, given the deployment options.
This function internally calls request()
and sign()
methods to prepare
the transaction for deployment. The resulting signed transaction can be
later sent using the send()
method.
Parameters
Name | Type | Description |
---|---|---|
options | DeployOptions | An object containing optional deployment settings, contractAddressSalt, and from. |
Returns
Promise
<TxExecutionRequest
>
A Promise resolving to an object containing the signed transaction data and other relevant information.
Overrides
BaseContractInteraction.create
estimateGas
▸ estimateGas(options?
): Promise
<Pick
<GasSettings
, "gasLimits"
| "teardownGasLimits"
>>
Estimates gas cost for this deployment operation.
Parameters
Name | Type | Description |
---|---|---|
options? | Omit <DeployOptions , "estimateGas" | "skipPublicSimulation" > | Options. |
Returns
Promise
<Pick
<GasSettings
, "gasLimits"
| "teardownGasLimits"
>>
Overrides
BaseContractInteraction.estimateGas
getDefaultFeeOptions
▸ getDefaultFeeOptions(fee
): Promise
<FeeOptions
>
Returns default fee options based on the user opts without running a simulation for gas estimation.
Parameters
Name | Type | Description |
---|---|---|
fee | undefined | UserFeeOptions | User-provided fee options. |
Returns
Promise
<FeeOptions
>
Inherited from
BaseContractInteraction.getDefaultFeeOptions
getDeploymentFunctionCalls
▸ getDeploymentFunctionCalls(options?
): Promise
<Pick
<ExecutionRequestInit
, "hashedArguments"
| "calls"
| "authWitnesses"
>>
Returns calls for registration of the class and deployment of the instance, depending on the provided options.
Parameters
Name | Type | Description |
---|---|---|
options | DeployOptions | Deployment options. |
Returns
Promise
<Pick
<ExecutionRequestInit
, "hashedArguments"
| "calls"
| "authWitnesses"
>>
A function call array with potentially requests to the class registerer and instance deployer.
getFeeOptions
▸ getFeeOptions(request
): Promise
<FeeOptions
>
Return fee options based on the user opts, estimating tx gas if needed.
Parameters
Name | Type | Description |
---|---|---|
request | Omit <ExecutionRequestInit , "fee" > & { fee? : UserFeeOptions } | Request to execute for this interaction. |
Returns
Promise
<FeeOptions
>
Fee options for the actual transaction.
Inherited from
BaseContractInteraction.getFeeOptions
getInitializeFunctionCalls
▸ getInitializeFunctionCalls(options
): Promise
<Pick
<ExecutionRequestInit
, "hashedArguments"
| "calls"
| "authWitnesses"
>>
Returns the calls necessary to initialize the contract.
Parameters
Name | Type | Description |
---|---|---|
options | DeployOptions | Deployment options. |
Returns
Promise
<Pick
<ExecutionRequestInit
, "hashedArguments"
| "calls"
| "authWitnesses"
>>
- An array of function calls.
getInstance
▸ getInstance(options?
): Promise
<ContractInstanceWithAddress
>
Builds the contract instance to be deployed and returns it.
Parameters
Name | Type | Description |
---|---|---|
options | DeployOptions | An object containing various deployment options. |
Returns
Promise
<ContractInstanceWithAddress
>
An instance object.
prove
▸ prove(options
): Promise
<DeployProvenTx
<TContract
>>
Prove the request.
Parameters
Name | Type | Description |
---|---|---|
options | DeployOptions | Deployment options. |
Returns
Promise
<DeployProvenTx
<TContract
>>
The proven tx.
Overrides
BaseContractInteraction.prove