@aztec/aztec.js 0.76.4 → 0.77.0-testnet-ignition.21
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/dest/account/contract.d.ts +9 -5
- package/dest/account/contract.d.ts.map +1 -1
- package/dest/account/contract.js +15 -2
- package/dest/account/index.d.ts +2 -2
- package/dest/account/index.d.ts.map +1 -1
- package/dest/account/index.js +8 -1
- package/dest/account/interface.d.ts +5 -4
- package/dest/account/interface.d.ts.map +1 -1
- package/dest/account/interface.js +4 -3
- package/dest/account/wallet.d.ts +4 -3
- package/dest/account/wallet.d.ts.map +1 -1
- package/dest/account/wallet.js +3 -2
- package/dest/account_manager/deploy_account_method.d.ts +5 -5
- package/dest/account_manager/deploy_account_method.d.ts.map +1 -1
- package/dest/account_manager/deploy_account_method.js +22 -25
- package/dest/account_manager/deploy_account_sent_tx.d.ts +4 -3
- package/dest/account_manager/deploy_account_sent_tx.d.ts.map +1 -1
- package/dest/account_manager/deploy_account_sent_tx.js +16 -17
- package/dest/account_manager/index.d.ts +20 -11
- package/dest/account_manager/index.d.ts.map +1 -1
- package/dest/account_manager/index.js +89 -87
- package/dest/api/abi.d.ts +2 -3
- package/dest/api/abi.d.ts.map +1 -1
- package/dest/api/abi.js +1 -3
- package/dest/api/account.d.ts +1 -2
- package/dest/api/account.d.ts.map +1 -1
- package/dest/api/account.js +1 -2
- package/dest/api/addresses.d.ts +2 -2
- package/dest/api/addresses.d.ts.map +1 -1
- package/dest/api/addresses.js +2 -3
- package/dest/api/cheat_codes.d.ts +4 -4
- package/dest/api/cheat_codes.d.ts.map +1 -1
- package/dest/api/cheat_codes.js +10 -15
- package/dest/api/deployment.js +0 -1
- package/dest/api/entrypoint.js +0 -1
- package/dest/api/eth_address.js +0 -1
- package/dest/api/ethereum/anvil_test_watcher.d.ts +10 -6
- package/dest/api/ethereum/anvil_test_watcher.d.ts.map +1 -1
- package/dest/api/ethereum/anvil_test_watcher.js +43 -18
- package/dest/api/ethereum/chain_monitor.d.ts +6 -2
- package/dest/api/ethereum/chain_monitor.d.ts.map +1 -1
- package/dest/api/ethereum/chain_monitor.js +24 -8
- package/dest/api/ethereum/cheat_codes.d.ts +14 -3
- package/dest/api/ethereum/cheat_codes.d.ts.map +1 -1
- package/dest/api/ethereum/cheat_codes.js +106 -53
- package/dest/api/ethereum/index.d.ts +1 -1
- package/dest/api/ethereum/index.d.ts.map +1 -1
- package/dest/api/ethereum/index.js +1 -2
- package/dest/api/ethereum/l1_contracts.d.ts +1 -1
- package/dest/api/ethereum/l1_contracts.d.ts.map +1 -1
- package/dest/api/ethereum/l1_contracts.js +4 -6
- package/dest/api/ethereum/portal_manager.d.ts +16 -12
- package/dest/api/ethereum/portal_manager.d.ts.map +1 -1
- package/dest/api/ethereum/portal_manager.js +134 -115
- package/dest/api/fee.d.ts +0 -1
- package/dest/api/fee.d.ts.map +1 -1
- package/dest/api/fee.js +0 -2
- package/dest/api/fields.js +0 -1
- package/dest/api/interfaces/pxe.d.ts +1 -1
- package/dest/api/interfaces/pxe.d.ts.map +1 -1
- package/dest/api/interfaces/pxe.js +1 -2
- package/dest/api/log.js +0 -1
- package/dest/api/log_id.d.ts +1 -1
- package/dest/api/log_id.d.ts.map +1 -1
- package/dest/api/log_id.js +1 -2
- package/dest/api/tx_hash.d.ts +1 -1
- package/dest/api/tx_hash.d.ts.map +1 -1
- package/dest/api/tx_hash.js +1 -2
- package/dest/api/wallet.d.ts +1 -1
- package/dest/api/wallet.d.ts.map +1 -1
- package/dest/api/wallet.js +1 -2
- package/dest/contract/base_contract_interaction.d.ts +21 -5
- package/dest/contract/base_contract_interaction.d.ts.map +1 -1
- package/dest/contract/base_contract_interaction.js +97 -55
- package/dest/contract/batch_call.d.ts +3 -2
- package/dest/contract/batch_call.d.ts.map +1 -1
- package/dest/contract/batch_call.js +64 -40
- package/dest/contract/checker.d.ts +1 -1
- package/dest/contract/checker.d.ts.map +1 -1
- package/dest/contract/checker.js +29 -20
- package/dest/contract/contract.d.ts +4 -4
- package/dest/contract/contract.d.ts.map +1 -1
- package/dest/contract/contract.js +30 -28
- package/dest/contract/contract_base.d.ts +5 -5
- package/dest/contract/contract_base.d.ts.map +1 -1
- package/dest/contract/contract_base.js +22 -31
- package/dest/contract/contract_function_interaction.d.ts +9 -8
- package/dest/contract/contract_function_interaction.d.ts.map +1 -1
- package/dest/contract/contract_function_interaction.js +63 -51
- package/dest/contract/deploy_method.d.ts +14 -11
- package/dest/contract/deploy_method.d.ts.map +1 -1
- package/dest/contract/deploy_method.js +115 -87
- package/dest/contract/deploy_proven_tx.d.ts +6 -4
- package/dest/contract/deploy_proven_tx.d.ts.map +1 -1
- package/dest/contract/deploy_proven_tx.js +8 -11
- package/dest/contract/deploy_sent_tx.d.ts +8 -6
- package/dest/contract/deploy_sent_tx.d.ts.map +1 -1
- package/dest/contract/deploy_sent_tx.js +19 -22
- package/dest/contract/get_gas_limits.d.ts +2 -2
- package/dest/contract/get_gas_limits.d.ts.map +1 -1
- package/dest/contract/get_gas_limits.js +2 -4
- package/dest/contract/index.js +2 -4
- package/dest/{deployment → contract}/protocol_contracts.d.ts +4 -2
- package/dest/contract/protocol_contracts.d.ts.map +1 -0
- package/dest/contract/protocol_contracts.js +26 -0
- package/dest/contract/proven_tx.d.ts +3 -2
- package/dest/contract/proven_tx.d.ts.map +1 -1
- package/dest/contract/proven_tx.js +8 -11
- package/dest/contract/sent_tx.d.ts +3 -2
- package/dest/contract/sent_tx.d.ts.map +1 -1
- package/dest/contract/sent_tx.js +33 -35
- package/dest/contract/unsafe_contract.d.ts +3 -3
- package/dest/contract/unsafe_contract.d.ts.map +1 -1
- package/dest/contract/unsafe_contract.js +2 -10
- package/dest/deployment/broadcast_function.d.ts +3 -3
- package/dest/deployment/broadcast_function.d.ts.map +1 -1
- package/dest/deployment/broadcast_function.js +39 -32
- package/dest/deployment/contract_deployer.d.ts +3 -3
- package/dest/deployment/contract_deployer.d.ts.map +1 -1
- package/dest/deployment/contract_deployer.js +16 -15
- package/dest/deployment/deploy_instance.d.ts +3 -3
- package/dest/deployment/deploy_instance.d.ts.map +1 -1
- package/dest/deployment/deploy_instance.js +3 -5
- package/dest/deployment/index.js +0 -1
- package/dest/deployment/register_class.d.ts +3 -3
- package/dest/deployment/register_class.d.ts.map +1 -1
- package/dest/deployment/register_class.js +19 -14
- package/dest/entrypoint/default_entrypoint.d.ts +2 -2
- package/dest/entrypoint/default_entrypoint.d.ts.map +1 -1
- package/dest/entrypoint/default_entrypoint.js +11 -9
- package/dest/entrypoint/default_multi_call_entrypoint.d.ts +2 -2
- package/dest/entrypoint/default_multi_call_entrypoint.d.ts.map +1 -1
- package/dest/entrypoint/default_multi_call_entrypoint.js +68 -25
- package/dest/entrypoint/entrypoint.d.ts +7 -3
- package/dest/entrypoint/entrypoint.d.ts.map +1 -1
- package/dest/entrypoint/entrypoint.js +0 -1
- package/dest/entrypoint/payload.d.ts +8 -5
- package/dest/entrypoint/payload.d.ts.map +1 -1
- package/dest/entrypoint/payload.js +78 -85
- package/dest/fee/fee_juice_payment_method.d.ts +3 -3
- package/dest/fee/fee_juice_payment_method.d.ts.map +1 -1
- package/dest/fee/fee_juice_payment_method.js +5 -4
- package/dest/fee/fee_juice_payment_method_with_claim.d.ts +5 -4
- package/dest/fee/fee_juice_payment_method_with_claim.d.ts.map +1 -1
- package/dest/fee/fee_juice_payment_method_with_claim.js +18 -20
- package/dest/fee/fee_payment_method.d.ts +3 -3
- package/dest/fee/fee_payment_method.d.ts.map +1 -1
- package/dest/fee/fee_payment_method.js +3 -2
- package/dest/fee/private_fee_payment_method.d.ts +5 -5
- package/dest/fee/private_fee_payment_method.d.ts.map +1 -1
- package/dest/fee/private_fee_payment_method.js +40 -38
- package/dest/fee/public_fee_payment_method.d.ts +5 -5
- package/dest/fee/public_fee_payment_method.d.ts.map +1 -1
- package/dest/fee/public_fee_payment_method.js +38 -35
- package/dest/index.d.ts +25 -12
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +24 -14
- package/dest/rpc_clients/index.js +0 -1
- package/dest/rpc_clients/node/index.d.ts +2 -1
- package/dest/rpc_clients/node/index.d.ts.map +1 -1
- package/dest/rpc_clients/node/index.js +35 -18
- package/dest/rpc_clients/pxe_client.d.ts +2 -2
- package/dest/rpc_clients/pxe_client.d.ts.map +1 -1
- package/dest/rpc_clients/pxe_client.js +9 -7
- package/dest/utils/abi_types.d.ts +4 -1
- package/dest/utils/abi_types.d.ts.map +1 -1
- package/dest/utils/abi_types.js +1 -2
- package/dest/utils/authwit.d.ts +3 -2
- package/dest/utils/authwit.d.ts.map +1 -1
- package/dest/utils/authwit.js +18 -17
- package/dest/utils/aztec_cheatcodes.d.ts +4 -2
- package/dest/utils/aztec_cheatcodes.d.ts.map +1 -1
- package/dest/utils/aztec_cheatcodes.js +32 -41
- package/dest/utils/field_compressed_string.js +3 -5
- package/dest/utils/index.d.ts +1 -1
- package/dest/utils/index.d.ts.map +1 -1
- package/dest/utils/index.js +1 -2
- package/dest/utils/node.d.ts +3 -3
- package/dest/utils/node.d.ts.map +1 -1
- package/dest/utils/node.js +4 -6
- package/dest/utils/pub_key.d.ts +2 -1
- package/dest/utils/pub_key.d.ts.map +1 -1
- package/dest/utils/pub_key.js +2 -4
- package/dest/utils/pxe.d.ts +2 -2
- package/dest/utils/pxe.d.ts.map +1 -1
- package/dest/utils/pxe.js +3 -5
- package/dest/wallet/account_wallet.d.ts +8 -5
- package/dest/wallet/account_wallet.d.ts.map +1 -1
- package/dest/wallet/account_wallet.js +120 -83
- package/dest/wallet/account_wallet_with_private_key.d.ts +5 -5
- package/dest/wallet/account_wallet_with_private_key.d.ts.map +1 -1
- package/dest/wallet/account_wallet_with_private_key.js +10 -16
- package/dest/wallet/base_wallet.d.ts +19 -10
- package/dest/wallet/base_wallet.d.ts.map +1 -1
- package/dest/wallet/base_wallet.js +12 -13
- package/dest/wallet/index.d.ts +3 -3
- package/dest/wallet/index.d.ts.map +1 -1
- package/dest/wallet/index.js +2 -4
- package/dest/wallet/signerless_wallet.d.ts +7 -4
- package/dest/wallet/signerless_wallet.d.ts.map +1 -1
- package/dest/wallet/signerless_wallet.js +4 -6
- package/package.json +10 -14
- package/src/account/contract.ts +22 -5
- package/src/account/index.ts +2 -2
- package/src/account/interface.ts +5 -4
- package/src/account/wallet.ts +4 -3
- package/src/account_manager/deploy_account_method.ts +5 -5
- package/src/account_manager/deploy_account_sent_tx.ts +4 -3
- package/src/account_manager/index.ts +51 -24
- package/src/api/abi.ts +10 -3
- package/src/api/account.ts +8 -3
- package/src/api/addresses.ts +2 -2
- package/src/api/cheat_codes.ts +6 -6
- package/src/api/ethereum/anvil_test_watcher.ts +31 -7
- package/src/api/ethereum/chain_monitor.ts +9 -2
- package/src/api/ethereum/cheat_codes.ts +65 -24
- package/src/api/ethereum/index.ts +5 -1
- package/src/api/ethereum/l1_contracts.ts +1 -1
- package/src/api/ethereum/portal_manager.ts +27 -32
- package/src/api/fee.ts +0 -1
- package/src/api/interfaces/pxe.ts +1 -1
- package/src/api/log_id.ts +1 -1
- package/src/api/tx_hash.ts +1 -1
- package/src/api/wallet.ts +1 -1
- package/src/contract/base_contract_interaction.ts +35 -9
- package/src/contract/batch_call.ts +9 -7
- package/src/contract/checker.ts +1 -1
- package/src/contract/contract.ts +11 -4
- package/src/contract/contract_base.ts +3 -3
- package/src/contract/contract_function_interaction.ts +24 -13
- package/src/contract/deploy_method.ts +27 -18
- package/src/contract/deploy_proven_tx.ts +6 -4
- package/src/contract/deploy_sent_tx.ts +8 -6
- package/src/contract/get_gas_limits.ts +2 -2
- package/src/contract/protocol_contracts.ts +35 -0
- package/src/contract/proven_tx.ts +3 -2
- package/src/contract/sent_tx.ts +3 -2
- package/src/contract/unsafe_contract.ts +3 -3
- package/src/deployment/broadcast_function.ts +47 -40
- package/src/deployment/contract_deployer.ts +4 -3
- package/src/deployment/deploy_instance.ts +5 -5
- package/src/deployment/register_class.ts +25 -18
- package/src/entrypoint/default_entrypoint.ts +5 -5
- package/src/entrypoint/default_multi_call_entrypoint.ts +5 -4
- package/src/entrypoint/entrypoint.ts +7 -3
- package/src/entrypoint/payload.ts +11 -6
- package/src/fee/fee_juice_payment_method.ts +5 -3
- package/src/fee/fee_juice_payment_method_with_claim.ts +11 -10
- package/src/fee/fee_payment_method.ts +3 -3
- package/src/fee/private_fee_payment_method.ts +10 -11
- package/src/fee/public_fee_payment_method.ts +11 -11
- package/src/index.ts +35 -58
- package/src/rpc_clients/node/index.ts +2 -1
- package/src/rpc_clients/pxe_client.ts +2 -2
- package/src/utils/abi_types.ts +4 -7
- package/src/utils/authwit.ts +5 -2
- package/src/utils/aztec_cheatcodes.ts +5 -3
- package/src/utils/field_compressed_string.ts +1 -1
- package/src/utils/index.ts +1 -1
- package/src/utils/node.ts +3 -3
- package/src/utils/pub_key.ts +3 -2
- package/src/utils/pxe.ts +2 -2
- package/src/wallet/account_wallet.ts +8 -5
- package/src/wallet/account_wallet_with_private_key.ts +5 -4
- package/src/wallet/base_wallet.ts +37 -46
- package/src/wallet/index.ts +3 -3
- package/src/wallet/signerless_wallet.ts +7 -4
- package/dest/deployment/protocol_contracts.d.ts.map +0 -1
- package/dest/deployment/protocol_contracts.js +0 -14
- package/dest/fee/no_fee_payment_method.d.ts +0 -13
- package/dest/fee/no_fee_payment_method.d.ts.map +0 -1
- package/dest/fee/no_fee_payment_method.js +0 -17
- package/src/deployment/protocol_contracts.ts +0 -17
- package/src/fee/no_fee_payment_method.ts +0 -23
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
2
|
+
import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import type { Wallet } from '../wallet/index.js';
|
|
5
5
|
import { ContractBase } from './contract_base.js';
|
|
6
6
|
|
|
7
7
|
/** Unsafe constructor for ContractBase that bypasses the check that the instance is registered in the wallet. */
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ARTIFACT_FUNCTION_TREE_MAX_HEIGHT,
|
|
3
|
-
AztecAddress,
|
|
4
3
|
MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS,
|
|
5
|
-
REGISTERER_CONTRACT_ADDRESS,
|
|
6
4
|
REGISTERER_CONTRACT_BYTECODE_CAPSULE_SLOT,
|
|
5
|
+
} from '@aztec/constants';
|
|
6
|
+
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
7
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
8
|
+
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
9
|
+
import { type ContractArtifact, FunctionSelector, FunctionType, bufferAsFields } from '@aztec/stdlib/abi';
|
|
10
|
+
import {
|
|
7
11
|
computeVerificationKeyHash,
|
|
8
12
|
createPrivateFunctionMembershipProof,
|
|
9
13
|
createUnconstrainedFunctionMembershipProof,
|
|
10
14
|
getContractClassFromArtifact,
|
|
11
|
-
} from '@aztec/
|
|
12
|
-
import {
|
|
13
|
-
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
14
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
15
|
+
} from '@aztec/stdlib/contract';
|
|
16
|
+
import { Capsule } from '@aztec/stdlib/tx';
|
|
15
17
|
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
18
|
+
import type { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
|
|
19
|
+
import { getRegistererContract } from '../contract/protocol_contracts.js';
|
|
20
|
+
import type { Wallet } from '../wallet/index.js';
|
|
19
21
|
|
|
20
22
|
/**
|
|
21
23
|
* Sets up a call to broadcast a private function's bytecode via the ClassRegisterer contract.
|
|
@@ -55,31 +57,33 @@ export async function broadcastPrivateFunction(
|
|
|
55
57
|
} = await createPrivateFunctionMembershipProof(selector, artifact);
|
|
56
58
|
|
|
57
59
|
const vkHash = await computeVerificationKeyHash(privateFunctionArtifact);
|
|
60
|
+
|
|
61
|
+
const registerer = await getRegistererContract(wallet);
|
|
62
|
+
const fn = registerer.methods.broadcast_private_function(
|
|
63
|
+
contractClass.id,
|
|
64
|
+
artifactMetadataHash,
|
|
65
|
+
unconstrainedFunctionsArtifactTreeRoot,
|
|
66
|
+
privateFunctionTreeSiblingPath,
|
|
67
|
+
privateFunctionTreeLeafIndex,
|
|
68
|
+
padArrayEnd(artifactTreeSiblingPath, Fr.ZERO, ARTIFACT_FUNCTION_TREE_MAX_HEIGHT),
|
|
69
|
+
artifactTreeLeafIndex,
|
|
70
|
+
// eslint-disable-next-line camelcase
|
|
71
|
+
{ selector, metadata_hash: functionMetadataHash, vk_hash: vkHash },
|
|
72
|
+
);
|
|
73
|
+
|
|
58
74
|
const bytecode = bufferAsFields(
|
|
59
75
|
privateFunctionArtifact.bytecode,
|
|
60
76
|
MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS,
|
|
61
77
|
);
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
);
|
|
68
|
-
|
|
69
|
-
const registerer = await getRegistererContract(wallet);
|
|
70
|
-
return Promise.resolve(
|
|
71
|
-
registerer.methods.broadcast_private_function(
|
|
72
|
-
contractClass.id,
|
|
73
|
-
artifactMetadataHash,
|
|
74
|
-
unconstrainedFunctionsArtifactTreeRoot,
|
|
75
|
-
privateFunctionTreeSiblingPath,
|
|
76
|
-
privateFunctionTreeLeafIndex,
|
|
77
|
-
padArrayEnd(artifactTreeSiblingPath, Fr.ZERO, ARTIFACT_FUNCTION_TREE_MAX_HEIGHT),
|
|
78
|
-
artifactTreeLeafIndex,
|
|
79
|
-
// eslint-disable-next-line camelcase
|
|
80
|
-
{ selector, metadata_hash: functionMetadataHash, vk_hash: vkHash },
|
|
78
|
+
fn.addCapsule(
|
|
79
|
+
new Capsule(
|
|
80
|
+
ProtocolContractAddress.ContractClassRegisterer,
|
|
81
|
+
new Fr(REGISTERER_CONTRACT_BYTECODE_CAPSULE_SLOT),
|
|
82
|
+
bytecode,
|
|
81
83
|
),
|
|
82
84
|
);
|
|
85
|
+
|
|
86
|
+
return fn;
|
|
83
87
|
}
|
|
84
88
|
|
|
85
89
|
/**
|
|
@@ -117,19 +121,8 @@ export async function broadcastUnconstrainedFunction(
|
|
|
117
121
|
privateFunctionsArtifactTreeRoot,
|
|
118
122
|
} = await createUnconstrainedFunctionMembershipProof(selector, artifact);
|
|
119
123
|
|
|
120
|
-
const bytecode = bufferAsFields(
|
|
121
|
-
unconstrainedFunctionArtifact.bytecode,
|
|
122
|
-
MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS,
|
|
123
|
-
);
|
|
124
|
-
|
|
125
|
-
await wallet.storeCapsule(
|
|
126
|
-
AztecAddress.fromNumber(REGISTERER_CONTRACT_ADDRESS),
|
|
127
|
-
new Fr(REGISTERER_CONTRACT_BYTECODE_CAPSULE_SLOT),
|
|
128
|
-
bytecode,
|
|
129
|
-
);
|
|
130
|
-
|
|
131
124
|
const registerer = await getRegistererContract(wallet);
|
|
132
|
-
|
|
125
|
+
const fn = registerer.methods.broadcast_unconstrained_function(
|
|
133
126
|
contractClass.id,
|
|
134
127
|
artifactMetadataHash,
|
|
135
128
|
privateFunctionsArtifactTreeRoot,
|
|
@@ -138,4 +131,18 @@ export async function broadcastUnconstrainedFunction(
|
|
|
138
131
|
// eslint-disable-next-line camelcase
|
|
139
132
|
{ selector, metadata_hash: functionMetadataHash },
|
|
140
133
|
);
|
|
134
|
+
|
|
135
|
+
const bytecode = bufferAsFields(
|
|
136
|
+
unconstrainedFunctionArtifact.bytecode,
|
|
137
|
+
MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS,
|
|
138
|
+
);
|
|
139
|
+
fn.addCapsule(
|
|
140
|
+
new Capsule(
|
|
141
|
+
ProtocolContractAddress.ContractClassRegisterer,
|
|
142
|
+
new Fr(REGISTERER_CONTRACT_BYTECODE_CAPSULE_SLOT),
|
|
143
|
+
bytecode,
|
|
144
|
+
),
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
return fn;
|
|
141
148
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
2
|
+
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
|
+
import { PublicKeys } from '@aztec/stdlib/keys';
|
|
3
4
|
|
|
4
|
-
import {
|
|
5
|
+
import type { Wallet } from '../account/wallet.js';
|
|
5
6
|
import { Contract } from '../contract/contract.js';
|
|
6
7
|
import { DeployMethod } from '../contract/deploy_method.js';
|
|
7
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import type { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
|
|
4
|
+
import { getDeployerContract } from '../contract/protocol_contracts.js';
|
|
5
|
+
import type { Wallet } from '../wallet/index.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Sets up a call to the canonical deployer contract to publicly deploy a contract instance.
|
|
@@ -14,7 +14,7 @@ export async function deployInstance(
|
|
|
14
14
|
instance: ContractInstanceWithAddress,
|
|
15
15
|
): Promise<ContractFunctionInteraction> {
|
|
16
16
|
const deployerContract = await getDeployerContract(wallet);
|
|
17
|
-
const { salt, contractClassId, publicKeys, deployer } = instance;
|
|
17
|
+
const { salt, currentContractClassId: contractClassId, publicKeys, deployer } = instance;
|
|
18
18
|
const isUniversalDeploy = deployer.isZero();
|
|
19
19
|
if (!isUniversalDeploy && !wallet.getAddress().equals(deployer)) {
|
|
20
20
|
throw new Error(
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
getContractClassFromArtifact,
|
|
8
|
-
} from '@aztec/circuits.js';
|
|
9
|
-
import { type ContractArtifact, bufferAsFields } from '@aztec/foundation/abi';
|
|
1
|
+
import { MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS, REGISTERER_CONTRACT_BYTECODE_CAPSULE_SLOT } from '@aztec/constants';
|
|
2
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
3
|
+
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
4
|
+
import { type ContractArtifact, bufferAsFields } from '@aztec/stdlib/abi';
|
|
5
|
+
import { getContractClassFromArtifact } from '@aztec/stdlib/contract';
|
|
6
|
+
import { Capsule } from '@aztec/stdlib/tx';
|
|
10
7
|
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
8
|
+
import type { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
|
|
9
|
+
import { getRegistererContract } from '../contract/protocol_contracts.js';
|
|
10
|
+
import type { Wallet } from '../wallet/index.js';
|
|
14
11
|
|
|
15
12
|
const defaultEmitPublicBytecode =
|
|
16
13
|
// guard against `process` not being defined (e.g. in the browser)
|
|
@@ -26,12 +23,22 @@ export async function registerContractClass(
|
|
|
26
23
|
): Promise<ContractFunctionInteraction> {
|
|
27
24
|
const { artifactHash, privateFunctionsRoot, publicBytecodeCommitment, packedBytecode } =
|
|
28
25
|
await getContractClassFromArtifact(artifact);
|
|
29
|
-
const encodedBytecode = bufferAsFields(packedBytecode, MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS);
|
|
30
26
|
const registerer = await getRegistererContract(wallet);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
const fn = registerer.methods.register(
|
|
28
|
+
artifactHash,
|
|
29
|
+
privateFunctionsRoot,
|
|
30
|
+
publicBytecodeCommitment,
|
|
31
|
+
emitPublicBytecode,
|
|
35
32
|
);
|
|
36
|
-
|
|
33
|
+
|
|
34
|
+
const encodedBytecode = bufferAsFields(packedBytecode, MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS);
|
|
35
|
+
fn.addCapsule(
|
|
36
|
+
new Capsule(
|
|
37
|
+
ProtocolContractAddress.ContractClassRegisterer,
|
|
38
|
+
new Fr(REGISTERER_CONTRACT_BYTECODE_CAPSULE_SLOT),
|
|
39
|
+
encodedBytecode,
|
|
40
|
+
),
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
return fn;
|
|
37
44
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TxContext } from '@aztec/
|
|
3
|
-
import { FunctionType } from '@aztec/foundation/abi';
|
|
1
|
+
import { FunctionType } from '@aztec/stdlib/abi';
|
|
2
|
+
import { HashedValues, TxContext, TxExecutionRequest } from '@aztec/stdlib/tx';
|
|
4
3
|
|
|
5
|
-
import {
|
|
4
|
+
import type { EntrypointInterface, ExecutionRequestInit } from './entrypoint.js';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* Default implementation of the entrypoint interface. It calls a function on a contract directly
|
|
@@ -11,7 +10,7 @@ export class DefaultEntrypoint implements EntrypointInterface {
|
|
|
11
10
|
constructor(private chainId: number, private protocolVersion: number) {}
|
|
12
11
|
|
|
13
12
|
async createTxExecutionRequest(exec: ExecutionRequestInit): Promise<TxExecutionRequest> {
|
|
14
|
-
const { fee, calls, authWitnesses = [], hashedArguments = [] } = exec;
|
|
13
|
+
const { fee, calls, authWitnesses = [], hashedArguments = [], capsules = [] } = exec;
|
|
15
14
|
|
|
16
15
|
if (calls.length > 1) {
|
|
17
16
|
throw new Error(`Expected a single call, got ${calls.length}`);
|
|
@@ -33,6 +32,7 @@ export class DefaultEntrypoint implements EntrypointInterface {
|
|
|
33
32
|
txContext,
|
|
34
33
|
[...hashedArguments, entrypointHashedValues],
|
|
35
34
|
authWitnesses,
|
|
35
|
+
capsules,
|
|
36
36
|
),
|
|
37
37
|
);
|
|
38
38
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { HashedValues, TxExecutionRequest } from '@aztec/circuit-types';
|
|
2
|
-
import { type AztecAddress, TxContext } from '@aztec/circuits.js';
|
|
3
|
-
import { type FunctionAbi, FunctionSelector, encodeArguments } from '@aztec/foundation/abi';
|
|
4
1
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
2
|
+
import { type FunctionAbi, FunctionSelector, encodeArguments } from '@aztec/stdlib/abi';
|
|
3
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
|
+
import { HashedValues, TxContext, TxExecutionRequest } from '@aztec/stdlib/tx';
|
|
5
5
|
|
|
6
6
|
import { type EntrypointInterface, EntrypointPayload, type ExecutionRequestInit } from './entrypoint.js';
|
|
7
7
|
|
|
@@ -16,7 +16,7 @@ export class DefaultMultiCallEntrypoint implements EntrypointInterface {
|
|
|
16
16
|
) {}
|
|
17
17
|
|
|
18
18
|
async createTxExecutionRequest(executions: ExecutionRequestInit): Promise<TxExecutionRequest> {
|
|
19
|
-
const { fee, calls, authWitnesses = [], hashedArguments = [] } = executions;
|
|
19
|
+
const { fee, calls, authWitnesses = [], hashedArguments = [], capsules = [] } = executions;
|
|
20
20
|
const payload = await EntrypointPayload.fromAppExecution(calls);
|
|
21
21
|
const abi = this.getEntrypointAbi();
|
|
22
22
|
const entrypointHashedArgs = await HashedValues.fromValues(encodeArguments(abi, [payload]));
|
|
@@ -28,6 +28,7 @@ export class DefaultMultiCallEntrypoint implements EntrypointInterface {
|
|
|
28
28
|
txContext: new TxContext(this.chainId, this.version, fee.gasSettings),
|
|
29
29
|
argsOfCalls: [...payload.hashedArguments, ...hashedArguments, entrypointHashedArgs],
|
|
30
30
|
authWitnesses,
|
|
31
|
+
capsules,
|
|
31
32
|
});
|
|
32
33
|
|
|
33
34
|
return Promise.resolve(txRequest);
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import type { Fr } from '@aztec/foundation/fields';
|
|
2
|
+
import type { FunctionCall } from '@aztec/stdlib/abi';
|
|
3
|
+
import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
4
|
+
import type { Capsule, HashedValues, TxExecutionRequest } from '@aztec/stdlib/tx';
|
|
3
5
|
|
|
4
6
|
import { EntrypointPayload, type FeeOptions, computeCombinedPayloadHash } from './payload.js';
|
|
5
7
|
|
|
6
|
-
export { EntrypointPayload, FeeOptions, computeCombinedPayloadHash };
|
|
8
|
+
export { EntrypointPayload, type FeeOptions, computeCombinedPayloadHash };
|
|
7
9
|
|
|
8
10
|
export { DefaultEntrypoint } from './default_entrypoint.js';
|
|
9
11
|
export { DefaultMultiCallEntrypoint } from './default_multi_call_entrypoint.js';
|
|
@@ -16,6 +18,8 @@ export type ExecutionRequestInit = {
|
|
|
16
18
|
authWitnesses?: AuthWitness[];
|
|
17
19
|
/** Any transient hashed arguments for this execution */
|
|
18
20
|
hashedArguments?: HashedValues[];
|
|
21
|
+
/** Data passed through an oracle for this execution. */
|
|
22
|
+
capsules?: Capsule[];
|
|
19
23
|
/** How the fee is going to be payed */
|
|
20
24
|
fee: FeeOptions;
|
|
21
25
|
/** An optional nonce. Used to repeat a previous tx with a higher fee so that the first one is cancelled */
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type AztecAddress, Fr, type GasSettings, GeneratorIndex } from '@aztec/circuits.js';
|
|
3
|
-
import { FunctionType } from '@aztec/foundation/abi';
|
|
1
|
+
import { GeneratorIndex } from '@aztec/constants';
|
|
4
2
|
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
5
3
|
import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
5
|
+
import type { Tuple } from '@aztec/foundation/serialize';
|
|
6
|
+
import type { FieldsOf } from '@aztec/foundation/types';
|
|
7
|
+
import { FunctionCall, FunctionType } from '@aztec/stdlib/abi';
|
|
8
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
9
|
+
import type { GasSettings } from '@aztec/stdlib/gas';
|
|
10
|
+
import { HashedValues } from '@aztec/stdlib/tx';
|
|
8
11
|
|
|
9
|
-
import {
|
|
12
|
+
import type { FeePaymentMethod } from '../fee/fee_payment_method.js';
|
|
10
13
|
|
|
11
14
|
/**
|
|
12
15
|
* Fee payment options for a transaction.
|
|
@@ -18,6 +21,7 @@ export type FeeOptions = {
|
|
|
18
21
|
gasSettings: GasSettings;
|
|
19
22
|
};
|
|
20
23
|
|
|
24
|
+
// docs:start:user_fee_options
|
|
21
25
|
/** Fee options as set by a user. */
|
|
22
26
|
export type UserFeeOptions = {
|
|
23
27
|
/** The fee payment method to use */
|
|
@@ -31,6 +35,7 @@ export type UserFeeOptions = {
|
|
|
31
35
|
/** Percentage to pad the estimated gas limits by, if empty, defaults to 0.1. Only relevant if estimateGas is set. */
|
|
32
36
|
estimatedGasPadding?: number;
|
|
33
37
|
};
|
|
38
|
+
// docs:end:user_fee_options
|
|
34
39
|
|
|
35
40
|
// These must match the values defined in:
|
|
36
41
|
// - noir-projects/aztec-nr/aztec/src/entrypoint/app.nr
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { type FunctionCall } from '@aztec/circuit-types';
|
|
2
|
-
import { type AztecAddress } from '@aztec/circuits.js';
|
|
3
1
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
2
|
+
import type { FunctionCall } from '@aztec/stdlib/abi';
|
|
3
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import type { FeePaymentMethod } from './fee_payment_method.js';
|
|
6
6
|
|
|
7
|
+
// docs:start:fee_juice_method
|
|
7
8
|
/**
|
|
8
9
|
* Pay fee directly in the Fee Juice.
|
|
9
10
|
*/
|
|
10
11
|
export class FeeJuicePaymentMethod implements FeePaymentMethod {
|
|
12
|
+
// docs:end:fee_juice_method
|
|
11
13
|
constructor(protected sender: AztecAddress) {}
|
|
12
14
|
|
|
13
15
|
getAsset() {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type AztecAddress, Fr, FunctionSelector } from '@aztec/circuits.js';
|
|
3
|
-
import { FunctionType, U128 } from '@aztec/foundation/abi';
|
|
1
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
4
2
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
5
|
-
import {
|
|
3
|
+
import type { FunctionCall } from '@aztec/stdlib/abi';
|
|
4
|
+
import { FunctionSelector, FunctionType } from '@aztec/stdlib/abi';
|
|
6
5
|
|
|
7
|
-
import {
|
|
6
|
+
import type { L2AmountClaim } from '../api/ethereum/portal_manager.js';
|
|
7
|
+
import { getFeeJuice } from '../contract/protocol_contracts.js';
|
|
8
|
+
import type { Wallet } from '../wallet/index.js';
|
|
8
9
|
import { FeeJuicePaymentMethod } from './fee_juice_payment_method.js';
|
|
9
10
|
|
|
10
11
|
/**
|
|
@@ -12,10 +13,10 @@ import { FeeJuicePaymentMethod } from './fee_juice_payment_method.js';
|
|
|
12
13
|
*/
|
|
13
14
|
export class FeeJuicePaymentMethodWithClaim extends FeeJuicePaymentMethod {
|
|
14
15
|
constructor(
|
|
15
|
-
|
|
16
|
+
private senderWallet: Wallet,
|
|
16
17
|
private claim: Pick<L2AmountClaim, 'claimAmount' | 'claimSecret' | 'messageLeafIndex'>,
|
|
17
18
|
) {
|
|
18
|
-
super(
|
|
19
|
+
super(senderWallet.getAddress());
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
/**
|
|
@@ -23,7 +24,7 @@ export class FeeJuicePaymentMethodWithClaim extends FeeJuicePaymentMethod {
|
|
|
23
24
|
* @returns A function call
|
|
24
25
|
*/
|
|
25
26
|
override async getFunctionCalls(): Promise<FunctionCall[]> {
|
|
26
|
-
const canonicalFeeJuice = await
|
|
27
|
+
const canonicalFeeJuice = await getFeeJuice(this.senderWallet);
|
|
27
28
|
const selector = await FunctionSelector.fromNameAndParameters(
|
|
28
29
|
canonicalFeeJuice.artifact.functions.find(f => f.name === 'claim')!,
|
|
29
30
|
);
|
|
@@ -35,8 +36,8 @@ export class FeeJuicePaymentMethodWithClaim extends FeeJuicePaymentMethod {
|
|
|
35
36
|
selector,
|
|
36
37
|
isStatic: false,
|
|
37
38
|
args: [
|
|
38
|
-
this.
|
|
39
|
-
|
|
39
|
+
this.senderWallet.getAddress().toField(),
|
|
40
|
+
new Fr(this.claim.claimAmount),
|
|
40
41
|
this.claim.claimSecret,
|
|
41
42
|
new Fr(this.claim.messageLeafIndex),
|
|
42
43
|
],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { FunctionCall } from '@aztec/stdlib/abi';
|
|
2
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
|
+
import type { GasSettings } from '@aztec/stdlib/gas';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Holds information about how the fee for a transaction is to be paid.
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { type FunctionCall } from '@aztec/circuit-types';
|
|
2
|
-
import { type GasSettings } from '@aztec/circuits.js';
|
|
3
|
-
import { FunctionSelector, FunctionType, U128 } from '@aztec/foundation/abi';
|
|
4
|
-
import { type AztecAddress } from '@aztec/foundation/aztec-address';
|
|
5
1
|
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
+
import { type FunctionCall, FunctionSelector, FunctionType } from '@aztec/stdlib/abi';
|
|
3
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
|
+
import type { GasSettings } from '@aztec/stdlib/gas';
|
|
6
5
|
|
|
7
|
-
import {
|
|
6
|
+
import type { Wallet } from '../account/wallet.js';
|
|
8
7
|
import { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
|
|
9
8
|
import { SignerlessWallet } from '../wallet/signerless_wallet.js';
|
|
10
|
-
import {
|
|
9
|
+
import type { FeePaymentMethod } from './fee_payment_method.js';
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* Holds information about how the fee for a transaction is to be paid.
|
|
@@ -88,15 +87,15 @@ export class PrivateFeePaymentMethod implements FeePaymentMethod {
|
|
|
88
87
|
async getFunctionCalls(gasSettings: GasSettings): Promise<FunctionCall[]> {
|
|
89
88
|
// We assume 1:1 exchange rate between fee juice and token. But in reality you would need to convert feeLimit
|
|
90
89
|
// (maxFee) to be in token denomination.
|
|
91
|
-
const maxFee =
|
|
90
|
+
const maxFee = this.setMaxFeeToOne ? Fr.ONE : gasSettings.getFeeLimit();
|
|
92
91
|
const nonce = Fr.random();
|
|
93
92
|
|
|
94
93
|
await this.wallet.createAuthWit({
|
|
95
94
|
caller: this.paymentContract,
|
|
96
95
|
action: {
|
|
97
96
|
name: 'transfer_to_public',
|
|
98
|
-
args: [this.wallet.getAddress().toField(), this.paymentContract.toField(),
|
|
99
|
-
selector: await FunctionSelector.fromSignature('transfer_to_public((Field),(Field),
|
|
97
|
+
args: [this.wallet.getAddress().toField(), this.paymentContract.toField(), maxFee, nonce],
|
|
98
|
+
selector: await FunctionSelector.fromSignature('transfer_to_public((Field),(Field),u128,Field)'),
|
|
100
99
|
type: FunctionType.PRIVATE,
|
|
101
100
|
isStatic: false,
|
|
102
101
|
to: await this.getAsset(),
|
|
@@ -108,10 +107,10 @@ export class PrivateFeePaymentMethod implements FeePaymentMethod {
|
|
|
108
107
|
{
|
|
109
108
|
name: 'fee_entrypoint_private',
|
|
110
109
|
to: this.paymentContract,
|
|
111
|
-
selector: await FunctionSelector.fromSignature('fee_entrypoint_private(
|
|
110
|
+
selector: await FunctionSelector.fromSignature('fee_entrypoint_private(u128,Field)'),
|
|
112
111
|
type: FunctionType.PRIVATE,
|
|
113
112
|
isStatic: false,
|
|
114
|
-
args: [
|
|
113
|
+
args: [maxFee, nonce],
|
|
115
114
|
returnTypes: [],
|
|
116
115
|
},
|
|
117
116
|
];
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { type FunctionCall } from '@aztec/circuit-types';
|
|
2
|
-
import { type GasSettings } from '@aztec/circuits.js';
|
|
3
|
-
import { FunctionSelector, FunctionType, U128 } from '@aztec/foundation/abi';
|
|
4
|
-
import { type AztecAddress } from '@aztec/foundation/aztec-address';
|
|
5
1
|
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
+
import type { FunctionCall } from '@aztec/stdlib/abi';
|
|
3
|
+
import { FunctionSelector, FunctionType } from '@aztec/stdlib/abi';
|
|
4
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
+
import type { GasSettings } from '@aztec/stdlib/gas';
|
|
6
6
|
|
|
7
7
|
import { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
|
|
8
|
-
import {
|
|
8
|
+
import type { AccountWallet } from '../wallet/account_wallet.js';
|
|
9
9
|
import { SignerlessWallet } from '../wallet/signerless_wallet.js';
|
|
10
|
-
import {
|
|
10
|
+
import type { FeePaymentMethod } from './fee_payment_method.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Holds information about how the fee for a transaction is to be paid.
|
|
@@ -80,15 +80,15 @@ export class PublicFeePaymentMethod implements FeePaymentMethod {
|
|
|
80
80
|
*/
|
|
81
81
|
async getFunctionCalls(gasSettings: GasSettings): Promise<FunctionCall[]> {
|
|
82
82
|
const nonce = Fr.random();
|
|
83
|
-
const maxFee =
|
|
83
|
+
const maxFee = gasSettings.getFeeLimit();
|
|
84
84
|
|
|
85
85
|
const setPublicAuthWitInteraction = await this.wallet.setPublicAuthWit(
|
|
86
86
|
{
|
|
87
87
|
caller: this.paymentContract,
|
|
88
88
|
action: {
|
|
89
89
|
name: 'transfer_in_public',
|
|
90
|
-
args: [this.wallet.getAddress().toField(), this.paymentContract.toField(),
|
|
91
|
-
selector: await FunctionSelector.fromSignature('transfer_in_public((Field),(Field),
|
|
90
|
+
args: [this.wallet.getAddress().toField(), this.paymentContract.toField(), maxFee, nonce],
|
|
91
|
+
selector: await FunctionSelector.fromSignature('transfer_in_public((Field),(Field),u128,Field)'),
|
|
92
92
|
type: FunctionType.PUBLIC,
|
|
93
93
|
isStatic: false,
|
|
94
94
|
to: await this.getAsset(),
|
|
@@ -103,10 +103,10 @@ export class PublicFeePaymentMethod implements FeePaymentMethod {
|
|
|
103
103
|
{
|
|
104
104
|
name: 'fee_entrypoint_public',
|
|
105
105
|
to: this.paymentContract,
|
|
106
|
-
selector: await FunctionSelector.fromSignature('fee_entrypoint_public(
|
|
106
|
+
selector: await FunctionSelector.fromSignature('fee_entrypoint_public(u128,Field)'),
|
|
107
107
|
type: FunctionType.PRIVATE,
|
|
108
108
|
isStatic: false,
|
|
109
|
-
args: [
|
|
109
|
+
args: [maxFee, nonce],
|
|
110
110
|
returnTypes: [],
|
|
111
111
|
},
|
|
112
112
|
];
|