@aztec/aztec.js 3.0.0-canary.a9708bd → 3.0.0-devnet.2-patch.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dest/account/account.d.ts +59 -0
- package/dest/account/account.d.ts.map +1 -0
- package/dest/account/account.js +59 -0
- package/dest/account/account_contract.d.ts +7 -7
- package/dest/account/account_contract.d.ts.map +1 -1
- package/dest/account/account_contract.js +0 -1
- package/dest/account/account_with_secret_key.d.ts +24 -0
- package/dest/account/account_with_secret_key.d.ts.map +1 -0
- package/dest/{wallet/account_wallet_with_private_key.js → account/account_with_secret_key.js} +5 -5
- package/dest/account/index.d.ts +3 -6
- package/dest/account/index.d.ts.map +1 -1
- package/dest/account/index.js +1 -4
- package/dest/account/interface.d.ts +2 -2
- package/dest/account/interface.d.ts.map +1 -1
- package/dest/account/signerless_account.d.ts +23 -0
- package/dest/account/signerless_account.d.ts.map +1 -0
- package/dest/account/signerless_account.js +27 -0
- package/dest/api/abi.d.ts +2 -1
- package/dest/api/abi.d.ts.map +1 -1
- package/dest/api/account.d.ts +6 -3
- package/dest/api/account.d.ts.map +1 -1
- package/dest/api/account.js +4 -1
- package/dest/api/addresses.d.ts +2 -1
- package/dest/api/addresses.d.ts.map +1 -1
- package/dest/api/addresses.js +1 -0
- package/dest/api/authorization.d.ts +3 -1
- package/dest/api/authorization.d.ts.map +1 -1
- package/dest/api/authorization.js +2 -0
- package/dest/api/block.d.ts +3 -0
- package/dest/api/block.d.ts.map +1 -0
- package/dest/api/block.js +2 -0
- package/dest/api/contract.d.ts +8 -9
- package/dest/api/contract.d.ts.map +1 -1
- package/dest/api/contract.js +6 -6
- package/dest/api/crypto.d.ts +2 -0
- package/dest/api/crypto.d.ts.map +1 -0
- package/dest/api/crypto.js +1 -0
- package/dest/api/deployment.d.ts +1 -1
- package/dest/api/eth_address.d.ts +1 -1
- package/dest/api/ethereum.d.ts +1 -2
- package/dest/api/ethereum.d.ts.map +1 -1
- package/dest/api/ethereum.js +0 -1
- package/dest/api/events.d.ts +12 -0
- package/dest/api/events.d.ts.map +1 -0
- package/dest/api/events.js +30 -0
- package/dest/api/fee.d.ts +2 -3
- package/dest/api/fee.d.ts.map +1 -1
- package/dest/api/fee.js +0 -1
- package/dest/api/fee_testing.d.ts +1 -1
- package/dest/api/fields.d.ts +3 -2
- package/dest/api/fields.d.ts.map +1 -1
- package/dest/api/fields.js +2 -1
- package/dest/api/keys.d.ts +4 -0
- package/dest/api/keys.d.ts.map +1 -0
- package/dest/api/keys.js +3 -0
- package/dest/api/log.d.ts +2 -1
- package/dest/api/log.d.ts.map +1 -1
- package/dest/api/log.js +1 -0
- package/dest/api/messaging.d.ts +3 -0
- package/dest/api/messaging.d.ts.map +1 -0
- package/dest/api/messaging.js +2 -0
- package/dest/api/node.d.ts +21 -0
- package/dest/api/node.d.ts.map +1 -0
- package/dest/api/node.js +18 -0
- package/dest/api/note.d.ts +2 -0
- package/dest/api/note.d.ts.map +1 -0
- package/dest/api/note.js +1 -0
- package/dest/api/protocol.d.ts +3 -0
- package/dest/api/protocol.d.ts.map +1 -0
- package/dest/api/protocol.js +2 -0
- package/dest/api/trees.d.ts +3 -0
- package/dest/api/trees.d.ts.map +1 -0
- package/dest/api/trees.js +2 -0
- package/dest/api/tx.d.ts +2 -0
- package/dest/api/tx.d.ts.map +1 -0
- package/dest/api/tx.js +1 -0
- package/dest/api/utils.d.ts +11 -7
- package/dest/api/utils.d.ts.map +1 -1
- package/dest/api/utils.js +10 -5
- package/dest/api/wallet.d.ts +4 -2
- package/dest/api/wallet.d.ts.map +1 -1
- package/dest/api/wallet.js +3 -1
- package/dest/authorization/call_authorization_request.d.ts +2 -23
- package/dest/authorization/call_authorization_request.d.ts.map +1 -1
- package/dest/contract/base_contract_interaction.d.ts +7 -50
- package/dest/contract/base_contract_interaction.d.ts.map +1 -1
- package/dest/contract/base_contract_interaction.js +6 -106
- package/dest/contract/batch_call.d.ts +14 -23
- package/dest/contract/batch_call.d.ts.map +1 -1
- package/dest/contract/batch_call.js +72 -64
- package/dest/contract/checker.d.ts +1 -1
- package/dest/contract/contract.d.ts +3 -3
- package/dest/contract/contract.d.ts.map +1 -1
- package/dest/contract/contract.js +5 -16
- package/dest/contract/contract_base.d.ts +5 -12
- package/dest/contract/contract_base.d.ts.map +1 -1
- package/dest/contract/contract_base.js +5 -12
- package/dest/contract/contract_function_interaction.d.ts +32 -43
- package/dest/contract/contract_function_interaction.d.ts.map +1 -1
- package/dest/contract/contract_function_interaction.js +47 -56
- package/dest/contract/deploy_method.d.ts +69 -61
- package/dest/contract/deploy_method.d.ts.map +1 -1
- package/dest/contract/deploy_method.js +72 -88
- package/dest/contract/deploy_sent_tx.d.ts +12 -8
- package/dest/contract/deploy_sent_tx.d.ts.map +1 -1
- package/dest/contract/deploy_sent_tx.js +15 -12
- package/dest/contract/get_gas_limits.d.ts +1 -1
- package/dest/contract/interaction_options.d.ts +76 -21
- package/dest/contract/interaction_options.d.ts.map +1 -1
- package/dest/contract/interaction_options.js +45 -3
- package/dest/contract/protocol_contracts.d.ts +1 -1
- package/dest/contract/sent_tx.d.ts +5 -6
- package/dest/contract/sent_tx.d.ts.map +1 -1
- package/dest/contract/sent_tx.js +6 -6
- package/dest/contract/unsafe_contract.d.ts +1 -1
- package/dest/contract/unsafe_contract.d.ts.map +1 -1
- package/dest/contract/unsafe_contract.js +1 -1
- package/dest/contract/wait_for_proven.d.ts +4 -4
- package/dest/contract/wait_for_proven.d.ts.map +1 -1
- package/dest/contract/wait_for_proven.js +2 -2
- package/dest/deployment/broadcast_function.d.ts +1 -1
- package/dest/deployment/broadcast_function.js +1 -1
- package/dest/deployment/contract_deployer.d.ts +1 -1
- package/dest/deployment/contract_deployer.d.ts.map +1 -1
- package/dest/deployment/contract_deployer.js +1 -1
- package/dest/deployment/publish_class.d.ts +1 -1
- package/dest/deployment/publish_class.js +1 -1
- package/dest/deployment/publish_instance.d.ts +2 -2
- package/dest/deployment/publish_instance.d.ts.map +1 -1
- package/dest/deployment/publish_instance.js +2 -5
- package/dest/ethereum/portal_manager.d.ts +7 -10
- package/dest/ethereum/portal_manager.d.ts.map +1 -1
- package/dest/ethereum/portal_manager.js +43 -19
- package/dest/fee/fee_juice_payment_method_with_claim.d.ts +14 -9
- package/dest/fee/fee_juice_payment_method_with_claim.d.ts.map +1 -1
- package/dest/fee/fee_juice_payment_method_with_claim.js +24 -15
- package/dest/fee/fee_payment_method.d.ts +26 -0
- package/dest/fee/fee_payment_method.d.ts.map +1 -0
- package/dest/fee/fee_payment_method.js +3 -0
- package/dest/fee/private_fee_payment_method.d.ts +24 -7
- package/dest/fee/private_fee_payment_method.d.ts.map +1 -1
- package/dest/fee/private_fee_payment_method.js +38 -17
- package/dest/fee/public_fee_payment_method.d.ts +24 -7
- package/dest/fee/public_fee_payment_method.d.ts.map +1 -1
- package/dest/fee/public_fee_payment_method.js +41 -18
- package/dest/fee/sponsored_fee_payment.d.ts +4 -2
- package/dest/fee/sponsored_fee_payment.d.ts.map +1 -1
- package/dest/fee/sponsored_fee_payment.js +6 -2
- package/dest/utils/abi_types.d.ts +2 -2
- package/dest/utils/abi_types.d.ts.map +1 -1
- package/dest/utils/authwit.d.ts +80 -28
- package/dest/utils/authwit.d.ts.map +1 -1
- package/dest/utils/authwit.js +231 -25
- package/dest/utils/cross_chain.d.ts +24 -0
- package/dest/utils/cross_chain.d.ts.map +1 -0
- package/dest/utils/cross_chain.js +30 -0
- package/dest/utils/fee_juice.d.ts +4 -3
- package/dest/utils/fee_juice.d.ts.map +1 -1
- package/dest/utils/fee_juice.js +4 -3
- package/dest/utils/field_compressed_string.d.ts +1 -1
- package/dest/utils/field_compressed_string.d.ts.map +1 -1
- package/dest/utils/field_compressed_string.js +1 -1
- package/dest/utils/node.d.ts +2 -2
- package/dest/utils/node.d.ts.map +1 -1
- package/dest/utils/pub_key.d.ts +2 -2
- package/dest/utils/pub_key.d.ts.map +1 -1
- package/dest/utils/pub_key.js +2 -3
- package/dest/wallet/account_entrypoint_meta_payment_method.d.ts +34 -0
- package/dest/wallet/account_entrypoint_meta_payment_method.d.ts.map +1 -0
- package/dest/wallet/account_entrypoint_meta_payment_method.js +76 -0
- package/dest/wallet/account_manager.d.ts +66 -0
- package/dest/wallet/account_manager.d.ts.map +1 -0
- package/dest/wallet/account_manager.js +113 -0
- package/dest/wallet/deploy_account_method.d.ts +52 -0
- package/dest/wallet/deploy_account_method.d.ts.map +1 -0
- package/dest/wallet/deploy_account_method.js +77 -0
- package/dest/wallet/index.d.ts +2 -16
- package/dest/wallet/index.d.ts.map +1 -1
- package/dest/wallet/index.js +1 -19
- package/dest/wallet/wallet.d.ts +2012 -7
- package/dest/wallet/wallet.d.ts.map +1 -1
- package/dest/wallet/wallet.js +198 -3
- package/package.json +29 -24
- package/src/account/account.ts +96 -0
- package/src/account/account_contract.ts +5 -7
- package/src/{wallet/account_wallet_with_private_key.ts → account/account_with_secret_key.ts} +7 -9
- package/src/account/index.ts +2 -5
- package/src/account/interface.ts +1 -1
- package/src/account/signerless_account.ts +45 -0
- package/src/api/abi.ts +11 -0
- package/src/api/account.ts +5 -2
- package/src/api/addresses.ts +1 -0
- package/src/api/authorization.ts +11 -0
- package/src/api/block.ts +2 -0
- package/src/api/contract.ts +20 -11
- package/src/api/crypto.ts +1 -0
- package/src/api/ethereum.ts +0 -1
- package/src/api/events.ts +44 -0
- package/src/api/fee.ts +1 -2
- package/src/api/fields.ts +2 -1
- package/src/api/keys.ts +8 -0
- package/src/api/log.ts +1 -0
- package/src/api/messaging.ts +2 -0
- package/src/api/node.ts +20 -0
- package/src/api/note.ts +1 -0
- package/src/api/protocol.ts +2 -0
- package/src/api/trees.ts +2 -0
- package/src/api/tx.ts +13 -0
- package/src/api/utils.ts +12 -19
- package/src/api/wallet.ts +31 -5
- package/src/authorization/call_authorization_request.ts +1 -1
- package/src/contract/base_contract_interaction.ts +9 -139
- package/src/contract/batch_call.ts +87 -79
- package/src/contract/contract.ts +8 -16
- package/src/contract/contract_base.ts +5 -15
- package/src/contract/contract_function_interaction.ts +72 -105
- package/src/contract/deploy_method.ts +123 -104
- package/src/contract/deploy_sent_tx.ts +19 -18
- package/src/contract/interaction_options.ts +121 -25
- package/src/contract/sent_tx.ts +6 -7
- package/src/contract/unsafe_contract.ts +1 -1
- package/src/contract/wait_for_proven.ts +4 -4
- package/src/deployment/broadcast_function.ts +1 -1
- package/src/deployment/contract_deployer.ts +3 -2
- package/src/deployment/publish_class.ts +1 -1
- package/src/deployment/publish_instance.ts +3 -8
- package/src/ethereum/portal_manager.ts +62 -40
- package/src/fee/fee_juice_payment_method_with_claim.ts +30 -19
- package/src/fee/fee_payment_method.ts +26 -0
- package/src/fee/private_fee_payment_method.ts +64 -43
- package/src/fee/public_fee_payment_method.ts +77 -51
- package/src/fee/sponsored_fee_payment.ts +9 -1
- package/src/utils/abi_types.ts +1 -1
- package/src/utils/authwit.ts +257 -39
- package/src/utils/cross_chain.ts +53 -0
- package/src/utils/fee_juice.ts +5 -4
- package/src/utils/field_compressed_string.ts +1 -1
- package/src/utils/pub_key.ts +3 -4
- package/src/wallet/account_entrypoint_meta_payment_method.ts +106 -0
- package/src/wallet/account_manager.ts +154 -0
- package/src/wallet/deploy_account_method.ts +126 -0
- package/src/wallet/index.ts +1 -32
- package/src/wallet/wallet.ts +358 -29
- package/dest/account_manager/account_manager.d.ts +0 -119
- package/dest/account_manager/account_manager.d.ts.map +0 -1
- package/dest/account_manager/account_manager.js +0 -202
- package/dest/account_manager/deploy_account_sent_tx.d.ts +0 -30
- package/dest/account_manager/deploy_account_sent_tx.d.ts.map +0 -1
- package/dest/account_manager/deploy_account_sent_tx.js +0 -29
- package/dest/account_manager/index.d.ts +0 -3
- package/dest/account_manager/index.d.ts.map +0 -1
- package/dest/account_manager/index.js +0 -2
- package/dest/api/interfaces.d.ts +0 -2
- package/dest/api/interfaces.d.ts.map +0 -1
- package/dest/api/interfaces.js +0 -1
- package/dest/api/log_id.d.ts +0 -2
- package/dest/api/log_id.d.ts.map +0 -1
- package/dest/api/log_id.js +0 -1
- package/dest/api/rpc.d.ts +0 -3
- package/dest/api/rpc.d.ts.map +0 -1
- package/dest/api/rpc.js +0 -2
- package/dest/api/tx_hash.d.ts +0 -2
- package/dest/api/tx_hash.d.ts.map +0 -1
- package/dest/api/tx_hash.js +0 -1
- package/dest/contract/deploy_proven_tx.d.ts +0 -21
- package/dest/contract/deploy_proven_tx.d.ts.map +0 -1
- package/dest/contract/deploy_proven_tx.js +0 -21
- package/dest/contract/proven_tx.d.ts +0 -21
- package/dest/contract/proven_tx.d.ts.map +0 -1
- package/dest/contract/proven_tx.js +0 -23
- package/dest/ethereum/l1_contracts.d.ts +0 -3
- package/dest/ethereum/l1_contracts.d.ts.map +0 -1
- package/dest/ethereum/l1_contracts.js +0 -13
- package/dest/fee/account_entrypoint_meta_payment_method.d.ts +0 -31
- package/dest/fee/account_entrypoint_meta_payment_method.d.ts.map +0 -1
- package/dest/fee/account_entrypoint_meta_payment_method.js +0 -64
- package/dest/fee/fee_juice_payment_method.d.ts +0 -14
- package/dest/fee/fee_juice_payment_method.d.ts.map +0 -1
- package/dest/fee/fee_juice_payment_method.js +0 -21
- package/dest/fee/utils.d.ts +0 -13
- package/dest/fee/utils.d.ts.map +0 -1
- package/dest/fee/utils.js +0 -32
- package/dest/index.d.ts +0 -59
- package/dest/index.d.ts.map +0 -1
- package/dest/index.js +0 -62
- package/dest/rpc_clients/node/index.d.ts +0 -12
- package/dest/rpc_clients/node/index.d.ts.map +0 -1
- package/dest/rpc_clients/node/index.js +0 -72
- package/dest/rpc_clients/pxe_client.d.ts +0 -10
- package/dest/rpc_clients/pxe_client.d.ts.map +0 -1
- package/dest/rpc_clients/pxe_client.js +0 -23
- package/dest/utils/pxe.d.ts +0 -4
- package/dest/utils/pxe.d.ts.map +0 -1
- package/dest/utils/pxe.js +0 -14
- package/dest/wallet/account_wallet.d.ts +0 -74
- package/dest/wallet/account_wallet.d.ts.map +0 -1
- package/dest/wallet/account_wallet.js +0 -232
- package/dest/wallet/account_wallet_with_private_key.d.ts +0 -26
- package/dest/wallet/account_wallet_with_private_key.d.ts.map +0 -1
- package/dest/wallet/base_wallet.d.ts +0 -48
- package/dest/wallet/base_wallet.d.ts.map +0 -1
- package/dest/wallet/base_wallet.js +0 -70
- package/dest/wallet/signerless_wallet.d.ts +0 -23
- package/dest/wallet/signerless_wallet.d.ts.map +0 -1
- package/dest/wallet/signerless_wallet.js +0 -33
- package/src/account_manager/account_manager.ts +0 -276
- package/src/account_manager/deploy_account_sent_tx.ts +0 -46
- package/src/account_manager/index.ts +0 -2
- package/src/api/interfaces.ts +0 -1
- package/src/api/log_id.ts +0 -1
- package/src/api/rpc.ts +0 -2
- package/src/api/tx_hash.ts +0 -1
- package/src/contract/deploy_proven_tx.ts +0 -45
- package/src/contract/proven_tx.ts +0 -36
- package/src/ethereum/l1_contracts.ts +0 -21
- package/src/fee/account_entrypoint_meta_payment_method.ts +0 -89
- package/src/fee/fee_juice_payment_method.ts +0 -25
- package/src/fee/utils.ts +0 -39
- package/src/index.ts +0 -85
- package/src/rpc_clients/node/index.ts +0 -77
- package/src/rpc_clients/pxe_client.ts +0 -25
- package/src/utils/pxe.ts +0 -17
- package/src/wallet/account_wallet.ts +0 -246
- package/src/wallet/base_wallet.ts +0 -141
- package/src/wallet/signerless_wallet.ts +0 -56
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { ExecutionPayload } from '@aztec/entrypoints/payload';
|
|
2
1
|
import { FunctionSelector, FunctionType, decodeFromAbi, encodeArguments } from '@aztec/stdlib/abi';
|
|
3
|
-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
2
|
import { collectOffchainEffects } from '@aztec/stdlib/tx';
|
|
3
|
+
import { ExecutionPayload, mergeExecutionPayloads } from '@aztec/stdlib/tx';
|
|
5
4
|
import { BaseContractInteraction } from './base_contract_interaction.js';
|
|
5
|
+
import { getGasLimits } from './get_gas_limits.js';
|
|
6
|
+
import { toProfileOptions, toSimulateOptions } from './interaction_options.js';
|
|
6
7
|
/**
|
|
7
8
|
* This is the class that is returned when calling e.g. `contract.methods.myMethod(arg0, arg1)`.
|
|
8
9
|
* It contains available interactions one can call on a method, including view.
|
|
@@ -17,67 +18,59 @@ import { BaseContractInteraction } from './base_contract_interaction.js';
|
|
|
17
18
|
throw new Error(`All function interaction arguments must be defined and not null. Received: ${args}`);
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
|
-
// docs:start:create
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* @
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
return await this.wallet.createTxExecutionRequest(requestWithoutFee, fee, {
|
|
38
|
-
txNonce,
|
|
39
|
-
cancellable
|
|
40
|
-
});
|
|
22
|
+
* Returns the encoded function call wrapped by this interaction
|
|
23
|
+
* Useful when generating authwits
|
|
24
|
+
* @returns An encoded function call
|
|
25
|
+
*/ async getFunctionCall() {
|
|
26
|
+
const args = encodeArguments(this.functionDao, this.args);
|
|
27
|
+
return {
|
|
28
|
+
name: this.functionDao.name,
|
|
29
|
+
args,
|
|
30
|
+
selector: await FunctionSelector.fromNameAndParameters(this.functionDao.name, this.functionDao.parameters),
|
|
31
|
+
type: this.functionDao.functionType,
|
|
32
|
+
to: this.contractAddress,
|
|
33
|
+
isStatic: this.functionDao.isStatic,
|
|
34
|
+
hideMsgSender: false,
|
|
35
|
+
returnTypes: this.functionDao.returnTypes
|
|
36
|
+
};
|
|
41
37
|
}
|
|
42
|
-
// docs:start:request
|
|
43
38
|
/**
|
|
44
|
-
* Returns
|
|
45
|
-
*
|
|
46
|
-
* @
|
|
47
|
-
* @returns An execution payload wrapped in promise.
|
|
39
|
+
* Returns the execution payload that allows this operation to happen on chain.
|
|
40
|
+
* @param options - Configuration options.
|
|
41
|
+
* @returns The execution payload for this operation
|
|
48
42
|
*/ async request(options = {}) {
|
|
49
|
-
// docs:end:request
|
|
50
|
-
const args = encodeArguments(this.functionDao, this.args);
|
|
51
43
|
const calls = [
|
|
52
|
-
|
|
53
|
-
name: this.functionDao.name,
|
|
54
|
-
args,
|
|
55
|
-
selector: await FunctionSelector.fromNameAndParameters(this.functionDao.name, this.functionDao.parameters),
|
|
56
|
-
type: this.functionDao.functionType,
|
|
57
|
-
to: this.contractAddress,
|
|
58
|
-
isStatic: this.functionDao.isStatic,
|
|
59
|
-
returnTypes: this.functionDao.returnTypes
|
|
60
|
-
}
|
|
44
|
+
await this.getFunctionCall()
|
|
61
45
|
];
|
|
62
46
|
const { authWitnesses, capsules } = options;
|
|
63
|
-
|
|
47
|
+
const feeExecutionPayload = options.fee?.paymentMethod ? await options.fee.paymentMethod.getExecutionPayload() : undefined;
|
|
48
|
+
const functionExecutionPayload = new ExecutionPayload(calls, this.authWitnesses.concat(authWitnesses ?? []), this.capsules.concat(capsules ?? []), this.extraHashedArgs);
|
|
49
|
+
const finalExecutionPayload = feeExecutionPayload ? mergeExecutionPayloads([
|
|
50
|
+
feeExecutionPayload,
|
|
51
|
+
functionExecutionPayload
|
|
52
|
+
]) : functionExecutionPayload;
|
|
53
|
+
return finalExecutionPayload;
|
|
64
54
|
}
|
|
65
55
|
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
66
56
|
async simulate(options) {
|
|
67
57
|
// docs:end:simulate
|
|
68
58
|
if (this.functionDao.functionType == FunctionType.UTILITY) {
|
|
69
|
-
const
|
|
59
|
+
const call = await this.getFunctionCall();
|
|
60
|
+
const utilityResult = await this.wallet.simulateUtility(call, options.authWitnesses ?? []);
|
|
61
|
+
// Decode the raw field elements to the actual return type
|
|
62
|
+
const returnValue = utilityResult.result ? decodeFromAbi(this.functionDao.returnTypes, utilityResult.result) : [];
|
|
70
63
|
if (options.includeMetadata) {
|
|
71
64
|
return {
|
|
72
65
|
stats: utilityResult.stats,
|
|
73
|
-
result:
|
|
66
|
+
result: returnValue
|
|
74
67
|
};
|
|
75
68
|
} else {
|
|
76
|
-
return
|
|
69
|
+
return returnValue;
|
|
77
70
|
}
|
|
78
71
|
}
|
|
79
|
-
const
|
|
80
|
-
const simulatedTx = await this.wallet.simulateTx(
|
|
72
|
+
const executionPayload = await this.request(options);
|
|
73
|
+
const simulatedTx = await this.wallet.simulateTx(executionPayload, toSimulateOptions(options));
|
|
81
74
|
let rawReturnValues;
|
|
82
75
|
if (this.functionDao.functionType == FunctionType.PRIVATE) {
|
|
83
76
|
if (simulatedTx.getPrivateReturnValues().nested.length > 0) {
|
|
@@ -93,11 +86,17 @@ import { BaseContractInteraction } from './base_contract_interaction.js';
|
|
|
93
86
|
rawReturnValues = simulatedTx.getPublicReturnValues()?.[0]?.values;
|
|
94
87
|
}
|
|
95
88
|
const returnValue = rawReturnValues ? decodeFromAbi(this.functionDao.returnTypes, rawReturnValues) : [];
|
|
96
|
-
if (options.includeMetadata) {
|
|
89
|
+
if (options.includeMetadata || options.fee?.estimateGas) {
|
|
90
|
+
const { gasLimits, teardownGasLimits } = getGasLimits(simulatedTx, options.fee?.estimatedGasPadding);
|
|
91
|
+
this.log.verbose(`Estimated gas limits for tx: DA=${gasLimits.daGas} L2=${gasLimits.l2Gas} teardownDA=${teardownGasLimits.daGas} teardownL2=${teardownGasLimits.l2Gas}`);
|
|
97
92
|
return {
|
|
98
93
|
stats: simulatedTx.stats,
|
|
99
94
|
offchainEffects: collectOffchainEffects(simulatedTx.privateExecutionResult),
|
|
100
|
-
result: returnValue
|
|
95
|
+
result: returnValue,
|
|
96
|
+
estimatedGas: {
|
|
97
|
+
gasLimits,
|
|
98
|
+
teardownGasLimits
|
|
99
|
+
}
|
|
101
100
|
};
|
|
102
101
|
} else {
|
|
103
102
|
return returnValue;
|
|
@@ -109,19 +108,11 @@ import { BaseContractInteraction } from './base_contract_interaction.js';
|
|
|
109
108
|
*
|
|
110
109
|
* @returns An object containing the function return value and profile result.
|
|
111
110
|
*/ async profile(options) {
|
|
112
|
-
if (options.from !== AztecAddress.ZERO && !options.from.equals(this.wallet.getAddress())) {
|
|
113
|
-
throw new Error(`The address provided as from does not match the wallet address. Expected ${this.wallet.getAddress().toString()}, got ${options.from.toString()}.`);
|
|
114
|
-
}
|
|
115
111
|
if (this.functionDao.functionType == FunctionType.UTILITY) {
|
|
116
112
|
throw new Error("Can't profile a utility function.");
|
|
117
113
|
}
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
fee,
|
|
121
|
-
authWitnesses,
|
|
122
|
-
capsules
|
|
123
|
-
});
|
|
124
|
-
return await this.wallet.profileTx(txRequest, options.profileMode, options.skipProofGeneration, options?.from);
|
|
114
|
+
const executionPayload = await this.request(options);
|
|
115
|
+
return await this.wallet.profileTx(executionPayload, toProfileOptions(options));
|
|
125
116
|
}
|
|
126
117
|
/**
|
|
127
118
|
* Augments this ContractFunctionInteraction with additional metadata, such as authWitnesses, capsules, and extraHashedArgs.
|
|
@@ -1,35 +1,65 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { Fr } from '@aztec/foundation/fields';
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
2
|
import { type ContractArtifact, type FunctionArtifact } from '@aztec/stdlib/abi';
|
|
4
3
|
import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
5
4
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
6
5
|
import { type ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
7
|
-
import type { GasSettings } from '@aztec/stdlib/gas';
|
|
8
6
|
import type { PublicKeys } from '@aztec/stdlib/keys';
|
|
9
|
-
import type
|
|
7
|
+
import { type Capsule, type TxProfileResult } from '@aztec/stdlib/tx';
|
|
8
|
+
import { ExecutionPayload } from '@aztec/stdlib/tx';
|
|
10
9
|
import type { Wallet } from '../wallet/wallet.js';
|
|
11
10
|
import { BaseContractInteraction } from './base_contract_interaction.js';
|
|
12
|
-
import type { Contract } from './contract.js';
|
|
13
11
|
import type { ContractBase } from './contract_base.js';
|
|
14
|
-
import { DeployProvenTx } from './deploy_proven_tx.js';
|
|
15
12
|
import { DeploySentTx } from './deploy_sent_tx.js';
|
|
16
|
-
import type
|
|
13
|
+
import { type ProfileInteractionOptions, type RequestInteractionOptions, type SendInteractionOptions, type SimulationInteractionFeeOptions, type SimulationReturn } from './interaction_options.js';
|
|
17
14
|
/**
|
|
18
15
|
* Options for deploying a contract on the Aztec network.
|
|
19
|
-
* Allows specifying a contract address salt
|
|
16
|
+
* Allows specifying a contract address salt and different options to tweak contract publication
|
|
17
|
+
* and initialization
|
|
20
18
|
*/
|
|
21
|
-
export type
|
|
19
|
+
export type RequestDeployOptions = RequestInteractionOptions & {
|
|
22
20
|
/** An optional salt value used to deterministically calculate the contract address. */
|
|
23
21
|
contractAddressSalt?: Fr;
|
|
24
|
-
/**
|
|
25
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Deployer address that will be used for the deployed contract's address computation.
|
|
24
|
+
* If set to 0, the sender's address won't be mixed in
|
|
25
|
+
*/
|
|
26
|
+
deployer?: AztecAddress;
|
|
26
27
|
/** Skip contract class publication. */
|
|
27
28
|
skipClassPublication?: boolean;
|
|
28
29
|
/** Skip publication, instead just privately initialize the contract. */
|
|
29
30
|
skipInstancePublication?: boolean;
|
|
30
31
|
/** Skip contract initialization. */
|
|
31
32
|
skipInitialization?: boolean;
|
|
32
|
-
|
|
33
|
+
/** Skip contract registration in the wallet */
|
|
34
|
+
skipRegistration?: boolean;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Extends the deployment options with the required parameters to send the transaction
|
|
38
|
+
*/
|
|
39
|
+
export type DeployOptions = Omit<RequestDeployOptions, 'deployer'> & {
|
|
40
|
+
/**
|
|
41
|
+
* Set to true to *not* include the sender in the address computation. This option
|
|
42
|
+
* is mutually exclusive with "deployer"
|
|
43
|
+
*/
|
|
44
|
+
universalDeploy?: boolean;
|
|
45
|
+
} & Pick<SendInteractionOptions, 'from' | 'fee'>;
|
|
46
|
+
/**
|
|
47
|
+
* Options for simulating the deployment of a contract
|
|
48
|
+
* Allows skipping certain validations and computing gas estimations
|
|
49
|
+
*/
|
|
50
|
+
export type SimulateDeployOptions = Omit<DeployOptions, 'fee'> & {
|
|
51
|
+
/** The fee options for the transaction. */
|
|
52
|
+
fee?: SimulationInteractionFeeOptions;
|
|
53
|
+
/** Simulate without checking for the validity of the resulting transaction,
|
|
54
|
+
* e.g. whether it emits any existing nullifiers. */
|
|
55
|
+
skipTxValidation?: boolean;
|
|
56
|
+
/** Whether to ensure the fee payer is not empty and has enough balance to pay for the fee. */
|
|
57
|
+
skipFeeEnforcement?: boolean;
|
|
58
|
+
/** Whether to include metadata such as offchain effects and performance statistics
|
|
59
|
+
* (e.g. timing information of the different circuits and oracles) in
|
|
60
|
+
* the simulation result, instead of just the return value of the function */
|
|
61
|
+
includeMetadata?: boolean;
|
|
62
|
+
};
|
|
33
63
|
/**
|
|
34
64
|
* Contract interaction for deployment.
|
|
35
65
|
* Handles class publication, instance publication, and initialization of the contract.
|
|
@@ -42,54 +72,28 @@ export type DeployOptions = {
|
|
|
42
72
|
*
|
|
43
73
|
* Extends the BaseContractInteraction class.
|
|
44
74
|
*/
|
|
45
|
-
export declare class DeployMethod<TContract extends ContractBase =
|
|
75
|
+
export declare class DeployMethod<TContract extends ContractBase = ContractBase> extends BaseContractInteraction {
|
|
46
76
|
private publicKeys;
|
|
47
|
-
|
|
48
|
-
|
|
77
|
+
protected artifact: ContractArtifact;
|
|
78
|
+
protected postDeployCtor: (instance: ContractInstanceWithAddress, wallet: Wallet) => TContract;
|
|
49
79
|
private args;
|
|
50
80
|
/** The contract instance to be deployed. */
|
|
51
81
|
private instance?;
|
|
52
82
|
/** Constructor function to call. */
|
|
53
83
|
private constructorArtifact;
|
|
54
|
-
constructor(publicKeys: PublicKeys, wallet: Wallet, artifact: ContractArtifact, postDeployCtor: (
|
|
84
|
+
constructor(publicKeys: PublicKeys, wallet: Wallet, artifact: ContractArtifact, postDeployCtor: (instance: ContractInstanceWithAddress, wallet: Wallet) => TContract, args?: any[], constructorNameOrArtifact?: string | FunctionArtifact, authWitnesses?: AuthWitness[], capsules?: Capsule[]);
|
|
55
85
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* - Initialize the contract
|
|
60
|
-
*
|
|
61
|
-
* A tx is not necessary if the function has no public functions nor any
|
|
62
|
-
* initializer function.
|
|
63
|
-
*
|
|
64
|
-
* This function internally calls `request()` and `sign()` methods to prepare
|
|
65
|
-
* the transaction for deployment. The resulting signed transaction can be
|
|
66
|
-
* later sent using the `send()` method.
|
|
67
|
-
*
|
|
68
|
-
* @param options - An object containing optional deployment settings, contractAddressSalt, and from.
|
|
69
|
-
* @returns A Promise resolving to an object containing the signed transaction data and other relevant information.
|
|
86
|
+
* Returns the execution payload that allows this operation to happen on chain.
|
|
87
|
+
* @param options - Configuration options.
|
|
88
|
+
* @returns The execution payload for this operation
|
|
70
89
|
*/
|
|
71
|
-
|
|
90
|
+
request(options?: RequestDeployOptions): Promise<ExecutionPayload>;
|
|
91
|
+
convertDeployOptionsToRequestOptions(options: DeployOptions): RequestDeployOptions;
|
|
72
92
|
/**
|
|
73
|
-
*
|
|
74
|
-
* block for constructing batch requests.
|
|
93
|
+
* Adds this contract to the wallet and returns the Contract object.
|
|
75
94
|
* @param options - Deployment options.
|
|
76
|
-
* @returns An array of function calls.
|
|
77
|
-
* @remarks This method does not have the same return type as the `request` in the ContractInteraction object,
|
|
78
|
-
* it returns a promise for an array instead of a function call directly.
|
|
79
95
|
*/
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Simulate a deployment and profile the gate count for each function in the transaction.
|
|
83
|
-
* @param options - Same options as `send`, plus extra profiling options.
|
|
84
|
-
*
|
|
85
|
-
* @returns An object containing the function return value and profile result.
|
|
86
|
-
*/
|
|
87
|
-
profile(options: DeployOptions & ProfileMethodOptions): Promise<TxProfileResult>;
|
|
88
|
-
/**
|
|
89
|
-
* Adds this contract to the PXE and returns the Contract object.
|
|
90
|
-
* @param options - Deployment options.
|
|
91
|
-
*/
|
|
92
|
-
register(options?: Omit<DeployOptions, 'from'>): Promise<TContract>;
|
|
96
|
+
register(options?: RequestDeployOptions): Promise<TContract>;
|
|
93
97
|
/**
|
|
94
98
|
* Returns an execution payload for:
|
|
95
99
|
* - publication of the contract class and
|
|
@@ -98,13 +102,13 @@ export declare class DeployMethod<TContract extends ContractBase = Contract> ext
|
|
|
98
102
|
* @param options - Contract creation options.
|
|
99
103
|
* @returns An execution payload with potentially calls (and bytecode capsule) to the class registry and instance registry.
|
|
100
104
|
*/
|
|
101
|
-
protected getPublicationExecutionPayload(options?:
|
|
105
|
+
protected getPublicationExecutionPayload(options?: RequestDeployOptions): Promise<ExecutionPayload>;
|
|
102
106
|
/**
|
|
103
107
|
* Returns the calls necessary to initialize the contract.
|
|
104
108
|
* @param options - Deployment options.
|
|
105
109
|
* @returns - An array of function calls.
|
|
106
110
|
*/
|
|
107
|
-
protected getInitializationExecutionPayload(options?:
|
|
111
|
+
protected getInitializationExecutionPayload(options?: RequestDeployOptions): Promise<ExecutionPayload>;
|
|
108
112
|
/**
|
|
109
113
|
* Send a contract deployment transaction (initialize and/or publish) using the provided options.
|
|
110
114
|
* This function extends the 'send' method from the ContractFunctionInteraction class,
|
|
@@ -120,18 +124,22 @@ export declare class DeployMethod<TContract extends ContractBase = Contract> ext
|
|
|
120
124
|
* @param options - An object containing various initialization and publication options.
|
|
121
125
|
* @returns An instance object.
|
|
122
126
|
*/
|
|
123
|
-
getInstance(options?:
|
|
127
|
+
getInstance(options?: RequestDeployOptions): Promise<ContractInstanceWithAddress>;
|
|
124
128
|
/**
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
* @
|
|
129
|
+
* Simulate the deployment
|
|
130
|
+
*
|
|
131
|
+
* @param options - An optional object containing additional configuration for the simulation.
|
|
132
|
+
* @returns A simulation result object containing metadata of the execution, including gas
|
|
133
|
+
* estimations (if requested via options), execution statistics and emitted offchain effects
|
|
128
134
|
*/
|
|
129
|
-
|
|
135
|
+
simulate(options: SimulateDeployOptions): Promise<SimulationReturn<true>>;
|
|
130
136
|
/**
|
|
131
|
-
*
|
|
132
|
-
* @param options -
|
|
137
|
+
* Simulate a deployment and profile the gate count for each function in the transaction.
|
|
138
|
+
* @param options - Same options as `send`, plus extra profiling options.
|
|
139
|
+
*
|
|
140
|
+
* @returns An object containing the function return value and profile result.
|
|
133
141
|
*/
|
|
134
|
-
|
|
142
|
+
profile(options: DeployOptions & ProfileInteractionOptions): Promise<TxProfileResult>;
|
|
135
143
|
/** Return this deployment address. */
|
|
136
144
|
get address(): AztecAddress | undefined;
|
|
137
145
|
/** Returns the partial address for this deployment. */
|
|
@@ -141,11 +149,11 @@ export declare class DeployMethod<TContract extends ContractBase = Contract> ext
|
|
|
141
149
|
* @param options - An object containing the metadata to add to the interaction
|
|
142
150
|
* @returns A new DeployMethod with the added metadata, but calling the same original function in the same manner
|
|
143
151
|
*/
|
|
144
|
-
with({ authWitnesses, capsules
|
|
152
|
+
with({ authWitnesses, capsules }: {
|
|
145
153
|
/** The authWitnesses to add to the deployment */
|
|
146
154
|
authWitnesses?: AuthWitness[];
|
|
147
155
|
/** The capsules to add to the deployment */
|
|
148
156
|
capsules?: Capsule[];
|
|
149
157
|
}): DeployMethod;
|
|
150
158
|
}
|
|
151
|
-
//# sourceMappingURL=
|
|
159
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVwbG95X21ldGhvZC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NvbnRyYWN0L2RlcGxveV9tZXRob2QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQUF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/deploy_method.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"deploy_method.d.ts","sourceRoot":"","sources":["../../src/contract/deploy_method.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,KAAK,gBAAgB,EAAoB,KAAK,gBAAgB,EAAkB,MAAM,mBAAmB,CAAC;AACnH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EACL,KAAK,2BAA2B,EAIjC,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,eAAe,EAA0B,MAAM,kBAAkB,CAAC;AAC9F,OAAO,EAAE,gBAAgB,EAA0B,MAAM,kBAAkB,CAAC;AAI5E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EACL,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,EAC3B,KAAK,+BAA+B,EACpC,KAAK,gBAAgB,EAItB,MAAM,0BAA0B,CAAC;AAElC;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,yBAAyB,GAAG;IAC7D,uFAAuF;IACvF,mBAAmB,CAAC,EAAE,EAAE,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,uCAAuC;IACvC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,wEAAwE;IACxE,uBAAuB,CAAC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AQ,CAAC,EAAE,OAAO,EAAE,CAAC;KACtB,GAAG,YAAY,CAWf;CACF"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
2
|
import { getInitializer } from '@aztec/stdlib/abi';
|
|
3
3
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
4
|
import { computePartialAddress, getContractClassFromArtifact, getContractInstanceFromInstantiationParams } from '@aztec/stdlib/contract';
|
|
5
|
+
import { collectOffchainEffects } from '@aztec/stdlib/tx';
|
|
6
|
+
import { mergeExecutionPayloads } from '@aztec/stdlib/tx';
|
|
5
7
|
import { publishContractClass } from '../deployment/publish_class.js';
|
|
6
8
|
import { publishInstance } from '../deployment/publish_instance.js';
|
|
7
9
|
import { BaseContractInteraction } from './base_contract_interaction.js';
|
|
8
10
|
import { ContractFunctionInteraction } from './contract_function_interaction.js';
|
|
9
|
-
import { DeployProvenTx } from './deploy_proven_tx.js';
|
|
10
11
|
import { DeploySentTx } from './deploy_sent_tx.js';
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
import { getGasLimits } from './get_gas_limits.js';
|
|
13
|
+
import { toProfileOptions, toSendOptions, toSimulateOptions } from './interaction_options.js';
|
|
13
14
|
/**
|
|
14
15
|
* Contract interaction for deployment.
|
|
15
16
|
* Handles class publication, instance publication, and initialization of the contract.
|
|
@@ -33,83 +34,42 @@ import { DeploySentTx } from './deploy_sent_tx.js';
|
|
|
33
34
|
this.constructorArtifact = getInitializer(artifact, constructorNameOrArtifact);
|
|
34
35
|
}
|
|
35
36
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* - Initialize the contract
|
|
40
|
-
*
|
|
41
|
-
* A tx is not necessary if the function has no public functions nor any
|
|
42
|
-
* initializer function.
|
|
43
|
-
*
|
|
44
|
-
* This function internally calls `request()` and `sign()` methods to prepare
|
|
45
|
-
* the transaction for deployment. The resulting signed transaction can be
|
|
46
|
-
* later sent using the `send()` method.
|
|
47
|
-
*
|
|
48
|
-
* @param options - An object containing optional deployment settings, contractAddressSalt, and from.
|
|
49
|
-
* @returns A Promise resolving to an object containing the signed transaction data and other relevant information.
|
|
50
|
-
*/ async create(options) {
|
|
51
|
-
const requestWithoutFee = await this.request(options);
|
|
52
|
-
const { fee: userFee, txNonce, cancellable } = options;
|
|
53
|
-
const fee = await this.getFeeOptions(requestWithoutFee, userFee, {
|
|
54
|
-
txNonce,
|
|
55
|
-
cancellable
|
|
56
|
-
});
|
|
57
|
-
return this.wallet.createTxExecutionRequest(requestWithoutFee, fee, {
|
|
58
|
-
txNonce,
|
|
59
|
-
cancellable
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
// REFACTOR: Having a `request` method with different semantics than the ones in the other
|
|
63
|
-
// derived ContractInteractions is confusing. We should unify the flow of all ContractInteractions.
|
|
64
|
-
/**
|
|
65
|
-
* Returns an array of function calls that represent this operation. Useful as a building
|
|
66
|
-
* block for constructing batch requests.
|
|
67
|
-
* @param options - Deployment options.
|
|
68
|
-
* @returns An array of function calls.
|
|
69
|
-
* @remarks This method does not have the same return type as the `request` in the ContractInteraction object,
|
|
70
|
-
* it returns a promise for an array instead of a function call directly.
|
|
37
|
+
* Returns the execution payload that allows this operation to happen on chain.
|
|
38
|
+
* @param options - Configuration options.
|
|
39
|
+
* @returns The execution payload for this operation
|
|
71
40
|
*/ async request(options) {
|
|
72
41
|
const publication = await this.getPublicationExecutionPayload(options);
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
// in case the initializer is public. This hints at the need of having "transient" contracts scoped to a
|
|
77
|
-
// simulation, so we can run the simulation with a set of contracts, but only "commit" them to the wallet
|
|
78
|
-
// once this tx has gone through.
|
|
79
|
-
await this.wallet.registerContract({
|
|
80
|
-
artifact: this.artifact,
|
|
81
|
-
instance: await this.getInstance(options)
|
|
82
|
-
});
|
|
42
|
+
if (!options?.skipRegistration) {
|
|
43
|
+
await this.wallet.registerContract(await this.getInstance(options), this.artifact);
|
|
44
|
+
}
|
|
83
45
|
const initialization = await this.getInitializationExecutionPayload(options);
|
|
84
|
-
const
|
|
46
|
+
const feeExecutionPayload = options?.fee?.paymentMethod ? await options.fee.paymentMethod.getExecutionPayload() : undefined;
|
|
47
|
+
const finalExecutionPayload = feeExecutionPayload ? mergeExecutionPayloads([
|
|
48
|
+
feeExecutionPayload,
|
|
85
49
|
publication,
|
|
86
50
|
initialization
|
|
87
|
-
]
|
|
88
|
-
|
|
89
|
-
|
|
51
|
+
]) : mergeExecutionPayloads([
|
|
52
|
+
publication,
|
|
53
|
+
initialization
|
|
54
|
+
]);
|
|
55
|
+
if (!finalExecutionPayload.calls.length) {
|
|
90
56
|
throw new Error(`No transactions are needed to publish or initialize contract ${this.artifact.name}`);
|
|
91
57
|
}
|
|
92
|
-
return
|
|
58
|
+
return finalExecutionPayload;
|
|
93
59
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
*/ async profile(options) {
|
|
100
|
-
const txRequest = await this.create(options);
|
|
101
|
-
return await this.wallet.profileTx(txRequest, options.profileMode, options.skipProofGeneration, options?.from);
|
|
60
|
+
convertDeployOptionsToRequestOptions(options) {
|
|
61
|
+
return {
|
|
62
|
+
...options,
|
|
63
|
+
deployer: !options?.universalDeploy ? options.from : undefined
|
|
64
|
+
};
|
|
102
65
|
}
|
|
103
66
|
/**
|
|
104
|
-
* Adds this contract to the
|
|
67
|
+
* Adds this contract to the wallet and returns the Contract object.
|
|
105
68
|
* @param options - Deployment options.
|
|
106
|
-
*/ async register(options
|
|
69
|
+
*/ async register(options) {
|
|
107
70
|
const instance = await this.getInstance(options);
|
|
108
|
-
await this.wallet.registerContract(
|
|
109
|
-
|
|
110
|
-
instance
|
|
111
|
-
});
|
|
112
|
-
return this.postDeployCtor(instance.address, this.wallet);
|
|
71
|
+
await this.wallet.registerContract(instance, this.artifact);
|
|
72
|
+
return this.postDeployCtor(instance, this.wallet);
|
|
113
73
|
}
|
|
114
74
|
/**
|
|
115
75
|
* Returns an execution payload for:
|
|
@@ -118,7 +78,7 @@ import { DeploySentTx } from './deploy_sent_tx.js';
|
|
|
118
78
|
* depending on the provided options.
|
|
119
79
|
* @param options - Contract creation options.
|
|
120
80
|
* @returns An execution payload with potentially calls (and bytecode capsule) to the class registry and instance registry.
|
|
121
|
-
*/ async getPublicationExecutionPayload(options
|
|
81
|
+
*/ async getPublicationExecutionPayload(options) {
|
|
122
82
|
const calls = [];
|
|
123
83
|
// Set contract instance object so it's available for populating the DeploySendTx object
|
|
124
84
|
const instance = await this.getInstance(options);
|
|
@@ -129,7 +89,7 @@ import { DeploySentTx } from './deploy_sent_tx.js';
|
|
|
129
89
|
throw new Error(`Contract class mismatch when deploying contract: got ${instance.currentContractClassId.toString()} from instance and ${contractClass.id.toString()} from artifact`);
|
|
130
90
|
}
|
|
131
91
|
// Publish the contract class if it hasn't been published already.
|
|
132
|
-
if (!options
|
|
92
|
+
if (!options?.skipClassPublication) {
|
|
133
93
|
if ((await this.wallet.getContractClassMetadata(contractClass.id)).isContractClassPubliclyRegistered) {
|
|
134
94
|
this.log.debug(`Skipping publication of already-registered contract class ${contractClass.id.toString()} for ${instance.address.toString()}`);
|
|
135
95
|
} else {
|
|
@@ -139,7 +99,7 @@ import { DeploySentTx } from './deploy_sent_tx.js';
|
|
|
139
99
|
}
|
|
140
100
|
}
|
|
141
101
|
// Publish the contract instance:
|
|
142
|
-
if (!options
|
|
102
|
+
if (!options?.skipInstancePublication) {
|
|
143
103
|
// TODO(https://github.com/AztecProtocol/aztec-packages/issues/15596):
|
|
144
104
|
// Read the artifact, and if there are no public functions, warn the caller that publication of the
|
|
145
105
|
// contract instance is not necessary (until such time as they wish to update the instance (i.e. change its class_id)).
|
|
@@ -152,9 +112,9 @@ import { DeploySentTx } from './deploy_sent_tx.js';
|
|
|
152
112
|
* Returns the calls necessary to initialize the contract.
|
|
153
113
|
* @param options - Deployment options.
|
|
154
114
|
* @returns - An array of function calls.
|
|
155
|
-
*/ async getInitializationExecutionPayload(options
|
|
115
|
+
*/ async getInitializationExecutionPayload(options) {
|
|
156
116
|
const executionsPayloads = [];
|
|
157
|
-
if (this.constructorArtifact && !options
|
|
117
|
+
if (this.constructorArtifact && !options?.skipInitialization) {
|
|
158
118
|
const { address } = await this.getInstance(options);
|
|
159
119
|
const constructorCall = new ContractFunctionInteraction(this.wallet, address, this.constructorArtifact, this.args);
|
|
160
120
|
executionsPayloads.push(await constructorCall.request());
|
|
@@ -169,7 +129,11 @@ import { DeploySentTx } from './deploy_sent_tx.js';
|
|
|
169
129
|
* @param options - An object containing various deployment options such as contractAddressSalt and from.
|
|
170
130
|
* @returns A SentTx object that returns the receipt and the deployed contract instance.
|
|
171
131
|
*/ send(options) {
|
|
172
|
-
const sendTx = ()=>
|
|
132
|
+
const sendTx = async ()=>{
|
|
133
|
+
const executionPayload = await this.request(this.convertDeployOptionsToRequestOptions(options));
|
|
134
|
+
const sendOptions = toSendOptions(options);
|
|
135
|
+
return this.wallet.sendTx(executionPayload, sendOptions);
|
|
136
|
+
};
|
|
173
137
|
this.log.debug(`Sent deployment tx of ${this.artifact.name} contract`);
|
|
174
138
|
return new DeploySentTx(this.wallet, sendTx, this.postDeployCtor, ()=>this.getInstance(options));
|
|
175
139
|
}
|
|
@@ -178,31 +142,51 @@ import { DeploySentTx } from './deploy_sent_tx.js';
|
|
|
178
142
|
*
|
|
179
143
|
* @param options - An object containing various initialization and publication options.
|
|
180
144
|
* @returns An instance object.
|
|
181
|
-
*/ async getInstance(options
|
|
145
|
+
*/ async getInstance(options) {
|
|
182
146
|
if (!this.instance) {
|
|
183
147
|
this.instance = await getContractInstanceFromInstantiationParams(this.artifact, {
|
|
184
148
|
constructorArgs: this.args,
|
|
185
|
-
salt: options.
|
|
149
|
+
salt: options?.contractAddressSalt ?? Fr.random(),
|
|
186
150
|
publicKeys: this.publicKeys,
|
|
187
151
|
constructorArtifact: this.constructorArtifact,
|
|
188
|
-
deployer: options
|
|
152
|
+
deployer: options?.deployer ? options.deployer : AztecAddress.ZERO
|
|
189
153
|
});
|
|
190
154
|
}
|
|
191
155
|
return this.instance;
|
|
192
156
|
}
|
|
193
157
|
/**
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
* @
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
158
|
+
* Simulate the deployment
|
|
159
|
+
*
|
|
160
|
+
* @param options - An optional object containing additional configuration for the simulation.
|
|
161
|
+
* @returns A simulation result object containing metadata of the execution, including gas
|
|
162
|
+
* estimations (if requested via options), execution statistics and emitted offchain effects
|
|
163
|
+
*/ async simulate(options) {
|
|
164
|
+
const executionPayload = await this.request(this.convertDeployOptionsToRequestOptions(options));
|
|
165
|
+
const simulatedTx = await this.wallet.simulateTx(executionPayload, toSimulateOptions(options));
|
|
166
|
+
const { gasLimits, teardownGasLimits } = getGasLimits(simulatedTx, options.fee?.estimatedGasPadding);
|
|
167
|
+
this.log.verbose(`Estimated gas limits for tx: DA=${gasLimits.daGas} L2=${gasLimits.l2Gas} teardownDA=${teardownGasLimits.daGas} teardownL2=${teardownGasLimits.l2Gas}`);
|
|
168
|
+
return {
|
|
169
|
+
stats: simulatedTx.stats,
|
|
170
|
+
offchainEffects: collectOffchainEffects(simulatedTx.privateExecutionResult),
|
|
171
|
+
result: undefined,
|
|
172
|
+
estimatedGas: {
|
|
173
|
+
gasLimits,
|
|
174
|
+
teardownGasLimits
|
|
175
|
+
}
|
|
176
|
+
};
|
|
200
177
|
}
|
|
201
178
|
/**
|
|
202
|
-
*
|
|
203
|
-
* @param options -
|
|
204
|
-
|
|
205
|
-
|
|
179
|
+
* Simulate a deployment and profile the gate count for each function in the transaction.
|
|
180
|
+
* @param options - Same options as `send`, plus extra profiling options.
|
|
181
|
+
*
|
|
182
|
+
* @returns An object containing the function return value and profile result.
|
|
183
|
+
*/ async profile(options) {
|
|
184
|
+
const executionPayload = await this.request(this.convertDeployOptionsToRequestOptions(options));
|
|
185
|
+
return await this.wallet.profileTx(executionPayload, {
|
|
186
|
+
...toProfileOptions(options),
|
|
187
|
+
profileMode: options.profileMode,
|
|
188
|
+
skipProofGeneration: options.skipProofGeneration
|
|
189
|
+
});
|
|
206
190
|
}
|
|
207
191
|
/** Return this deployment address. */ get address() {
|
|
208
192
|
return this.instance?.address;
|