@aztec/aztec.js 0.79.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.
- package/dest/account/contract.d.ts +8 -3
- package/dest/account/contract.d.ts.map +1 -1
- package/dest/account/contract.js +5 -1
- package/dest/account_manager/index.d.ts +1 -1
- package/dest/account_manager/index.d.ts.map +1 -1
- package/dest/account_manager/index.js +13 -5
- package/dest/api/abi.d.ts +1 -1
- package/dest/api/abi.d.ts.map +1 -1
- package/dest/api/abi.js +1 -1
- package/dest/contract/checker.d.ts +1 -1
- package/dest/contract/checker.d.ts.map +1 -1
- package/dest/contract/checker.js +2 -2
- package/dest/contract/contract_base.d.ts +1 -1
- package/dest/contract/contract_base.d.ts.map +1 -1
- package/dest/contract/contract_base.js +2 -2
- package/dest/contract/deploy_method.d.ts.map +1 -1
- package/dest/index.d.ts +1 -1
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +1 -1
- package/dest/test/aztec_cheat_codes.d.ts +2 -2
- package/dest/test/aztec_cheat_codes.d.ts.map +1 -1
- package/dest/test/aztec_cheat_codes.js +3 -3
- package/package.json +7 -7
- package/src/account/contract.ts +15 -3
- package/src/account_manager/index.ts +16 -7
- package/src/api/abi.ts +4 -0
- package/src/contract/checker.ts +8 -3
- package/src/contract/contract_base.ts +3 -2
- package/src/contract/deploy_method.ts +2 -2
- package/src/index.ts +1 -1
- package/src/test/aztec_cheat_codes.ts +3 -3
|
@@ -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
|
-
|
|
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("
|
|
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,CAAC,gBAAgB,CAAC,CAAC;IAEjD;;OAEG;IACH,
|
|
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,CAAC,gBAAgB,CAAC,CAAC;IAEjD;;OAEG;IACH,4BAA4B,IAAI,OAAO,CACnC;QACE,2DAA2D;QAC3D,eAAe,EAAE,MAAM,CAAC;QACxB,2DAA2D;QAC3D,eAAe,EAAE,GAAG,EAAE,CAAC;KACxB,GACD,SAAS,CACZ,CAAC;IAEF;;;;;;;OAOG;IACH,YAAY,CAAC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,QAAQ,GAAG,gBAAgB,CAAC;IAE7E;;;OAGG;IACH,sBAAsB,CAAC,OAAO,EAAE,eAAe,GAAG,mBAAmB,CAAC;CACvE;AAGD;;GAEG;AACH,wBAAsB,yBAAyB,CAAC,eAAe,EAAE,eAAe,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,+CAcrG"}
|
package/dest/account/contract.js
CHANGED
|
@@ -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.
|
|
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("
|
|
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,EAAE,KAAK,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAChF,OAAO,EAAmB,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAExE,OAAO,EAAE,0BAA0B,EAAoB,MAAM,oBAAoB,CAAC;AAElF,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,IAAI,CACrC,aAAa,EACb,KAAK,GAAG,uBAAuB,GAAG,sBAAsB,GAAG,oBAAoB,CAChF,GAAG;IACF;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;GAGG;AACH,qBAAa,cAAc;IAEvB,OAAO,CAAC,GAAG;IACX,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,eAAe;I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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
|
-
|
|
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
|
|
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),
|
|
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,
|
|
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.
|
|
163
|
+
return await this.accountContract.getDeploymentFunctionAndArgs() !== undefined;
|
|
156
164
|
}
|
|
157
165
|
}
|
|
158
166
|
export { DeployAccountMethod } from './deploy_account_method.js';
|
package/dest/api/abi.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { type ContractArtifact, type FunctionArtifact, EventSelector, FunctionSelector, FunctionCall, NoteSelector, type ABIParameter, decodeFromAbi, encodeArguments, type AbiType, isAddressStruct, isAztecAddressStruct, isEthAddressStruct, isWrappedFieldStruct, isFunctionSelectorStruct, loadContractArtifact, contractArtifactToBuffer, contractArtifactFromBuffer, } from '@aztec/stdlib/abi';
|
|
1
|
+
export { type ContractArtifact, type FunctionArtifact, type FunctionAbi, EventSelector, FunctionType, FunctionSelector, FunctionCall, NoteSelector, type ABIParameter, decodeFromAbi, encodeArguments, type AbiType, isAddressStruct, isAztecAddressStruct, isEthAddressStruct, isWrappedFieldStruct, isFunctionSelectorStruct, loadContractArtifact, loadContractArtifactForPublic, getAllFunctionAbis, contractArtifactToBuffer, contractArtifactFromBuffer, } from '@aztec/stdlib/abi';
|
|
2
2
|
export { type NoirCompiledContract } from '@aztec/stdlib/noir';
|
|
3
3
|
//# sourceMappingURL=abi.d.ts.map
|
package/dest/api/abi.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abi.d.ts","sourceRoot":"","sources":["../../src/api/abi.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,KAAK,YAAY,EACjB,aAAa,EACb,eAAe,EACf,KAAK,OAAO,EACZ,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EACpB,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"abi.d.ts","sourceRoot":"","sources":["../../src/api/abi.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,KAAK,YAAY,EACjB,aAAa,EACb,eAAe,EACf,KAAK,OAAO,EACZ,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EACpB,6BAA6B,EAC7B,kBAAkB,EAClB,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dest/api/abi.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { EventSelector, FunctionSelector, FunctionCall, NoteSelector, decodeFromAbi, encodeArguments, isAddressStruct, isAztecAddressStruct, isEthAddressStruct, isWrappedFieldStruct, isFunctionSelectorStruct, loadContractArtifact, contractArtifactToBuffer, contractArtifactFromBuffer } from '@aztec/stdlib/abi';
|
|
1
|
+
export { EventSelector, FunctionType, FunctionSelector, FunctionCall, NoteSelector, decodeFromAbi, encodeArguments, isAddressStruct, isAztecAddressStruct, isEthAddressStruct, isWrappedFieldStruct, isFunctionSelectorStruct, loadContractArtifact, loadContractArtifactForPublic, getAllFunctionAbis, contractArtifactToBuffer, contractArtifactFromBuffer } from '@aztec/stdlib/abi';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ContractArtifact } from '@aztec/stdlib/abi';
|
|
2
2
|
/**
|
|
3
3
|
* Validates the given ContractArtifact object by checking its functions and their parameters.
|
|
4
4
|
* Ensures that the ABI has at least one function, a constructor, valid bytecode, and correct parameter types.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checker.d.ts","sourceRoot":"","sources":["../../src/contract/checker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"checker.d.ts","sourceRoot":"","sources":["../../src/contract/checker.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,gBAAgB,EAGtB,MAAM,mBAAmB,CAAC;AAQ3B;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,gBAAgB,WA6BpD"}
|
package/dest/contract/checker.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getDefaultInitializer } from '@aztec/stdlib/abi';
|
|
1
2
|
/**
|
|
2
3
|
* Validates the given ContractArtifact object by checking its functions and their parameters.
|
|
3
4
|
* Ensures that the ABI has at least one function, a constructor, valid bytecode, and correct parameter types.
|
|
@@ -24,8 +25,7 @@
|
|
|
24
25
|
abiParameterTypeChecker(param.type);
|
|
25
26
|
});
|
|
26
27
|
});
|
|
27
|
-
|
|
28
|
-
if (!artifact.functions.find((func)=>func.name === 'constructor')) {
|
|
28
|
+
if (!getDefaultInitializer(artifact)) {
|
|
29
29
|
throw new Error('ABI has no constructor');
|
|
30
30
|
}
|
|
31
31
|
return true;
|
|
@@ -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("
|
|
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,
|
|
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;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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FunctionSelector } from '@aztec/stdlib/abi';
|
|
1
|
+
import { FunctionSelector, getAllFunctionAbis } from '@aztec/stdlib/abi';
|
|
2
2
|
import { computePartialAddress } from '@aztec/stdlib/contract';
|
|
3
3
|
import { ContractFunctionInteraction } from './contract_function_interaction.js';
|
|
4
4
|
/**
|
|
@@ -15,7 +15,7 @@ import { ContractFunctionInteraction } from './contract_function_interaction.js'
|
|
|
15
15
|
this.artifact = artifact;
|
|
16
16
|
this.wallet = wallet;
|
|
17
17
|
this.methods = {};
|
|
18
|
-
artifact.
|
|
18
|
+
getAllFunctionAbis(artifact).forEach((f)=>{
|
|
19
19
|
const interactionFunction = (...args)=>{
|
|
20
20
|
return new ContractFunctionInteraction(this.wallet, this.instance.address, f, args);
|
|
21
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy_method.d.ts","sourceRoot":"","sources":["../../src/contract/deploy_method.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,KAAK,gBAAgB,
|
|
1
|
+
{"version":3,"file":"deploy_method.d.ts","sourceRoot":"","sources":["../../src/contract/deploy_method.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,KAAK,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,WAAW,CACzB,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,aAAa,GAAG,sBAAsB,CAAC,GACpE,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,mBAAmB,CAAC,CAAC;IAIhE,sCAAsC;IACtC,IAAW,OAAO,6BAEjB;IAED,uDAAuD;IACvD,IAAW,cAAc,4BAExB;CACF"}
|
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 {
|
|
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';
|
package/dest/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAEzE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,KAAK,SAAS,EAAE,UAAU,EAAE,MAAM,o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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 {
|
|
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
|
|
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(
|
|
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,E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EG;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
|
|
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(
|
|
54
|
+
*/ async loadPrivate(recipient, contract, slot) {
|
|
55
55
|
const extendedNotes = await this.pxe.getNotes({
|
|
56
|
-
|
|
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.
|
|
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.
|
|
83
|
-
"@aztec/ethereum": "0.
|
|
84
|
-
"@aztec/foundation": "0.
|
|
85
|
-
"@aztec/l1-artifacts": "0.
|
|
86
|
-
"@aztec/protocol-contracts": "0.
|
|
87
|
-
"@aztec/stdlib": "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"
|
package/src/account/contract.ts
CHANGED
|
@@ -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
|
-
|
|
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.
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
163
|
-
|
|
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
|
-
|
|
179
|
-
|
|
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.
|
|
233
|
+
return (await this.accountContract.getDeploymentFunctionAndArgs()) !== undefined;
|
|
225
234
|
}
|
|
226
235
|
}
|
|
227
236
|
|
package/src/api/abi.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export {
|
|
2
2
|
type ContractArtifact,
|
|
3
3
|
type FunctionArtifact,
|
|
4
|
+
type FunctionAbi,
|
|
4
5
|
EventSelector,
|
|
6
|
+
FunctionType,
|
|
5
7
|
FunctionSelector,
|
|
6
8
|
FunctionCall,
|
|
7
9
|
NoteSelector,
|
|
@@ -15,6 +17,8 @@ export {
|
|
|
15
17
|
isWrappedFieldStruct,
|
|
16
18
|
isFunctionSelectorStruct,
|
|
17
19
|
loadContractArtifact,
|
|
20
|
+
loadContractArtifactForPublic,
|
|
21
|
+
getAllFunctionAbis,
|
|
18
22
|
contractArtifactToBuffer,
|
|
19
23
|
contractArtifactFromBuffer,
|
|
20
24
|
} from '@aztec/stdlib/abi';
|
package/src/contract/checker.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
type AbiType,
|
|
3
|
+
type BasicType,
|
|
4
|
+
type ContractArtifact,
|
|
5
|
+
type StructType,
|
|
6
|
+
getDefaultInitializer,
|
|
7
|
+
} from '@aztec/stdlib/abi';
|
|
2
8
|
|
|
3
9
|
/**
|
|
4
10
|
* Represents a type derived from input type T with the 'kind' property removed.
|
|
@@ -38,8 +44,7 @@ export function abiChecker(artifact: ContractArtifact) {
|
|
|
38
44
|
});
|
|
39
45
|
});
|
|
40
46
|
|
|
41
|
-
|
|
42
|
-
if (!artifact.functions.find(func => func.name === 'constructor')) {
|
|
47
|
+
if (!getDefaultInitializer(artifact)) {
|
|
43
48
|
throw new Error('ABI has no constructor');
|
|
44
49
|
}
|
|
45
50
|
|
|
@@ -2,8 +2,9 @@ import {
|
|
|
2
2
|
type ContractArtifact,
|
|
3
3
|
type ContractNote,
|
|
4
4
|
type FieldLayout,
|
|
5
|
-
type
|
|
5
|
+
type FunctionAbi,
|
|
6
6
|
FunctionSelector,
|
|
7
|
+
getAllFunctionAbis,
|
|
7
8
|
} from '@aztec/stdlib/abi';
|
|
8
9
|
import { type ContractInstanceWithAddress, computePartialAddress } from '@aztec/stdlib/contract';
|
|
9
10
|
|
|
@@ -52,7 +53,7 @@ export class ContractBase {
|
|
|
52
53
|
/** The wallet used for interacting with this contract. */
|
|
53
54
|
public wallet: Wallet,
|
|
54
55
|
) {
|
|
55
|
-
artifact.
|
|
56
|
+
getAllFunctionAbis(artifact).forEach((f: FunctionAbi) => {
|
|
56
57
|
const interactionFunction = (...args: any[]) => {
|
|
57
58
|
return new ContractFunctionInteraction(this.wallet, this.instance.address, f, args);
|
|
58
59
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import { type ContractArtifact, type FunctionArtifact, getInitializer } from '@aztec/stdlib/abi';
|
|
2
|
+
import { type ContractArtifact, type FunctionAbi, type FunctionArtifact, getInitializer } from '@aztec/stdlib/abi';
|
|
3
3
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
4
|
import {
|
|
5
5
|
type ContractInstanceWithAddress,
|
|
@@ -51,7 +51,7 @@ export class DeployMethod<TContract extends ContractBase = Contract> extends Bas
|
|
|
51
51
|
private instance?: ContractInstanceWithAddress = undefined;
|
|
52
52
|
|
|
53
53
|
/** Constructor function to call. */
|
|
54
|
-
private constructorArtifact:
|
|
54
|
+
private constructorArtifact: FunctionAbi | undefined;
|
|
55
55
|
|
|
56
56
|
constructor(
|
|
57
57
|
private publicKeys: PublicKeys,
|
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 {
|
|
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
|
|
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(
|
|
69
|
+
public async loadPrivate(recipient: AztecAddress, contract: AztecAddress, slot: Fr | bigint): Promise<Note[]> {
|
|
70
70
|
const extendedNotes = await this.pxe.getNotes({
|
|
71
|
-
|
|
71
|
+
recipient,
|
|
72
72
|
contractAddress: contract,
|
|
73
73
|
storageSlot: new Fr(slot),
|
|
74
74
|
});
|