@aztec/entrypoints 3.0.0-nightly.20251001 → 3.0.0-nightly.20251002

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.
@@ -1,6 +1,7 @@
1
1
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
2
+ import type { GasSettings } from '@aztec/stdlib/gas';
2
3
  import { TxExecutionRequest } from '@aztec/stdlib/tx';
3
- import type { AuthWitnessProvider, EntrypointInterface, FeeOptions, TxExecutionOptions } from './interfaces.js';
4
+ import type { AuthWitnessProvider, EntrypointInterface, TxExecutionOptions } from './interfaces.js';
4
5
  import { ExecutionPayload } from './payload.js';
5
6
  /**
6
7
  * Implementation for an entrypoint interface that follows the default entrypoint signature
@@ -12,7 +13,7 @@ export declare class DefaultAccountEntrypoint implements EntrypointInterface {
12
13
  private chainId;
13
14
  private version;
14
15
  constructor(address: AztecAddress, auth: AuthWitnessProvider, chainId?: number, version?: number);
15
- createTxExecutionRequest(exec: ExecutionPayload, feeOptions: FeeOptions, options: TxExecutionOptions): Promise<TxExecutionRequest>;
16
+ createTxExecutionRequest(exec: ExecutionPayload, gasSettings: GasSettings, options: TxExecutionOptions): Promise<TxExecutionRequest>;
16
17
  private getEntrypointAbi;
17
18
  }
18
19
  //# sourceMappingURL=account_entrypoint.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"account_entrypoint.d.ts","sourceRoot":"","sources":["../src/account_entrypoint.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAA2B,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAI/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAChH,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD;;;GAGG;AACH,qBAAa,wBAAyB,YAAW,mBAAmB;IAEhE,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,IAAI;IACZ,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,OAAO;gBAHP,OAAO,EAAE,YAAY,EACrB,IAAI,EAAE,mBAAmB,EACzB,OAAO,GAAE,MAAyB,EAClC,OAAO,GAAE,MAAwB;IAGrC,wBAAwB,CAC5B,IAAI,EAAE,gBAAgB,EACtB,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,kBAAkB,CAAC;IA+C9B,OAAO,CAAC,gBAAgB;CAqGzB"}
1
+ {"version":3,"file":"account_entrypoint.d.ts","sourceRoot":"","sources":["../src/account_entrypoint.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAA2B,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAI/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACpG,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD;;;GAGG;AACH,qBAAa,wBAAyB,YAAW,mBAAmB;IAEhE,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,IAAI;IACZ,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,OAAO;gBAHP,OAAO,EAAE,YAAY,EACrB,IAAI,EAAE,mBAAmB,EACzB,OAAO,GAAE,MAAyB,EAClC,OAAO,GAAE,MAAwB;IAGrC,wBAAwB,CAC5B,IAAI,EAAE,gBAAgB,EACtB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,kBAAkB,CAAC;IAgC9B,OAAO,CAAC,gBAAgB;CA2DzB"}
@@ -2,7 +2,7 @@ import { Fr } from '@aztec/foundation/fields';
2
2
  import { FunctionSelector, encodeArguments } from '@aztec/stdlib/abi';
3
3
  import { HashedValues, TxContext, TxExecutionRequest } from '@aztec/stdlib/tx';
4
4
  import { DEFAULT_CHAIN_ID, DEFAULT_VERSION } from './constants.js';
5
- import { EncodedCallsForEntrypoint, computeCombinedPayloadHash } from './encoding.js';
5
+ import { EncodedAppEntrypointCalls } from './encoding.js';
6
6
  /**
7
7
  * Implementation for an entrypoint interface that follows the default entrypoint signature
8
8
  * for an account, which accepts an AppPayload and a FeePayload as defined in noir-libs/aztec-noir/src/entrypoint module
@@ -17,44 +17,37 @@ import { EncodedCallsForEntrypoint, computeCombinedPayloadHash } from './encodin
17
17
  this.chainId = chainId;
18
18
  this.version = version;
19
19
  }
20
- async createTxExecutionRequest(exec, feeOptions, options) {
20
+ async createTxExecutionRequest(exec, gasSettings, options) {
21
21
  // Initial request with calls, authWitnesses and capsules
22
22
  const { calls, authWitnesses, capsules, extraHashedArgs } = exec;
23
23
  // Global tx options
24
- const { cancellable, txNonce } = options;
24
+ const { cancellable, txNonce, isFeePayer, endSetup } = options;
25
25
  // Encode the calls for the app
26
- const appEncodedCalls = await EncodedCallsForEntrypoint.fromAppExecution(calls, txNonce);
27
- // Get the execution payload for the fee, it includes the calls and potentially authWitnesses
28
- const { calls: feeCalls, authWitnesses: feeAuthwitnesses } = await feeOptions.paymentMethod.getExecutionPayload(feeOptions.gasSettings);
29
- // Encode the calls for the fee
30
- const feePayer = await feeOptions.paymentMethod.getFeePayer();
31
- const isFeePayer = feePayer.equals(this.address);
32
- const feeEncodedCalls = await EncodedCallsForEntrypoint.fromFeeCalls(feeCalls, isFeePayer);
26
+ const encodedCalls = await EncodedAppEntrypointCalls.create(calls, txNonce);
33
27
  // Obtain the entrypoint hashed args, built from the app and fee encoded calls
34
28
  const abi = this.getEntrypointAbi();
35
29
  const entrypointHashedArgs = await HashedValues.fromArgs(encodeArguments(abi, [
36
- appEncodedCalls,
37
- feeEncodedCalls,
30
+ encodedCalls,
31
+ !!isFeePayer,
32
+ !!endSetup,
38
33
  !!cancellable
39
34
  ]));
40
35
  // Generate the combined payload auth witness, by signing the hash of the combined payload
41
- const combinedPayloadAuthWitness = await this.auth.createAuthWit(await computeCombinedPayloadHash(appEncodedCalls, feeEncodedCalls));
36
+ const appPayloadAuthwitness = await this.auth.createAuthWit(await encodedCalls.hash());
42
37
  // Assemble the tx request
43
38
  const txRequest = TxExecutionRequest.from({
44
39
  firstCallArgsHash: entrypointHashedArgs.hash,
45
40
  origin: this.address,
46
41
  functionSelector: await FunctionSelector.fromNameAndParameters(abi.name, abi.parameters),
47
- txContext: new TxContext(this.chainId, this.version, feeOptions.gasSettings),
42
+ txContext: new TxContext(this.chainId, this.version, gasSettings),
48
43
  argsOfCalls: [
49
- ...appEncodedCalls.hashedArguments,
50
- ...feeEncodedCalls.hashedArguments,
44
+ ...encodedCalls.hashedArguments,
51
45
  entrypointHashedArgs,
52
46
  ...extraHashedArgs
53
47
  ],
54
48
  authWitnesses: [
55
49
  ...authWitnesses,
56
- ...feeAuthwitnesses,
57
- combinedPayloadAuthWitness
50
+ appPayloadAuthwitness
58
51
  ],
59
52
  capsules,
60
53
  salt: Fr.random()
@@ -79,7 +72,7 @@ import { EncodedCallsForEntrypoint, computeCombinedPayloadHash } from './encodin
79
72
  name: 'function_calls',
80
73
  type: {
81
74
  kind: 'array',
82
- length: 4,
75
+ length: 5,
83
76
  type: {
84
77
  kind: 'struct',
85
78
  path: 'authwit::entrypoint::function_call::FunctionCall',
@@ -149,89 +142,16 @@ import { EncodedCallsForEntrypoint, computeCombinedPayloadHash } from './encodin
149
142
  visibility: 'public'
150
143
  },
151
144
  {
152
- name: 'fee_payload',
145
+ name: 'is_fee_payer',
153
146
  type: {
154
- kind: 'struct',
155
- path: 'authwit::entrypoint::fee::FeePayload',
156
- fields: [
157
- {
158
- name: 'function_calls',
159
- type: {
160
- kind: 'array',
161
- length: 2,
162
- type: {
163
- kind: 'struct',
164
- path: 'authwit::entrypoint::function_call::FunctionCall',
165
- fields: [
166
- {
167
- name: 'args_hash',
168
- type: {
169
- kind: 'field'
170
- }
171
- },
172
- {
173
- name: 'function_selector',
174
- type: {
175
- kind: 'struct',
176
- path: 'authwit::aztec::protocol_types::abis::function_selector::FunctionSelector',
177
- fields: [
178
- {
179
- name: 'inner',
180
- type: {
181
- kind: 'integer',
182
- sign: 'unsigned',
183
- width: 32
184
- }
185
- }
186
- ]
187
- }
188
- },
189
- {
190
- name: 'target_address',
191
- type: {
192
- kind: 'struct',
193
- path: 'authwit::aztec::protocol_types::address::AztecAddress',
194
- fields: [
195
- {
196
- name: 'inner',
197
- type: {
198
- kind: 'field'
199
- }
200
- }
201
- ]
202
- }
203
- },
204
- {
205
- name: 'is_public',
206
- type: {
207
- kind: 'boolean'
208
- }
209
- },
210
- {
211
- name: 'is_static',
212
- type: {
213
- kind: 'boolean'
214
- }
215
- }
216
- ]
217
- }
218
- }
219
- },
220
- {
221
- name: 'tx_nonce',
222
- type: {
223
- kind: 'field'
224
- }
225
- },
226
- {
227
- name: 'is_fee_payer',
228
- type: {
229
- kind: 'boolean'
230
- }
231
- }
232
- ]
233
- },
234
- visibility: 'public'
147
+ kind: 'boolean'
148
+ }
149
+ },
150
+ {
151
+ name: 'end_setup',
152
+ type: {
153
+ kind: 'boolean'
154
+ }
235
155
  },
236
156
  {
237
157
  name: 'cancellable',
@@ -1,5 +1,6 @@
1
+ import type { GasSettings } from '@aztec/stdlib/gas';
1
2
  import { TxExecutionRequest } from '@aztec/stdlib/tx';
2
- import type { EntrypointInterface, FeeOptions, TxExecutionOptions } from './interfaces.js';
3
+ import type { EntrypointInterface, TxExecutionOptions } from './interfaces.js';
3
4
  import type { ExecutionPayload } from './payload.js';
4
5
  /**
5
6
  * Default implementation of the entrypoint interface. It calls a function on a contract directly
@@ -8,6 +9,6 @@ export declare class DefaultEntrypoint implements EntrypointInterface {
8
9
  private chainId;
9
10
  private rollupVersion;
10
11
  constructor(chainId: number, rollupVersion: number);
11
- createTxExecutionRequest(exec: ExecutionPayload, feeOptions: FeeOptions, options: TxExecutionOptions): Promise<TxExecutionRequest>;
12
+ createTxExecutionRequest(exec: ExecutionPayload, gasSettings: GasSettings, options: TxExecutionOptions): Promise<TxExecutionRequest>;
12
13
  }
13
14
  //# sourceMappingURL=default_entrypoint.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"default_entrypoint.d.ts","sourceRoot":"","sources":["../src/default_entrypoint.ts"],"names":[],"mappings":"AACA,OAAO,EAA2B,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC3F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD;;GAEG;AACH,qBAAa,iBAAkB,YAAW,mBAAmB;IAEzD,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,aAAa;gBADb,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM;IAGzB,wBAAwB,CAC5B,IAAI,EAAE,gBAAgB,EACtB,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,kBAAkB,CAAC;CA+B/B"}
1
+ {"version":3,"file":"default_entrypoint.d.ts","sourceRoot":"","sources":["../src/default_entrypoint.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAA2B,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD;;GAEG;AACH,qBAAa,iBAAkB,YAAW,mBAAmB;IAEzD,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,aAAa;gBADb,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM;IAGzB,wBAAwB,CAC5B,IAAI,EAAE,gBAAgB,EACtB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,kBAAkB,CAAC;CA+B/B"}
@@ -9,8 +9,8 @@ import { HashedValues, TxContext, TxExecutionRequest } from '@aztec/stdlib/tx';
9
9
  this.chainId = chainId;
10
10
  this.rollupVersion = rollupVersion;
11
11
  }
12
- async createTxExecutionRequest(exec, feeOptions, options) {
13
- if (options.txNonce || options.cancellable !== undefined) {
12
+ async createTxExecutionRequest(exec, gasSettings, options) {
13
+ if (options.txNonce || options.cancellable !== undefined || options.isFeePayer || options.endSetup) {
14
14
  throw new Error('TxExecutionOptions are not supported in DefaultEntrypoint');
15
15
  }
16
16
  // Initial request with calls, authWitnesses and capsules
@@ -27,7 +27,7 @@ import { HashedValues, TxContext, TxExecutionRequest } from '@aztec/stdlib/tx';
27
27
  throw new Error('Public entrypoints are not allowed');
28
28
  }
29
29
  // Assemble the tx request
30
- return new TxExecutionRequest(call.to, call.selector, hashedArguments[0].hash, new TxContext(this.chainId, this.rollupVersion, feeOptions.gasSettings), [
30
+ return new TxExecutionRequest(call.to, call.selector, hashedArguments[0].hash, new TxContext(this.chainId, this.rollupVersion, gasSettings), [
31
31
  ...hashedArguments,
32
32
  ...extraHashedArgs
33
33
  ], authWitnesses, capsules);
@@ -1,6 +1,7 @@
1
1
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
2
+ import type { GasSettings } from '@aztec/stdlib/gas';
2
3
  import { TxExecutionRequest } from '@aztec/stdlib/tx';
3
- import type { EntrypointInterface, FeeOptions } from './interfaces.js';
4
+ import type { EntrypointInterface } from './interfaces.js';
4
5
  import type { ExecutionPayload } from './payload.js';
5
6
  /**
6
7
  * Implementation for an entrypoint interface that can execute multiple function calls in a single transaction
@@ -10,7 +11,7 @@ export declare class DefaultMultiCallEntrypoint implements EntrypointInterface {
10
11
  private version;
11
12
  private address;
12
13
  constructor(chainId: number, version: number, address?: AztecAddress);
13
- createTxExecutionRequest(exec: ExecutionPayload, feeOptions: FeeOptions): Promise<TxExecutionRequest>;
14
+ createTxExecutionRequest(exec: ExecutionPayload, gasSettings: GasSettings): Promise<TxExecutionRequest>;
14
15
  private getEntrypointAbi;
15
16
  }
16
17
  //# sourceMappingURL=default_multi_call_entrypoint.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"default_multi_call_entrypoint.d.ts","sourceRoot":"","sources":["../src/default_multi_call_entrypoint.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAA2B,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAG/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD;;GAEG;AACH,qBAAa,0BAA2B,YAAW,mBAAmB;IAElE,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,OAAO;gBAFP,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,YAA0D;IAGvE,wBAAwB,CAAC,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAkC3G,OAAO,CAAC,gBAAgB;CAwDzB"}
1
+ {"version":3,"file":"default_multi_call_entrypoint.d.ts","sourceRoot":"","sources":["../src/default_multi_call_entrypoint.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAA2B,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAG/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD;;GAEG;AACH,qBAAa,0BAA2B,YAAW,mBAAmB;IAElE,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,OAAO;gBAFP,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,YAA0D;IAGvE,wBAAwB,CAAC,IAAI,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,kBAAkB,CAAC;IA0B7G,OAAO,CAAC,gBAAgB;CAwDzB"}
@@ -2,7 +2,7 @@ import { Fr } from '@aztec/foundation/fields';
2
2
  import { ProtocolContractAddress } from '@aztec/protocol-contracts';
3
3
  import { FunctionSelector, encodeArguments } from '@aztec/stdlib/abi';
4
4
  import { HashedValues, TxContext, TxExecutionRequest } from '@aztec/stdlib/tx';
5
- import { EncodedCallsForEntrypoint } from './encoding.js';
5
+ import { EncodedAppEntrypointCalls } from './encoding.js';
6
6
  /**
7
7
  * Implementation for an entrypoint interface that can execute multiple function calls in a single transaction
8
8
  */ export class DefaultMultiCallEntrypoint {
@@ -14,14 +14,11 @@ import { EncodedCallsForEntrypoint } from './encoding.js';
14
14
  this.version = version;
15
15
  this.address = address;
16
16
  }
17
- async createTxExecutionRequest(exec, feeOptions) {
17
+ async createTxExecutionRequest(exec, gasSettings) {
18
18
  // Initial request with calls, authWitnesses and capsules
19
19
  const { calls, authWitnesses, capsules, extraHashedArgs } = exec;
20
- // Get the execution payload for the fee, it includes the calls and potentially authWitnesses
21
- const { calls: feeCalls, authWitnesses: feeAuthwitnesses, extraHashedArgs: feeExtraHashedArgs } = await feeOptions.paymentMethod.getExecutionPayload(feeOptions.gasSettings);
22
- // Encode the calls, including the fee calls
23
- // (since this entrypoint does not distinguish between app and fee calls)
24
- const encodedCalls = await EncodedCallsForEntrypoint.fromAppExecution(calls.concat(feeCalls));
20
+ // Encode the calls for the app
21
+ const encodedCalls = await EncodedAppEntrypointCalls.create(calls);
25
22
  // Obtain the entrypoint hashed args, built from the encoded calls
26
23
  const abi = this.getEntrypointAbi();
27
24
  const entrypointHashedArgs = await HashedValues.fromArgs(encodeArguments(abi, [
@@ -32,17 +29,13 @@ import { EncodedCallsForEntrypoint } from './encoding.js';
32
29
  firstCallArgsHash: entrypointHashedArgs.hash,
33
30
  origin: this.address,
34
31
  functionSelector: await FunctionSelector.fromNameAndParameters(abi.name, abi.parameters),
35
- txContext: new TxContext(this.chainId, this.version, feeOptions.gasSettings),
32
+ txContext: new TxContext(this.chainId, this.version, gasSettings),
36
33
  argsOfCalls: [
37
34
  ...encodedCalls.hashedArguments,
38
35
  entrypointHashedArgs,
39
- ...extraHashedArgs,
40
- ...feeExtraHashedArgs
41
- ],
42
- authWitnesses: [
43
- ...feeAuthwitnesses,
44
- ...authWitnesses
36
+ ...extraHashedArgs
45
37
  ],
38
+ authWitnesses,
46
39
  capsules,
47
40
  salt: Fr.random()
48
41
  });
@@ -66,7 +59,7 @@ import { EncodedCallsForEntrypoint } from './encoding.js';
66
59
  name: 'function_calls',
67
60
  type: {
68
61
  kind: 'array',
69
- length: 4,
62
+ length: 5,
70
63
  type: {
71
64
  kind: 'struct',
72
65
  path: 'authwit::entrypoint::function_call::FunctionCall',
@@ -2,8 +2,7 @@ import { Fr } from '@aztec/foundation/fields';
2
2
  import type { Tuple } from '@aztec/foundation/serialize';
3
3
  import { FunctionCall } from '@aztec/stdlib/abi';
4
4
  import { HashedValues } from '@aztec/stdlib/tx';
5
- declare const APP_MAX_CALLS = 4;
6
- declare const FEE_MAX_CALLS = 2;
5
+ declare const APP_MAX_CALLS = 5;
7
6
  /** Encoded function call for an Aztec entrypoint */
8
7
  export type EncodedFunctionCall = {
9
8
  /** Arguments hash for the call. */
@@ -30,7 +29,7 @@ export type EncodedCalls = {
30
29
  * This utility class helps in creating the payload for the entrypoint by taking into
31
30
  * account how the calls are encoded and hashed.
32
31
  * */
33
- export declare abstract class EncodedCallsForEntrypoint implements EncodedCalls {
32
+ export declare class EncodedAppEntrypointCalls implements EncodedCalls {
34
33
  /** Function calls in the expected format (Noir's convention) */
35
34
  encodedFunctionCalls: EncodedFunctionCall[];
36
35
  /** The hashed args for the call, ready to be injected in the execution cache */
@@ -65,7 +64,7 @@ export declare abstract class EncodedCallsForEntrypoint implements EncodedCalls
65
64
  * Serializes the payload to an array of fields
66
65
  * @returns The fields of the payload
67
66
  */
68
- abstract toFields(): Fr[];
67
+ toFields(): Fr[];
69
68
  /**
70
69
  * Hashes the payload
71
70
  * @returns The hash of the payload
@@ -73,12 +72,6 @@ export declare abstract class EncodedCallsForEntrypoint implements EncodedCalls
73
72
  hash(): Promise<Fr>;
74
73
  /** Serializes the function calls to an array of fields. */
75
74
  protected functionCallsToFields(): Fr[];
76
- /**
77
- * Encodes a set of function calls for a dapp entrypoint
78
- * @param functionCalls - The function calls to execute
79
- * @returns The encoded calls
80
- */
81
- static fromFunctionCalls(functionCalls: FunctionCall[]): Promise<EncodedAppEntrypointCalls>;
82
75
  /**
83
76
  * Encodes the functions for the app-portion of a transaction from a set of function calls and a nonce
84
77
  * @param functionCalls - The function calls to execute
@@ -86,35 +79,8 @@ export declare abstract class EncodedCallsForEntrypoint implements EncodedCalls
86
79
  * nonce can be replaced by submitting a new one with a higher fee.
87
80
  * @returns The encoded calls
88
81
  */
89
- static fromAppExecution(functionCalls: FunctionCall[] | Tuple<FunctionCall, typeof APP_MAX_CALLS>, txNonce?: Fr): Promise<EncodedAppEntrypointCalls>;
90
- /**
91
- * Creates an encoded set of functions to pay the fee for a transaction
92
- * @param functionCalls - The calls generated by the payment method
93
- * @param isFeePayer - Whether the sender should be appointed as fee payer
94
- * @returns The encoded calls
95
- */
96
- static fromFeeCalls(functionCalls: FunctionCall[] | Tuple<FunctionCall, typeof FEE_MAX_CALLS>, isFeePayer: boolean): Promise<EncodedFeeEntrypointCalls>;
97
- }
98
- /** Encoded calls for app phase execution. */
99
- export declare class EncodedAppEntrypointCalls extends EncodedCallsForEntrypoint {
100
- constructor(encodedFunctionCalls: EncodedFunctionCall[], hashedArguments: HashedValues[], generatorIndex: number, txNonce: Fr);
101
- toFields(): Fr[];
82
+ static create(functionCalls: FunctionCall[] | Tuple<FunctionCall, typeof APP_MAX_CALLS>, txNonce?: Fr): Promise<EncodedAppEntrypointCalls>;
102
83
  }
103
- /** Encoded calls for fee payment */
104
- export declare class EncodedFeeEntrypointCalls extends EncodedCallsForEntrypoint {
105
- #private;
106
- constructor(encodedFunctionCalls: EncodedFunctionCall[], hashedArguments: HashedValues[], generatorIndex: number, txNonce: Fr, isFeePayer: boolean);
107
- toFields(): Fr[];
108
- /** Whether the sender should be appointed as fee payer. */
109
- get is_fee_payer(): boolean;
110
- }
111
- /**
112
- * Computes a hash of a combined set of app and fee calls.
113
- * @param appCalls - A set of app calls.
114
- * @param feeCalls - A set of calls used to pay fees.
115
- * @returns A hash of a combined call set.
116
- */
117
- export declare function computeCombinedPayloadHash(appPayload: EncodedAppEntrypointCalls, feePayload: EncodedFeeEntrypointCalls): Promise<Fr>;
118
84
  /** Encodes FunctionCalls for execution, following Noir's convention */
119
85
  export declare function encode(calls: FunctionCall[]): Promise<EncodedCalls>;
120
86
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"encoding.d.ts","sourceRoot":"","sources":["../src/encoding.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAgB,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAIhD,QAAA,MAAM,aAAa,IAAI,CAAC;AAExB,QAAA,MAAM,aAAa,IAAI,CAAC;AAExB,oDAAoD;AACpD,MAAM,MAAM,mBAAmB,GAAG;IAChC,mCAAmC;IACnC,oGAAoG;IACpG,SAAS,EAAE,EAAE,CAAC;IACd,uCAAuC;IACvC,iBAAiB,EAAE,EAAE,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,SAAS,EAAE,OAAO,CAAC;IACnB,2CAA2C;IAC3C,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,sFAAsF;AACtF,MAAM,MAAM,YAAY,GAAG;IACzB,gEAAgE;IAChE,oBAAoB,EAAE,mBAAmB,EAAE,CAAC;IAC5C,gFAAgF;IAChF,eAAe,EAAE,YAAY,EAAE,CAAC;CACjC,CAAC;AAEF;;;;KAIK;AACL,qBAAa,yBAA0B,YAAW,YAAY;IAE1D,gEAAgE;IACzD,oBAAoB,EAAE,mBAAmB,EAAE;IAClD,gFAAgF;IACzE,eAAe,EAAE,YAAY,EAAE;IACtC,oDAAoD;IAC7C,cAAc,EAAE,MAAM;IAC7B;;;;OAIG;IAEI,QAAQ,EAAE,EAAE;;IAZnB,gEAAgE;IACzD,oBAAoB,EAAE,mBAAmB,EAAE;IAClD,gFAAgF;IACzE,eAAe,EAAE,YAAY,EAAE;IACtC,oDAAoD;IAC7C,cAAc,EAAE,MAAM;IAC7B;;;;OAIG;IAEI,QAAQ,EAAE,EAAE;IAIrB;;;OAGG;IACH,IAAI,cAAc,0BAEjB;IAGD;;;OAGG;IACH,QAAQ,IAAI,EAAE,EAAE;IAIhB;;;OAGG;IACH,IAAI;IAIJ,2DAA2D;IAC3D,SAAS,CAAC,qBAAqB;IAU/B;;;;;;OAMG;WACU,MAAM,CACjB,aAAa,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC,YAAY,EAAE,OAAO,aAAa,CAAC,EACzE,OAAO,KAAc;CAcxB;AAED,uEAAuE;AACvE,wBAAsB,MAAM,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC,CAuBzE"}
package/dest/encoding.js CHANGED
@@ -6,14 +6,12 @@ import { FunctionCall, FunctionType } from '@aztec/stdlib/abi';
6
6
  import { HashedValues } from '@aztec/stdlib/tx';
7
7
  // These must match the values defined in:
8
8
  // - noir-projects/aztec-nr/aztec/src/entrypoint/app.nr
9
- const APP_MAX_CALLS = 4;
10
- // - and noir-projects/aztec-nr/aztec/src/entrypoint/fee.nr
11
- const FEE_MAX_CALLS = 2;
9
+ const APP_MAX_CALLS = 5;
12
10
  /**
13
11
  * Entrypoints derive their arguments from the calls that they'll ultimate make.
14
12
  * This utility class helps in creating the payload for the entrypoint by taking into
15
13
  * account how the calls are encoded and hashed.
16
- * */ export class EncodedCallsForEntrypoint {
14
+ * */ export class EncodedAppEntrypointCalls {
17
15
  encodedFunctionCalls;
18
16
  hashedArguments;
19
17
  generatorIndex;
@@ -35,6 +33,15 @@ const FEE_MAX_CALLS = 2;
35
33
  */ get function_calls() {
36
34
  return this.encodedFunctionCalls;
37
35
  }
36
+ /* eslint-enable camelcase */ /**
37
+ * Serializes the payload to an array of fields
38
+ * @returns The fields of the payload
39
+ */ toFields() {
40
+ return [
41
+ ...this.functionCallsToFields(),
42
+ this.tx_nonce
43
+ ];
44
+ }
38
45
  /**
39
46
  * Hashes the payload
40
47
  * @returns The hash of the payload
@@ -51,20 +58,12 @@ const FEE_MAX_CALLS = 2;
51
58
  ]);
52
59
  }
53
60
  /**
54
- * Encodes a set of function calls for a dapp entrypoint
55
- * @param functionCalls - The function calls to execute
56
- * @returns The encoded calls
57
- */ static async fromFunctionCalls(functionCalls) {
58
- const encoded = await encode(functionCalls);
59
- return new EncodedAppEntrypointCalls(encoded.encodedFunctionCalls, encoded.hashedArguments, 0, Fr.random());
60
- }
61
- /**
62
61
  * Encodes the functions for the app-portion of a transaction from a set of function calls and a nonce
63
62
  * @param functionCalls - The function calls to execute
64
63
  * @param txNonce - A nonce used to enable transaction cancellation when cancellable=true. Transactions with the same
65
64
  * nonce can be replaced by submitting a new one with a higher fee.
66
65
  * @returns The encoded calls
67
- */ static async fromAppExecution(functionCalls, txNonce = Fr.random()) {
66
+ */ static async create(functionCalls, txNonce = Fr.random()) {
68
67
  if (functionCalls.length > APP_MAX_CALLS) {
69
68
  throw new Error(`Expected at most ${APP_MAX_CALLS} function calls, got ${functionCalls.length}`);
70
69
  }
@@ -72,55 +71,6 @@ const FEE_MAX_CALLS = 2;
72
71
  const encoded = await encode(paddedCalls);
73
72
  return new EncodedAppEntrypointCalls(encoded.encodedFunctionCalls, encoded.hashedArguments, GeneratorIndex.SIGNATURE_PAYLOAD, txNonce);
74
73
  }
75
- /**
76
- * Creates an encoded set of functions to pay the fee for a transaction
77
- * @param functionCalls - The calls generated by the payment method
78
- * @param isFeePayer - Whether the sender should be appointed as fee payer
79
- * @returns The encoded calls
80
- */ static async fromFeeCalls(functionCalls, isFeePayer) {
81
- const paddedCalls = padArrayEnd(functionCalls, FunctionCall.empty(), FEE_MAX_CALLS);
82
- const encoded = await encode(paddedCalls);
83
- return new EncodedFeeEntrypointCalls(encoded.encodedFunctionCalls, encoded.hashedArguments, GeneratorIndex.FEE_PAYLOAD, Fr.random(), isFeePayer);
84
- }
85
- }
86
- /** Encoded calls for app phase execution. */ export class EncodedAppEntrypointCalls extends EncodedCallsForEntrypoint {
87
- constructor(encodedFunctionCalls, hashedArguments, generatorIndex, txNonce){
88
- super(encodedFunctionCalls, hashedArguments, generatorIndex, txNonce);
89
- }
90
- toFields() {
91
- return [
92
- ...this.functionCallsToFields(),
93
- this.tx_nonce
94
- ];
95
- }
96
- }
97
- /** Encoded calls for fee payment */ export class EncodedFeeEntrypointCalls extends EncodedCallsForEntrypoint {
98
- #isFeePayer;
99
- constructor(encodedFunctionCalls, hashedArguments, generatorIndex, txNonce, isFeePayer){
100
- super(encodedFunctionCalls, hashedArguments, generatorIndex, txNonce);
101
- this.#isFeePayer = isFeePayer;
102
- }
103
- toFields() {
104
- return [
105
- ...this.functionCallsToFields(),
106
- this.tx_nonce,
107
- new Fr(this.#isFeePayer)
108
- ];
109
- }
110
- /* eslint-disable camelcase */ /** Whether the sender should be appointed as fee payer. */ get is_fee_payer() {
111
- return this.#isFeePayer;
112
- }
113
- }
114
- /**
115
- * Computes a hash of a combined set of app and fee calls.
116
- * @param appCalls - A set of app calls.
117
- * @param feeCalls - A set of calls used to pay fees.
118
- * @returns A hash of a combined call set.
119
- */ export async function computeCombinedPayloadHash(appPayload, feePayload) {
120
- return poseidon2HashWithSeparator([
121
- await appPayload.hash(),
122
- await feePayload.hash()
123
- ], GeneratorIndex.COMBINED_PAYLOAD);
124
74
  }
125
75
  /** Encodes FunctionCalls for execution, following Noir's convention */ export async function encode(calls) {
126
76
  const hashedArguments = [];
@@ -1,7 +1,5 @@
1
1
  import type { Fr } from '@aztec/foundation/fields';
2
- import type { FieldsOf } from '@aztec/foundation/types';
3
2
  import type { AuthWitness } from '@aztec/stdlib/auth-witness';
4
- import type { AztecAddress } from '@aztec/stdlib/aztec-address';
5
3
  import type { GasSettings } from '@aztec/stdlib/gas';
6
4
  import type { TxExecutionRequest } from '@aztec/stdlib/tx';
7
5
  import type { ExecutionPayload } from './payload.js';
@@ -17,6 +15,17 @@ export type TxExecutionOptions = {
17
15
  * but higher fee. The nullifier ensures only one transaction can succeed.
18
16
  */
19
17
  txNonce?: Fr;
18
+ /**
19
+ * Account contracts usually support paying transaction fees using their own fee juice balance, which is configured
20
+ * by setting this flag to true.
21
+ */
22
+ isFeePayer: boolean;
23
+ /**
24
+ * When paying transactions with fee juice, the account contract itself usually has to signal the end of the setup phase since
25
+ * no other contract will do it. This is configurable independently of the previous flag because in the case of using
26
+ * FeeJuiceWithClaim the account contract is the fee payer, but the end of the setup is handled by the FeeJuice contract.
27
+ */
28
+ endSetup: boolean;
20
29
  };
21
30
  /**
22
31
  * Creates transaction execution requests out of a set of function calls, a fee payment method and
@@ -26,11 +35,11 @@ export interface EntrypointInterface {
26
35
  /**
27
36
  * Generates an execution request out of set of function calls.
28
37
  * @param exec - The execution intents to be run.
29
- * @param feeOptions - The fee options for the transaction.
30
- * @param options - Transaction nonce and whether the transaction is cancellable.
38
+ * @param gasSettings - The gas settings for the transaction.
39
+ * @param options - Miscellaneous tx options that enable/disable features of the account contract
31
40
  * @returns The authenticated transaction execution request.
32
41
  */
33
- createTxExecutionRequest(exec: ExecutionPayload, feeOptions: FeeOptions, options: TxExecutionOptions): Promise<TxExecutionRequest>;
42
+ createTxExecutionRequest(exec: ExecutionPayload, gasSettings: GasSettings, options: TxExecutionOptions): Promise<TxExecutionRequest>;
34
43
  }
35
44
  /** Creates authorization witnesses. */
36
45
  export interface AuthWitnessProvider {
@@ -41,45 +50,4 @@ export interface AuthWitnessProvider {
41
50
  */
42
51
  createAuthWit(messageHash: Fr | Buffer): Promise<AuthWitness>;
43
52
  }
44
- /**
45
- * Holds information about how the fee for a transaction is to be paid.
46
- */
47
- export interface FeePaymentMethod {
48
- /** The asset used to pay the fee. */
49
- getAsset(): Promise<AztecAddress>;
50
- /**
51
- * Returns the data to be added to the final execution request
52
- * to pay the fee in the given asset
53
- * @param gasSettings - The gas limits and max fees.
54
- * @returns The function calls to pay the fee.
55
- */
56
- getExecutionPayload(gasSettings: GasSettings): Promise<ExecutionPayload>;
57
- /**
58
- * The expected fee payer for this tx.
59
- */
60
- getFeePayer(): Promise<AztecAddress>;
61
- }
62
- /**
63
- * Fee payment options for a transaction.
64
- */
65
- export type FeeOptions = {
66
- /** The fee payment method to use */
67
- paymentMethod: FeePaymentMethod;
68
- /** The gas settings */
69
- gasSettings: GasSettings;
70
- };
71
- /** Fee options as set by a user. */
72
- export type UserFeeOptions = {
73
- /** The fee payment method to use */
74
- paymentMethod?: FeePaymentMethod;
75
- /** The gas settings */
76
- gasSettings?: Partial<FieldsOf<GasSettings>>;
77
- };
78
- /** Fee options that can be set for simulation *only* */
79
- export type SimulationUserFeeOptions = UserFeeOptions & {
80
- /** Whether to modify the fee settings of the simulation with high gas limit to figure out actual gas settings. */
81
- estimateGas?: boolean;
82
- /** Percentage to pad the estimated gas limits by, if empty, defaults to 0.1. Only relevant if estimateGas is set. */
83
- estimatedGasPadding?: number;
84
- };
85
53
  //# sourceMappingURL=interfaces.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"m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AAkB,CAAC,CAAC;CAChC;AAED,uCAAuC;AACvC,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,aAAa,CAAC,WAAW,EAAE,EAAE,GAAG,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;CAC/D"}
@@ -1 +1 @@
1
- /** Fee options that can be set for simulation *only* */ export { };
1
+ /** Creates authorization witnesses. */ export { };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@aztec/entrypoints",
3
3
  "homepage": "https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/entrypoints",
4
4
  "description": "Implementation of sample contract entrypoints for the Aztec Network",
5
- "version": "3.0.0-nightly.20251001",
5
+ "version": "3.0.0-nightly.20251002",
6
6
  "type": "module",
7
7
  "exports": {
8
8
  "./account": "./dest/account_entrypoint.js",
@@ -67,10 +67,10 @@
67
67
  ]
68
68
  },
69
69
  "dependencies": {
70
- "@aztec/constants": "3.0.0-nightly.20251001",
71
- "@aztec/foundation": "3.0.0-nightly.20251001",
72
- "@aztec/protocol-contracts": "3.0.0-nightly.20251001",
73
- "@aztec/stdlib": "3.0.0-nightly.20251001",
70
+ "@aztec/constants": "3.0.0-nightly.20251002",
71
+ "@aztec/foundation": "3.0.0-nightly.20251002",
72
+ "@aztec/protocol-contracts": "3.0.0-nightly.20251002",
73
+ "@aztec/stdlib": "3.0.0-nightly.20251002",
74
74
  "tslib": "^2.4.0"
75
75
  },
76
76
  "devDependencies": {
@@ -1,11 +1,12 @@
1
1
  import { Fr } from '@aztec/foundation/fields';
2
2
  import { type FunctionAbi, FunctionSelector, encodeArguments } from '@aztec/stdlib/abi';
3
3
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
4
+ import type { GasSettings } from '@aztec/stdlib/gas';
4
5
  import { HashedValues, TxContext, TxExecutionRequest } from '@aztec/stdlib/tx';
5
6
 
6
7
  import { DEFAULT_CHAIN_ID, DEFAULT_VERSION } from './constants.js';
7
- import { EncodedCallsForEntrypoint, computeCombinedPayloadHash } from './encoding.js';
8
- import type { AuthWitnessProvider, EntrypointInterface, FeeOptions, TxExecutionOptions } from './interfaces.js';
8
+ import { EncodedAppEntrypointCalls } from './encoding.js';
9
+ import type { AuthWitnessProvider, EntrypointInterface, TxExecutionOptions } from './interfaces.js';
9
10
  import { ExecutionPayload } from './payload.js';
10
11
 
11
12
  /**
@@ -22,48 +23,33 @@ export class DefaultAccountEntrypoint implements EntrypointInterface {
22
23
 
23
24
  async createTxExecutionRequest(
24
25
  exec: ExecutionPayload,
25
- feeOptions: FeeOptions,
26
+ gasSettings: GasSettings,
26
27
  options: TxExecutionOptions,
27
28
  ): Promise<TxExecutionRequest> {
28
29
  // Initial request with calls, authWitnesses and capsules
29
30
  const { calls, authWitnesses, capsules, extraHashedArgs } = exec;
30
31
  // Global tx options
31
- const { cancellable, txNonce } = options;
32
+ const { cancellable, txNonce, isFeePayer, endSetup } = options;
32
33
  // Encode the calls for the app
33
- const appEncodedCalls = await EncodedCallsForEntrypoint.fromAppExecution(calls, txNonce);
34
- // Get the execution payload for the fee, it includes the calls and potentially authWitnesses
35
- const { calls: feeCalls, authWitnesses: feeAuthwitnesses } = await feeOptions.paymentMethod.getExecutionPayload(
36
- feeOptions.gasSettings,
37
- );
38
- // Encode the calls for the fee
39
- const feePayer = await feeOptions.paymentMethod.getFeePayer();
40
- const isFeePayer = feePayer.equals(this.address);
41
- const feeEncodedCalls = await EncodedCallsForEntrypoint.fromFeeCalls(feeCalls, isFeePayer);
34
+ const encodedCalls = await EncodedAppEntrypointCalls.create(calls, txNonce);
42
35
 
43
36
  // Obtain the entrypoint hashed args, built from the app and fee encoded calls
44
37
  const abi = this.getEntrypointAbi();
45
38
  const entrypointHashedArgs = await HashedValues.fromArgs(
46
- encodeArguments(abi, [appEncodedCalls, feeEncodedCalls, !!cancellable]),
39
+ encodeArguments(abi, [encodedCalls, !!isFeePayer, !!endSetup, !!cancellable]),
47
40
  );
48
41
 
49
42
  // Generate the combined payload auth witness, by signing the hash of the combined payload
50
- const combinedPayloadAuthWitness = await this.auth.createAuthWit(
51
- await computeCombinedPayloadHash(appEncodedCalls, feeEncodedCalls),
52
- );
43
+ const appPayloadAuthwitness = await this.auth.createAuthWit(await encodedCalls.hash());
53
44
 
54
45
  // Assemble the tx request
55
46
  const txRequest = TxExecutionRequest.from({
56
47
  firstCallArgsHash: entrypointHashedArgs.hash,
57
48
  origin: this.address,
58
49
  functionSelector: await FunctionSelector.fromNameAndParameters(abi.name, abi.parameters),
59
- txContext: new TxContext(this.chainId, this.version, feeOptions.gasSettings),
60
- argsOfCalls: [
61
- ...appEncodedCalls.hashedArguments,
62
- ...feeEncodedCalls.hashedArguments,
63
- entrypointHashedArgs,
64
- ...extraHashedArgs,
65
- ],
66
- authWitnesses: [...authWitnesses, ...feeAuthwitnesses, combinedPayloadAuthWitness],
50
+ txContext: new TxContext(this.chainId, this.version, gasSettings),
51
+ argsOfCalls: [...encodedCalls.hashedArguments, entrypointHashedArgs, ...extraHashedArgs],
52
+ authWitnesses: [...authWitnesses, appPayloadAuthwitness],
67
53
  capsules,
68
54
  salt: Fr.random(),
69
55
  });
@@ -89,50 +75,7 @@ export class DefaultAccountEntrypoint implements EntrypointInterface {
89
75
  name: 'function_calls',
90
76
  type: {
91
77
  kind: 'array',
92
- length: 4,
93
- type: {
94
- kind: 'struct',
95
- path: 'authwit::entrypoint::function_call::FunctionCall',
96
- fields: [
97
- { name: 'args_hash', type: { kind: 'field' } },
98
- {
99
- name: 'function_selector',
100
- type: {
101
- kind: 'struct',
102
- path: 'authwit::aztec::protocol_types::abis::function_selector::FunctionSelector',
103
- fields: [{ name: 'inner', type: { kind: 'integer', sign: 'unsigned', width: 32 } }],
104
- },
105
- },
106
- {
107
- name: 'target_address',
108
- type: {
109
- kind: 'struct',
110
- path: 'authwit::aztec::protocol_types::address::AztecAddress',
111
- fields: [{ name: 'inner', type: { kind: 'field' } }],
112
- },
113
- },
114
- { name: 'is_public', type: { kind: 'boolean' } },
115
- { name: 'is_static', type: { kind: 'boolean' } },
116
- ],
117
- },
118
- },
119
- },
120
- { name: 'tx_nonce', type: { kind: 'field' } },
121
- ],
122
- },
123
- visibility: 'public',
124
- },
125
- {
126
- name: 'fee_payload',
127
- type: {
128
- kind: 'struct',
129
- path: 'authwit::entrypoint::fee::FeePayload',
130
- fields: [
131
- {
132
- name: 'function_calls',
133
- type: {
134
- kind: 'array',
135
- length: 2,
78
+ length: 5,
136
79
  type: {
137
80
  kind: 'struct',
138
81
  path: 'authwit::entrypoint::function_call::FunctionCall',
@@ -161,11 +104,12 @@ export class DefaultAccountEntrypoint implements EntrypointInterface {
161
104
  },
162
105
  },
163
106
  { name: 'tx_nonce', type: { kind: 'field' } },
164
- { name: 'is_fee_payer', type: { kind: 'boolean' } },
165
107
  ],
166
108
  },
167
109
  visibility: 'public',
168
110
  },
111
+ { name: 'is_fee_payer', type: { kind: 'boolean' } },
112
+ { name: 'end_setup', type: { kind: 'boolean' } },
169
113
  { name: 'cancellable', type: { kind: 'boolean' } },
170
114
  ],
171
115
  returnTypes: [],
@@ -1,7 +1,8 @@
1
1
  import { FunctionType } from '@aztec/stdlib/abi';
2
+ import type { GasSettings } from '@aztec/stdlib/gas';
2
3
  import { HashedValues, TxContext, TxExecutionRequest } from '@aztec/stdlib/tx';
3
4
 
4
- import type { EntrypointInterface, FeeOptions, TxExecutionOptions } from './interfaces.js';
5
+ import type { EntrypointInterface, TxExecutionOptions } from './interfaces.js';
5
6
  import type { ExecutionPayload } from './payload.js';
6
7
 
7
8
  /**
@@ -15,10 +16,10 @@ export class DefaultEntrypoint implements EntrypointInterface {
15
16
 
16
17
  async createTxExecutionRequest(
17
18
  exec: ExecutionPayload,
18
- feeOptions: FeeOptions,
19
+ gasSettings: GasSettings,
19
20
  options: TxExecutionOptions,
20
21
  ): Promise<TxExecutionRequest> {
21
- if (options.txNonce || options.cancellable !== undefined) {
22
+ if (options.txNonce || options.cancellable !== undefined || options.isFeePayer || options.endSetup) {
22
23
  throw new Error('TxExecutionOptions are not supported in DefaultEntrypoint');
23
24
  }
24
25
  // Initial request with calls, authWitnesses and capsules
@@ -42,7 +43,7 @@ export class DefaultEntrypoint implements EntrypointInterface {
42
43
  call.to,
43
44
  call.selector,
44
45
  hashedArguments[0].hash,
45
- new TxContext(this.chainId, this.rollupVersion, feeOptions.gasSettings),
46
+ new TxContext(this.chainId, this.rollupVersion, gasSettings),
46
47
  [...hashedArguments, ...extraHashedArgs],
47
48
  authWitnesses,
48
49
  capsules,
@@ -2,10 +2,11 @@ import { Fr } from '@aztec/foundation/fields';
2
2
  import { ProtocolContractAddress } from '@aztec/protocol-contracts';
3
3
  import { type FunctionAbi, FunctionSelector, encodeArguments } from '@aztec/stdlib/abi';
4
4
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
5
+ import type { GasSettings } from '@aztec/stdlib/gas';
5
6
  import { HashedValues, TxContext, TxExecutionRequest } from '@aztec/stdlib/tx';
6
7
 
7
- import { EncodedCallsForEntrypoint } from './encoding.js';
8
- import type { EntrypointInterface, FeeOptions } from './interfaces.js';
8
+ import { EncodedAppEntrypointCalls } from './encoding.js';
9
+ import type { EntrypointInterface } from './interfaces.js';
9
10
  import type { ExecutionPayload } from './payload.js';
10
11
 
11
12
  /**
@@ -18,20 +19,12 @@ export class DefaultMultiCallEntrypoint implements EntrypointInterface {
18
19
  private address: AztecAddress = ProtocolContractAddress.MultiCallEntrypoint,
19
20
  ) {}
20
21
 
21
- async createTxExecutionRequest(exec: ExecutionPayload, feeOptions: FeeOptions): Promise<TxExecutionRequest> {
22
+ async createTxExecutionRequest(exec: ExecutionPayload, gasSettings: GasSettings): Promise<TxExecutionRequest> {
22
23
  // Initial request with calls, authWitnesses and capsules
23
24
  const { calls, authWitnesses, capsules, extraHashedArgs } = exec;
24
25
 
25
- // Get the execution payload for the fee, it includes the calls and potentially authWitnesses
26
- const {
27
- calls: feeCalls,
28
- authWitnesses: feeAuthwitnesses,
29
- extraHashedArgs: feeExtraHashedArgs,
30
- } = await feeOptions.paymentMethod.getExecutionPayload(feeOptions.gasSettings);
31
-
32
- // Encode the calls, including the fee calls
33
- // (since this entrypoint does not distinguish between app and fee calls)
34
- const encodedCalls = await EncodedCallsForEntrypoint.fromAppExecution(calls.concat(feeCalls));
26
+ // Encode the calls for the app
27
+ const encodedCalls = await EncodedAppEntrypointCalls.create(calls);
35
28
 
36
29
  // Obtain the entrypoint hashed args, built from the encoded calls
37
30
  const abi = this.getEntrypointAbi();
@@ -42,9 +35,9 @@ export class DefaultMultiCallEntrypoint implements EntrypointInterface {
42
35
  firstCallArgsHash: entrypointHashedArgs.hash,
43
36
  origin: this.address,
44
37
  functionSelector: await FunctionSelector.fromNameAndParameters(abi.name, abi.parameters),
45
- txContext: new TxContext(this.chainId, this.version, feeOptions.gasSettings),
46
- argsOfCalls: [...encodedCalls.hashedArguments, entrypointHashedArgs, ...extraHashedArgs, ...feeExtraHashedArgs],
47
- authWitnesses: [...feeAuthwitnesses, ...authWitnesses],
38
+ txContext: new TxContext(this.chainId, this.version, gasSettings),
39
+ argsOfCalls: [...encodedCalls.hashedArguments, entrypointHashedArgs, ...extraHashedArgs],
40
+ authWitnesses,
48
41
  capsules,
49
42
  salt: Fr.random(),
50
43
  });
@@ -70,7 +63,7 @@ export class DefaultMultiCallEntrypoint implements EntrypointInterface {
70
63
  name: 'function_calls',
71
64
  type: {
72
65
  kind: 'array',
73
- length: 4,
66
+ length: 5,
74
67
  type: {
75
68
  kind: 'struct',
76
69
  path: 'authwit::entrypoint::function_call::FunctionCall',
package/src/encoding.ts CHANGED
@@ -8,9 +8,7 @@ import { HashedValues } from '@aztec/stdlib/tx';
8
8
 
9
9
  // These must match the values defined in:
10
10
  // - noir-projects/aztec-nr/aztec/src/entrypoint/app.nr
11
- const APP_MAX_CALLS = 4;
12
- // - and noir-projects/aztec-nr/aztec/src/entrypoint/fee.nr
13
- const FEE_MAX_CALLS = 2;
11
+ const APP_MAX_CALLS = 5;
14
12
 
15
13
  /** Encoded function call for an Aztec entrypoint */
16
14
  export type EncodedFunctionCall = {
@@ -40,7 +38,7 @@ export type EncodedCalls = {
40
38
  * This utility class helps in creating the payload for the entrypoint by taking into
41
39
  * account how the calls are encoded and hashed.
42
40
  * */
43
- export abstract class EncodedCallsForEntrypoint implements EncodedCalls {
41
+ export class EncodedAppEntrypointCalls implements EncodedCalls {
44
42
  constructor(
45
43
  /** Function calls in the expected format (Noir's convention) */
46
44
  public encodedFunctionCalls: EncodedFunctionCall[],
@@ -71,7 +69,9 @@ export abstract class EncodedCallsForEntrypoint implements EncodedCalls {
71
69
  * Serializes the payload to an array of fields
72
70
  * @returns The fields of the payload
73
71
  */
74
- abstract toFields(): Fr[];
72
+ toFields(): Fr[] {
73
+ return [...this.functionCallsToFields(), this.tx_nonce];
74
+ }
75
75
 
76
76
  /**
77
77
  * Hashes the payload
@@ -92,16 +92,6 @@ export abstract class EncodedCallsForEntrypoint implements EncodedCalls {
92
92
  ]);
93
93
  }
94
94
 
95
- /**
96
- * Encodes a set of function calls for a dapp entrypoint
97
- * @param functionCalls - The function calls to execute
98
- * @returns The encoded calls
99
- */
100
- static async fromFunctionCalls(functionCalls: FunctionCall[]) {
101
- const encoded = await encode(functionCalls);
102
- return new EncodedAppEntrypointCalls(encoded.encodedFunctionCalls, encoded.hashedArguments, 0, Fr.random());
103
- }
104
-
105
95
  /**
106
96
  * Encodes the functions for the app-portion of a transaction from a set of function calls and a nonce
107
97
  * @param functionCalls - The function calls to execute
@@ -109,7 +99,7 @@ export abstract class EncodedCallsForEntrypoint implements EncodedCalls {
109
99
  * nonce can be replaced by submitting a new one with a higher fee.
110
100
  * @returns The encoded calls
111
101
  */
112
- static async fromAppExecution(
102
+ static async create(
113
103
  functionCalls: FunctionCall[] | Tuple<FunctionCall, typeof APP_MAX_CALLS>,
114
104
  txNonce = Fr.random(),
115
105
  ) {
@@ -125,86 +115,6 @@ export abstract class EncodedCallsForEntrypoint implements EncodedCalls {
125
115
  txNonce,
126
116
  );
127
117
  }
128
-
129
- /**
130
- * Creates an encoded set of functions to pay the fee for a transaction
131
- * @param functionCalls - The calls generated by the payment method
132
- * @param isFeePayer - Whether the sender should be appointed as fee payer
133
- * @returns The encoded calls
134
- */
135
- static async fromFeeCalls(
136
- functionCalls: FunctionCall[] | Tuple<FunctionCall, typeof FEE_MAX_CALLS>,
137
- isFeePayer: boolean,
138
- ) {
139
- const paddedCalls = padArrayEnd(functionCalls, FunctionCall.empty(), FEE_MAX_CALLS);
140
- const encoded = await encode(paddedCalls);
141
- return new EncodedFeeEntrypointCalls(
142
- encoded.encodedFunctionCalls,
143
- encoded.hashedArguments,
144
- GeneratorIndex.FEE_PAYLOAD,
145
- Fr.random(),
146
- isFeePayer,
147
- );
148
- }
149
- }
150
-
151
- /** Encoded calls for app phase execution. */
152
- export class EncodedAppEntrypointCalls extends EncodedCallsForEntrypoint {
153
- constructor(
154
- encodedFunctionCalls: EncodedFunctionCall[],
155
- hashedArguments: HashedValues[],
156
- generatorIndex: number,
157
- txNonce: Fr,
158
- ) {
159
- super(encodedFunctionCalls, hashedArguments, generatorIndex, txNonce);
160
- }
161
-
162
- override toFields(): Fr[] {
163
- return [...this.functionCallsToFields(), this.tx_nonce];
164
- }
165
- }
166
-
167
- /** Encoded calls for fee payment */
168
- export class EncodedFeeEntrypointCalls extends EncodedCallsForEntrypoint {
169
- #isFeePayer: boolean;
170
-
171
- constructor(
172
- encodedFunctionCalls: EncodedFunctionCall[],
173
- hashedArguments: HashedValues[],
174
- generatorIndex: number,
175
- txNonce: Fr,
176
- isFeePayer: boolean,
177
- ) {
178
- super(encodedFunctionCalls, hashedArguments, generatorIndex, txNonce);
179
- this.#isFeePayer = isFeePayer;
180
- }
181
-
182
- override toFields(): Fr[] {
183
- return [...this.functionCallsToFields(), this.tx_nonce, new Fr(this.#isFeePayer)];
184
- }
185
-
186
- /* eslint-disable camelcase */
187
- /** Whether the sender should be appointed as fee payer. */
188
- get is_fee_payer() {
189
- return this.#isFeePayer;
190
- }
191
- /* eslint-enable camelcase */
192
- }
193
-
194
- /**
195
- * Computes a hash of a combined set of app and fee calls.
196
- * @param appCalls - A set of app calls.
197
- * @param feeCalls - A set of calls used to pay fees.
198
- * @returns A hash of a combined call set.
199
- */
200
- export async function computeCombinedPayloadHash(
201
- appPayload: EncodedAppEntrypointCalls,
202
- feePayload: EncodedFeeEntrypointCalls,
203
- ): Promise<Fr> {
204
- return poseidon2HashWithSeparator(
205
- [await appPayload.hash(), await feePayload.hash()],
206
- GeneratorIndex.COMBINED_PAYLOAD,
207
- );
208
118
  }
209
119
 
210
120
  /** Encodes FunctionCalls for execution, following Noir's convention */
package/src/interfaces.ts CHANGED
@@ -1,7 +1,5 @@
1
1
  import type { Fr } from '@aztec/foundation/fields';
2
- import type { FieldsOf } from '@aztec/foundation/types';
3
2
  import type { AuthWitness } from '@aztec/stdlib/auth-witness';
4
- import type { AztecAddress } from '@aztec/stdlib/aztec-address';
5
3
  import type { GasSettings } from '@aztec/stdlib/gas';
6
4
  import type { TxExecutionRequest } from '@aztec/stdlib/tx';
7
5
 
@@ -19,6 +17,17 @@ export type TxExecutionOptions = {
19
17
  * but higher fee. The nullifier ensures only one transaction can succeed.
20
18
  */
21
19
  txNonce?: Fr;
20
+ /**
21
+ * Account contracts usually support paying transaction fees using their own fee juice balance, which is configured
22
+ * by setting this flag to true.
23
+ */
24
+ isFeePayer: boolean;
25
+ /**
26
+ * When paying transactions with fee juice, the account contract itself usually has to signal the end of the setup phase since
27
+ * no other contract will do it. This is configurable independently of the previous flag because in the case of using
28
+ * FeeJuiceWithClaim the account contract is the fee payer, but the end of the setup is handled by the FeeJuice contract.
29
+ */
30
+ endSetup: boolean;
22
31
  };
23
32
 
24
33
  /**
@@ -29,13 +38,13 @@ export interface EntrypointInterface {
29
38
  /**
30
39
  * Generates an execution request out of set of function calls.
31
40
  * @param exec - The execution intents to be run.
32
- * @param feeOptions - The fee options for the transaction.
33
- * @param options - Transaction nonce and whether the transaction is cancellable.
41
+ * @param gasSettings - The gas settings for the transaction.
42
+ * @param options - Miscellaneous tx options that enable/disable features of the account contract
34
43
  * @returns The authenticated transaction execution request.
35
44
  */
36
45
  createTxExecutionRequest(
37
46
  exec: ExecutionPayload,
38
- feeOptions: FeeOptions,
47
+ gasSettings: GasSettings,
39
48
  options: TxExecutionOptions,
40
49
  ): Promise<TxExecutionRequest>;
41
50
  }
@@ -49,48 +58,3 @@ export interface AuthWitnessProvider {
49
58
  */
50
59
  createAuthWit(messageHash: Fr | Buffer): Promise<AuthWitness>;
51
60
  }
52
-
53
- /**
54
- * Holds information about how the fee for a transaction is to be paid.
55
- */
56
- export interface FeePaymentMethod {
57
- /** The asset used to pay the fee. */
58
- getAsset(): Promise<AztecAddress>;
59
- /**
60
- * Returns the data to be added to the final execution request
61
- * to pay the fee in the given asset
62
- * @param gasSettings - The gas limits and max fees.
63
- * @returns The function calls to pay the fee.
64
- */
65
- getExecutionPayload(gasSettings: GasSettings): Promise<ExecutionPayload>;
66
- /**
67
- * The expected fee payer for this tx.
68
- */
69
- getFeePayer(): Promise<AztecAddress>;
70
- }
71
-
72
- /**
73
- * Fee payment options for a transaction.
74
- */
75
- export type FeeOptions = {
76
- /** The fee payment method to use */
77
- paymentMethod: FeePaymentMethod;
78
- /** The gas settings */
79
- gasSettings: GasSettings;
80
- };
81
-
82
- /** Fee options as set by a user. */
83
- export type UserFeeOptions = {
84
- /** The fee payment method to use */
85
- paymentMethod?: FeePaymentMethod;
86
- /** The gas settings */
87
- gasSettings?: Partial<FieldsOf<GasSettings>>;
88
- };
89
-
90
- /** Fee options that can be set for simulation *only* */
91
- export type SimulationUserFeeOptions = UserFeeOptions & {
92
- /** Whether to modify the fee settings of the simulation with high gas limit to figure out actual gas settings. */
93
- estimateGas?: boolean;
94
- /** Percentage to pad the estimated gas limits by, if empty, defaults to 0.1. Only relevant if estimateGas is set. */
95
- estimatedGasPadding?: number;
96
- };