@aztec/aztec.js 0.80.0 → 0.81.0

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.
@@ -12,9 +12,14 @@ export interface AccountContract {
12
12
  */
13
13
  getContractArtifact(): Promise<ContractArtifact>;
14
14
  /**
15
- * Returns the deployment arguments for this instance, or undefined if this contract does not require deployment.
15
+ * Returns the deployment function name and arguments for this instance, or undefined if this contract does not require deployment.
16
16
  */
17
- getDeploymentArgs(): Promise<any[] | undefined>;
17
+ getDeploymentFunctionAndArgs(): Promise<{
18
+ /** The name of the function used to deploy the contract */
19
+ constructorName: string;
20
+ /** The args to the function used to deploy the contract */
21
+ constructorArgs: any[];
22
+ } | undefined>;
18
23
  /**
19
24
  * Returns the account interface for this account contract given a deployment at the provided address.
20
25
  * The account interface is responsible for assembling tx requests given requested function calls, and
@@ -33,5 +38,5 @@ export interface AccountContract {
33
38
  /**
34
39
  * Compute the address of an account contract from secret and salt.
35
40
  */
36
- export declare function getAccountContractAddress(accountContract: AccountContract, secret: Fr, salt: Fr): Promise<import("@aztec/stdlib/aztec-address").AztecAddress>;
41
+ export declare function getAccountContractAddress(accountContract: AccountContract, secret: Fr, salt: Fr): Promise<import("../index.js").AztecAddress>;
37
42
  //# sourceMappingURL=contract.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src/account/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAIxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAG5E;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,mBAAmB,IAAI,OAAO,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eAAe,EAAE,eAAe,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,+CAcrG"}
@@ -5,9 +5,13 @@ import { deriveKeys } from '@aztec/stdlib/keys';
5
5
  * Compute the address of an account contract from secret and salt.
6
6
  */ export async function getAccountContractAddress(accountContract, secret, salt) {
7
7
  const { publicKeys } = await deriveKeys(secret);
8
- const constructorArgs = await accountContract.getDeploymentArgs();
8
+ const { constructorName, constructorArgs } = await accountContract.getDeploymentFunctionAndArgs() ?? {
9
+ constructorName: undefined,
10
+ constructorArgs: undefined
11
+ };
9
12
  const artifact = await accountContract.getContractArtifact();
10
13
  const instance = await getContractInstanceFromDeployParams(artifact, {
14
+ constructorArtifact: constructorName,
11
15
  constructorArgs,
12
16
  salt,
13
17
  publicKeys
@@ -51,7 +51,7 @@ export declare class AccountManager {
51
51
  * Does not require the account to be deployed or registered.
52
52
  * @returns The address.
53
53
  */
54
- getAddress(): import("@aztec/stdlib/aztec-address").AztecAddress;
54
+ getAddress(): import("../index.js").AztecAddress;
55
55
  /**
56
56
  * Returns the contract instance definition associated with this account.
57
57
  * Does not require the account to be deployed or registered.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/account_manager/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,KAAK,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAE3F,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAG3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,YAAY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AO,CAAC,eAAe;IACvB,OAAO,CAAC,QAAQ;IAChB;;OAEG;aACa,IAAI,EAAE,IAAI;IAR5B,OAAO;WAWM,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE,eAAe,EAAE,eAAe,EAAE,IAAI,CAAC,EAAE,IAAI;IAoB1F,SAAS,CAAC,aAAa;IAIvB,SAAS,CAAC,iBAAiB;IAI3B;;;OAGG;IACU,UAAU,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAMpD;;;;OAIG;IACI,kBAAkB,IAAI,OAAO,CAAC,eAAe,CAAC;IAIrD;;;;OAIG;IACI,UAAU;IAIjB;;;;OAIG;IACI,WAAW,IAAI,2BAA2B;IAIjD;;;;OAIG;IACU,SAAS,IAAI,OAAO,CAAC,0BAA0B,CAAC;IAK7D;;;;;;OAMG;IACU,QAAQ,IAAI,OAAO,CAAC,0BAA0B,CAAC;IAW5D;;;;;;OAMG;IACU,eAAe,CAAC,YAAY,CAAC,EAAE,MAAM;IA8ClD;;;;;;;OAOG;IACI,MAAM,CAAC,IAAI,CAAC,EAAE,oBAAoB,GAAG,mBAAmB;IAgB/D;;;;;;OAMG;IACU,SAAS,CAAC,IAAI,GAAE,oBAAoB,GAAG,QAA0B,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAKpH;;OAEG;IACU,YAAY;CAG1B;AAED,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,KAAK,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC"}
@@ -30,9 +30,14 @@ import { DeployAccountSentTx } from './deploy_account_sent_tx.js';
30
30
  static async create(pxe, secretKey, accountContract, salt) {
31
31
  const { publicKeys } = await deriveKeys(secretKey);
32
32
  salt = salt !== undefined ? new Fr(salt) : Fr.random();
33
+ const { constructorName, constructorArgs } = await accountContract.getDeploymentFunctionAndArgs() ?? {
34
+ constructorName: undefined,
35
+ constructorArgs: undefined
36
+ };
33
37
  const artifact = await accountContract.getContractArtifact();
34
38
  const instance = await getContractInstanceFromDeployParams(artifact, {
35
- constructorArgs: await accountContract.getDeploymentArgs(),
39
+ constructorArtifact: constructorName,
40
+ constructorArgs,
36
41
  salt: salt,
37
42
  publicKeys
38
43
  });
@@ -108,18 +113,21 @@ import { DeployAccountSentTx } from './deploy_account_sent_tx.js';
108
113
  }
109
114
  const completeAddress = await this.getCompleteAddress();
110
115
  await this.pxe.registerAccount(this.secretKey, completeAddress.partialAddress);
111
- const args = await this.accountContract.getDeploymentArgs() ?? [];
116
+ const { constructorName, constructorArgs } = await this.accountContract.getDeploymentFunctionAndArgs() ?? {
117
+ constructorName: undefined,
118
+ constructorArgs: undefined
119
+ };
112
120
  if (deployWallet) {
113
121
  // If deploying using an existing wallet/account, treat it like regular contract deployment.
114
122
  const thisWallet = await this.getWallet();
115
- return new DeployMethod(this.getPublicKeys(), deployWallet, artifact, (address)=>Contract.at(address, artifact, thisWallet), args, 'constructor');
123
+ return new DeployMethod(this.getPublicKeys(), deployWallet, artifact, (address)=>Contract.at(address, artifact, thisWallet), constructorArgs, constructorName);
116
124
  }
117
125
  const { l1ChainId: chainId, protocolVersion } = await this.pxe.getNodeInfo();
118
126
  // We use a signerless wallet with the multi call entrypoint in order to make multiple calls in one go.
119
127
  // If we used getWallet, the deployment would get routed via the account contract entrypoint
120
128
  // and it can't be used unless the contract is initialized.
121
129
  const wallet = new SignerlessWallet(this.pxe, new DefaultMultiCallEntrypoint(chainId, protocolVersion));
122
- return new DeployAccountMethod(this.accountContract.getAuthWitnessProvider(completeAddress), this.getPublicKeys(), wallet, artifact, args, 'constructor', 'entrypoint');
130
+ return new DeployAccountMethod(this.accountContract.getAuthWitnessProvider(completeAddress), this.getPublicKeys(), wallet, artifact, constructorArgs, constructorName, 'entrypoint');
123
131
  }
124
132
  /**
125
133
  * Deploys the account contract that backs this account.
@@ -152,7 +160,7 @@ import { DeployAccountSentTx } from './deploy_account_sent_tx.js';
152
160
  /**
153
161
  * Returns whether this account contract has a constructor and needs deployment.
154
162
  */ async isDeployable() {
155
- return await this.accountContract.getDeploymentArgs() !== undefined;
163
+ return await this.accountContract.getDeploymentFunctionAndArgs() !== undefined;
156
164
  }
157
165
  }
158
166
  export { DeployAccountMethod } from './deploy_account_method.js';
@@ -48,7 +48,7 @@ export declare class ContractBase {
48
48
  /** The wallet used for interacting with this contract. */
49
49
  wallet: Wallet);
50
50
  /** Address of the contract. */
51
- get address(): import("@aztec/stdlib/aztec-address").AztecAddress;
51
+ get address(): import("../index.js").AztecAddress;
52
52
  /** Partial address of the contract. */
53
53
  get partialAddress(): Promise<import("@aztec/foundation/schemas").Fr>;
54
54
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"contract_base.d.ts","sourceRoot":"","sources":["../../src/contract/contract_base.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,WAAW,EAEhB,gBAAgB,EAEjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,2BAA2B,EAAyB,MAAM,wBAAwB,CAAC;AAEjG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AAEjF;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,2BAA2B,CAAC,GAAG;IAC/E;;OAEG;IACH,QAAQ,EAAE,MAAM,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAC3C,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,MAAM,IAAI;KACnD,CAAC,IAAI,CAAC,GAAG,WAAW;CACtB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,MAAM,IAAI;KAC3C,CAAC,IAAI,CAAC,GAAG,YAAY;CACvB,CAAC;AA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MAAM,aAAa,CAAC,CAAC,SAAS,MAAM,IAAI;KAC3C,CAAC,IAAI,CAAC,GAAG,YAAY;CACvB,CAAC;AAEF;;GAEG;AACH,qBAAa,YAAY;IAOrB,iDAAiD;aACjC,QAAQ,EAAE,2BAA2B;IACrD,yDAAyD;aACzC,QAAQ,EAAE,gBAAgB;IAC1C,0DAA0D;IACnD,MAAM,EAAE,MAAM;IAXvB;;OAEG;IACI,OAAO,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAAA;KAAE,CAAM;IAExD,SAAS;IACP,iDAAiD;IACjC,QAAQ,EAAE,2BAA2B;IACrD,yDAAyD;IACzC,QAAQ,EAAE,gBAAgB;IAC1C,0DAA0D;IACnD,MAAM,EAAE,MAAM;IAmBvB,+BAA+B;IAC/B,IAAW,OAAO,uCAEjB;IAED,uCAAuC;IACvC,IAAW,cAAc,oDAExB;IAED;;;;OAIG;IACI,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;CAGxC"}
package/dest/index.d.ts CHANGED
@@ -30,7 +30,7 @@ export { AuthWitness } from '@aztec/stdlib/auth-witness';
30
30
  export { getTimestampRangeForEpoch } from '@aztec/stdlib/epoch-helpers';
31
31
  export { Tx, TxExecutionRequest, TxHash, TxReceipt, TxStatus, Capsule, HashedValues, GlobalVariables, } from '@aztec/stdlib/tx';
32
32
  export { Body, L2Block } from '@aztec/stdlib/block';
33
- export { L1NotePayload, LogId, type LogFilter, EncryptedLogPayload } from '@aztec/stdlib/logs';
33
+ export { LogId, type LogFilter, EncryptedLogPayload } from '@aztec/stdlib/logs';
34
34
  export { L1EventPayload, EventMetadata } from '@aztec/stdlib/event';
35
35
  export { L1ToL2Message, L2Actor, L1Actor } from '@aztec/stdlib/messaging';
36
36
  export { UniqueNote, ExtendedNote, Comparator, Note } from '@aztec/stdlib/note';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;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O,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAKtD,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC"}
package/dest/index.js CHANGED
@@ -29,7 +29,7 @@ export { AuthWitness } from '@aztec/stdlib/auth-witness';
29
29
  export { getTimestampRangeForEpoch } from '@aztec/stdlib/epoch-helpers';
30
30
  export { Tx, TxExecutionRequest, TxHash, TxReceipt, TxStatus, Capsule, HashedValues, GlobalVariables } from '@aztec/stdlib/tx';
31
31
  export { Body, L2Block } from '@aztec/stdlib/block';
32
- export { L1NotePayload, LogId, EncryptedLogPayload } from '@aztec/stdlib/logs';
32
+ export { LogId, EncryptedLogPayload } from '@aztec/stdlib/logs';
33
33
  export { L1EventPayload, EventMetadata } from '@aztec/stdlib/event';
34
34
  export { L1ToL2Message, L2Actor, L1Actor } from '@aztec/stdlib/messaging';
35
35
  export { UniqueNote, ExtendedNote, Comparator, Note } from '@aztec/stdlib/note';
@@ -50,10 +50,10 @@ export declare class AztecCheatCodes {
50
50
  /**
51
51
  * Loads the value stored at the given slot in the private storage of the given contract.
52
52
  * @param contract - The address of the contract
53
- * @param owner - The owner for whom the notes are encrypted
53
+ * @param recipient - The address whose public key was used to encrypt the note
54
54
  * @param slot - The storage slot to lookup
55
55
  * @returns The notes stored at the given slot
56
56
  */
57
- loadPrivate(owner: AztecAddress, contract: AztecAddress, slot: Fr | bigint): Promise<Note[]>;
57
+ loadPrivate(recipient: AztecAddress, contract: AztecAddress, slot: Fr | bigint): Promise<Note[]>;
58
58
  }
59
59
  //# sourceMappingURL=aztec_cheat_codes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"aztec_cheat_codes.d.ts","sourceRoot":"","sources":["../../src/test/aztec_cheat_codes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE/C;;GAEG;AACH,qBAAa,eAAe;IAExB;;OAEG;IACI,GAAG,EAAE,GAAG;IACf;;OAEG;IACI,MAAM;;IAPb;;OAEG;IACI,GAAG,EAAE,GAAG;IACf;;OAEG;IACI,MAAM,yCAAsC;IAGrD;;;;;OAKG;IACI,gBAAgB,CAAC,OAAO,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,EAAE,GAAG,MAAM,GAAG,YAAY,GAAG,OAAO,CAAC,EAAE,CAAC;IAK3F;;;OAGG;IACU,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;IAI3C;;;OAGG;IACU,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;IAKzC;;;;;OAKG;IACU,UAAU,CAAC,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,MAAM,GAAG,OAAO,CAAC,EAAE,CAAC;IAK1E;;;;;;OAMG;IACU,WAAW,CAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;CAQ1G"}
1
+ {"version":3,"file":"aztec_cheat_codes.d.ts","sourceRoot":"","sources":["../../src/test/aztec_cheat_codes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE/C;;GAEG;AACH,qBAAa,eAAe;IAExB;;OAEG;IACI,GAAG,EAAE,GAAG;IACf;;OAEG;IACI,MAAM;;IAPb;;OAEG;IACI,GAAG,EAAE,GAAG;IACf;;OAEG;IACI,MAAM,yCAAsC;IAGrD;;;;;OAKG;IACI,gBAAgB,CAAC,OAAO,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,EAAE,GAAG,MAAM,GAAG,YAAY,GAAG,OAAO,CAAC,EAAE,CAAC;IAK3F;;;OAGG;IACU,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;IAI3C;;;OAGG;IACU,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;IAKzC;;;;;OAKG;IACU,UAAU,CAAC,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,MAAM,GAAG,OAAO,CAAC,EAAE,CAAC;IAK1E;;;;;;OAMG;IACU,WAAW,CAAC,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;CAQ9G"}
@@ -48,12 +48,12 @@ import { deriveStorageSlotInMap } from '@aztec/stdlib/hash';
48
48
  /**
49
49
  * Loads the value stored at the given slot in the private storage of the given contract.
50
50
  * @param contract - The address of the contract
51
- * @param owner - The owner for whom the notes are encrypted
51
+ * @param recipient - The address whose public key was used to encrypt the note
52
52
  * @param slot - The storage slot to lookup
53
53
  * @returns The notes stored at the given slot
54
- */ async loadPrivate(owner, contract, slot) {
54
+ */ async loadPrivate(recipient, contract, slot) {
55
55
  const extendedNotes = await this.pxe.getNotes({
56
- owner,
56
+ recipient,
57
57
  contractAddress: contract,
58
58
  storageSlot: new Fr(slot)
59
59
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aztec/aztec.js",
3
3
  "homepage": "https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/aztec.js",
4
- "version": "0.80.0",
4
+ "version": "0.81.0",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": "./dest/index.js",
@@ -79,12 +79,12 @@
79
79
  ]
80
80
  },
81
81
  "dependencies": {
82
- "@aztec/constants": "0.80.0",
83
- "@aztec/ethereum": "0.80.0",
84
- "@aztec/foundation": "0.80.0",
85
- "@aztec/l1-artifacts": "0.80.0",
86
- "@aztec/protocol-contracts": "0.80.0",
87
- "@aztec/stdlib": "0.80.0",
82
+ "@aztec/constants": "0.81.0",
83
+ "@aztec/ethereum": "0.81.0",
84
+ "@aztec/foundation": "0.81.0",
85
+ "@aztec/l1-artifacts": "0.81.0",
86
+ "@aztec/protocol-contracts": "0.81.0",
87
+ "@aztec/stdlib": "0.81.0",
88
88
  "axios": "^1.7.2",
89
89
  "tslib": "^2.4.0",
90
90
  "viem": "2.23.7"
@@ -18,9 +18,17 @@ export interface AccountContract {
18
18
  getContractArtifact(): Promise<ContractArtifact>;
19
19
 
20
20
  /**
21
- * Returns the deployment arguments for this instance, or undefined if this contract does not require deployment.
21
+ * Returns the deployment function name and arguments for this instance, or undefined if this contract does not require deployment.
22
22
  */
23
- getDeploymentArgs(): Promise<any[] | undefined>;
23
+ getDeploymentFunctionAndArgs(): Promise<
24
+ | {
25
+ /** The name of the function used to deploy the contract */
26
+ constructorName: string;
27
+ /** The args to the function used to deploy the contract */
28
+ constructorArgs: any[];
29
+ }
30
+ | undefined
31
+ >;
24
32
 
25
33
  /**
26
34
  * Returns the account interface for this account contract given a deployment at the provided address.
@@ -45,9 +53,13 @@ export interface AccountContract {
45
53
  */
46
54
  export async function getAccountContractAddress(accountContract: AccountContract, secret: Fr, salt: Fr) {
47
55
  const { publicKeys } = await deriveKeys(secret);
48
- const constructorArgs = await accountContract.getDeploymentArgs();
56
+ const { constructorName, constructorArgs } = (await accountContract.getDeploymentFunctionAndArgs()) ?? {
57
+ constructorName: undefined,
58
+ constructorArgs: undefined,
59
+ };
49
60
  const artifact = await accountContract.getContractArtifact();
50
61
  const instance = await getContractInstanceFromDeployParams(artifact, {
62
+ constructorArtifact: constructorName,
51
63
  constructorArgs,
52
64
  salt,
53
65
  publicKeys,
@@ -48,9 +48,15 @@ export class AccountManager {
48
48
  const { publicKeys } = await deriveKeys(secretKey);
49
49
  salt = salt !== undefined ? new Fr(salt) : Fr.random();
50
50
 
51
+ const { constructorName, constructorArgs } = (await accountContract.getDeploymentFunctionAndArgs()) ?? {
52
+ constructorName: undefined,
53
+ constructorArgs: undefined,
54
+ };
55
+
51
56
  const artifact = await accountContract.getContractArtifact();
52
57
  const instance = await getContractInstanceFromDeployParams(artifact, {
53
- constructorArgs: await accountContract.getDeploymentArgs(),
58
+ constructorArtifact: constructorName,
59
+ constructorArgs,
54
60
  salt: salt,
55
61
  publicKeys,
56
62
  });
@@ -149,7 +155,10 @@ export class AccountManager {
149
155
 
150
156
  await this.pxe.registerAccount(this.secretKey, completeAddress.partialAddress);
151
157
 
152
- const args = (await this.accountContract.getDeploymentArgs()) ?? [];
158
+ const { constructorName, constructorArgs } = (await this.accountContract.getDeploymentFunctionAndArgs()) ?? {
159
+ constructorName: undefined,
160
+ constructorArgs: undefined,
161
+ };
153
162
 
154
163
  if (deployWallet) {
155
164
  // If deploying using an existing wallet/account, treat it like regular contract deployment.
@@ -159,8 +168,8 @@ export class AccountManager {
159
168
  deployWallet,
160
169
  artifact,
161
170
  address => Contract.at(address, artifact, thisWallet),
162
- args,
163
- 'constructor',
171
+ constructorArgs,
172
+ constructorName,
164
173
  );
165
174
  }
166
175
 
@@ -175,8 +184,8 @@ export class AccountManager {
175
184
  this.getPublicKeys(),
176
185
  wallet,
177
186
  artifact,
178
- args,
179
- 'constructor',
187
+ constructorArgs,
188
+ constructorName,
180
189
  'entrypoint',
181
190
  );
182
191
  }
@@ -221,7 +230,7 @@ export class AccountManager {
221
230
  * Returns whether this account contract has a constructor and needs deployment.
222
231
  */
223
232
  public async isDeployable() {
224
- return (await this.accountContract.getDeploymentArgs()) !== undefined;
233
+ return (await this.accountContract.getDeploymentFunctionAndArgs()) !== undefined;
225
234
  }
226
235
  }
227
236
 
package/src/index.ts CHANGED
@@ -48,7 +48,7 @@ export {
48
48
  GlobalVariables,
49
49
  } from '@aztec/stdlib/tx';
50
50
  export { Body, L2Block } from '@aztec/stdlib/block';
51
- export { L1NotePayload, LogId, type LogFilter, EncryptedLogPayload } from '@aztec/stdlib/logs';
51
+ export { LogId, type LogFilter, EncryptedLogPayload } from '@aztec/stdlib/logs';
52
52
  export { L1EventPayload, EventMetadata } from '@aztec/stdlib/event';
53
53
  export { L1ToL2Message, L2Actor, L1Actor } from '@aztec/stdlib/messaging';
54
54
  export { UniqueNote, ExtendedNote, Comparator, Note } from '@aztec/stdlib/note';
@@ -62,13 +62,13 @@ export class AztecCheatCodes {
62
62
  /**
63
63
  * Loads the value stored at the given slot in the private storage of the given contract.
64
64
  * @param contract - The address of the contract
65
- * @param owner - The owner for whom the notes are encrypted
65
+ * @param recipient - The address whose public key was used to encrypt the note
66
66
  * @param slot - The storage slot to lookup
67
67
  * @returns The notes stored at the given slot
68
68
  */
69
- public async loadPrivate(owner: AztecAddress, contract: AztecAddress, slot: Fr | bigint): Promise<Note[]> {
69
+ public async loadPrivate(recipient: AztecAddress, contract: AztecAddress, slot: Fr | bigint): Promise<Note[]> {
70
70
  const extendedNotes = await this.pxe.getNotes({
71
- owner,
71
+ recipient,
72
72
  contractAddress: contract,
73
73
  storageSlot: new Fr(slot),
74
74
  });